gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from data.COMMON import * #essentials
Header( 0.001, #Script Version (for updates)
('Nintendo',['mdl0','brmdl']), #model activation
('',[]), #anim activation
['revolution'], #included libs
['NTDO_IMG']) #image handlers
''' UMC model import/export script written by Tcll5850 '''
def ... | |
"""
Script entry point
"""
from src.calrissian.particle2_network import Particle2Network
from src.calrissian.layers.particle2 import Particle2
from src.calrissian.optimizers.particle2_sgd import Particle2SGD
import numpy as np
def main():
# train_X = np.asarray([[0.2, -0.3]])
# train_Y = np.asarray([[0.0, ... | |
#!/usr/bin/env python
import pygame, sys
from pygame.locals import *
import random
import math
class Setup:
DisplaySize = (800, 600)
FPS = 60
Lives = 5
PaddleLimit = (0, 1024)
PaddleSpeed = int((PaddleLimit[1] - PaddleLimit[0])/(0.75 * FPS))
BallSpeed = 2.75
MaxSpeed = 4.8 # should be l... | |
#!/usr/bin/env python
#
# Copyright 2005 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | |
# Copyright (C) 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
#!/usr/bin/env python
"""
Test pycacheback
"""
import os
import shutil
import random
import copy
from pycacheback import pyCacheBack
import unittest
class TestpyCacheBack(unittest.TestCase):
def testSimple(self):
"""A simple 'smoke test' for the extended dictionary."""
# make an extended dictio... | |
# -*- coding: utf-8 -*-
u"""
This script is to parse SRW Python scripts and to produce JSON-file with the parsed data.
It's highly dependent on the external Sirepo/SRW libraries and is written to allow parsing of the .py files using
SRW objects.
:copyright: Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved.
:lice... | |
# 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... | |
from __future__ import division, absolute_import
import time
import types
from itertools import groupby
import six
import numpy as np
from neupy.utils import preformat_value, AttributeKeyDict
from neupy.helpers import table
from neupy.core.base import BaseSkeleton
from neupy.core.properties import (BoundedProperty, ... | |
#!/usr/bin/env python
from subprocess import Popen, PIPE
from threading import Thread
from os import path, mkdir, getcwd, remove, getenv, environ, pathsep
from getpass import getuser
from random import choice
from string import hexdigits
from argparse import ArgumentParser
from shutil import rmtree
import atexit
import... | |
# Copyright 2010 Jacob Kaplan-Moss
# 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.apache.org/lic... | |
#!/usr/bin/env python
# Copyright (C) 2015 Wayne Warren
#
# 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... | |
# -*- coding: UTF-8 -*-
from insights.client.phase.v1 import post_update
from mock.mock import patch, MagicMock
from pytest import raises
def patch_insights_config(old_function):
patcher = patch("insights.client.phase.v1.InsightsConfig",
**{"return_value.load_all.return_value.status": False,
... | |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 (c) 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
import datetime
import hashlib
import logging
import os
from email.headerregistry import Address
from email.parser import Parser
from email.policy import default
from email.utils import formataddr, parseaddr
from typing import Any, Dict, List, Mapping, Optional, Tuple
import orjson
from django.conf import settings
fro... | |
# Copyright (c) 2013-2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
# -*- coding: UTF-8 -*-
#############################################
## (C)opyright by Dirk Holtwick, 2008 ##
## All rights reserved ##
#############################################
from webob import Request, Response
from webob import exc
from paste.urlparser import StaticURLParser
from pas... | |
import os
class Streams():
def __init__(self):
''' Constructor. '''
self.root = "/home/pi/Music"
self.predefinedStreams = [
{
"name": "Radio ZET",
"stream": "http://n-1-11.dcs.redcdn.pl/sc/o2/Eurozet/live/audio.livx",
"isRadio": T... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | |
import os
import sys
from optparse import OptionParser
import imp
import django
from django.core.management.base import BaseCommand, CommandError, handle_default_options
# For backwards compatibility: get_version() used to be in this module.
get_version = django.get_version
# A cache of loaded commands, so that call... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 jeffZhuo
#
# 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 re... | |
# Copyright 2012 Josh Durgin
# Copyright 2013 Canonical Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | |
import json
from django.http import HttpResponse
from django.template.loader import get_template
from django.template import Context
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from djang... | |
from __future__ import print_function
import os
import httplib2
from apiclient import discovery
import logging
from functools import wraps
import creds
# time to stop
_MAX_COUNT = 10000
# Page size for API list call
_PAGE_SIZE = 500;
_LOG_FILENAME = 'listfiles.log'
_LOG_FILE_PATH = 'log'
if not os.path.exists(_L... | |
# Copyright 2019 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 os
import unittest
import re
from mock import MagicMock
from PyAnalysisTools.base.ProcessConfig import ProcessConfig, parse_and_build_process_config, find_process_config, \
Process
from PyAnalysisTools.base.YAMLHandle import YAMLLoader as yl
cwd = os.path.dirname(__file__)
class TestProcess(unittest.Test... | |
"""
Functions:
score_tfbs_genome Score the TFBS in a genomic location (from filesystem).
load_matrices
list_matrices Return a list of (matrix ID, gene symbol).
matid2matrix Return the matrix for a matrix ID.
gene2matrices Return all matrices for a gene symbol.
is_matrix_id
find_matrix_file
... | |
# Template for new Pygame project
# KidsCanCode 2014
import pygame
import sys
import random
# define some colors (R, G, B)
BLACK = (0, 0, 0)
GRAY = (155, 155, 155)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
YELLOW = (255, 255, 0)
PURPLE = (119, 22, 245)
ORANGE = (255, 159, 0)
BGCO... | |
# Copyright 2012-2014 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 ac... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import now, cint
from frappe.model import no_value_fields
from frappe.model.document import Document
from frappe.custom.doct... | |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: urban@reciprocitylabs.com
# Maintained By: urban@reciprocitylabs.com
"""Make Request First-class object
Revision ID: 27684e5f313a
Revises: 3c8f204... | |
from datetime import datetime
from hashlib import sha1
try:
from PIL import Image
except ImportError:
import Image
import errno
import logging
import os
import traceback
from django.conf import settings
from django import template
from watermarker import utils
from watermarker.models import Watermark
register... | |
# Copyright (c) 2017, John Skinner
import unittest
import core.benchmark
import core.trial_comparison
import trials.slam.tracking_state
import benchmarks.tracking.tracking_comparison_benchmark as track_comp
class MockTrialResult:
def __init__(self, tracking_states):
self._tracking_states = tracking_state... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
import json
from pymatgen.core.structure import Molecule
from pymatgen.io.nwchem import NwTask, NwInput, NwInputError, NwOutput
test_dir = os.path.join(os.path.dirname(__file__), ".... | |
# Copyright 2015 SolidBuilds.com. All rights reserved.
#
# Authors: Ling Thio <ling.thio@gmail.com>
"""
SQLAlchemy-boolean-search
=========================
SQLAlchemy-boolean-search translates a boolean search expression such as::
field1=*something* and not (field2==1 or field3<=10.0)
into its corresponding SQLA... | |
from types import IntType, StringType, UnicodeType
import time
import datetime
import calendar
import os
import sys
class Config(dict):
'''
based on http://stackoverflow.com/questions/4984647/accessing-dict-keys-like-an-attribute-in-python
create a config object based on an imported module.
with the m... | |
"""
Internal shared-state variables such as config settings and host lists.
"""
import os
import sys
from optparse import make_option
from fabric.network import HostConnectionCache, ssh
from fabric.version import get_version
from fabric.utils import _AliasDict, _AttributeDict
#
# Win32 flag
#
# Impacts a handful o... | |
import logging
import sqlite3
from common import utils
from models.artist import Artist
from models.album import Album
from models.base import BaseModel
logging.basicConfig(format="%(asctime)s %(message)s", level=logging.DEBUG)
class Track(BaseModel):
def __init__(self, db, id=None, **kwargs):
self._d... | |
from __future__ import absolute_import
import time
import logging
import random, base64, struct
import hashlib
import os
import urllib
import sys
from pgoapi.exceptions import (ServerSideRequestThrottlingException,
NotLoggedInException, ServerBusyOrOfflineException,
... | |
from django.db import models
from django.forms.models import BaseInlineFormSet as _BaseInlineFormSet
from django.utils.translation import ugettext_lazy as _
from django_superform import SuperModelForm
from django_superform.forms import SuperModelFormMetaclass
from floppyforms import fields
from floppyforms.__future__.m... | |
# Copyright (c) 2018 PaddlePaddle 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 app... | |
'''
monte carlo tool for simple strategy, more generally for use with any
strategy that I want to back test...
Engine takes a class instance, derived from a base class wih two methods
initialise()
onsimulation()
aftersimulation()
ontrial()
finalise()
'''
import unittest, datetim... | |
import json
import requests
from bs4 import BeautifulSoup
from espncricinfo.exceptions import MatchNotFoundError, NoScorecardError
class Match(object):
def __init__(self, match_id):
self.match_id = match_id
self.match_url = "https://www.espncricinfo.com/matches/engine/match/{0}.html".format(str(ma... | |
"""Snuggs are s-expressions for Numpy."""
from collections import OrderedDict
import functools
import itertools
import operator
import re
import sys
from pyparsing import (
alphanums, ZeroOrMore, nums, oneOf, Word, Literal, Combine, QuotedString,
ParseException, Forward, Group, CaselessLiteral, Optional, alph... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 15 22:52:57 2017
@author: mariapanteli
"""
import os
import numpy as np
import pandas as pd
import pickle
from sklearn.model_selection import train_test_split
import extract_primary_features
import load_features
import util_filter_dataset
WIN_SIZE = 8
DATA_DIR = 'data... | |
"""
test date_range, bdate_range construction from the convenience range functions
"""
from datetime import (
datetime,
time,
timedelta,
)
import numpy as np
import pytest
import pytz
from pytz import timezone
from pandas._libs.tslibs import timezones
from pandas._libs.tslibs.offsets import (
BDay,
... | |
"""
Unit tests for the methods in the NMTF class (/code/nmtf_np.py).
"""
import sys, os
project_location = os.path.dirname(__file__)+"/../../../"
sys.path.append(project_location)
import numpy, math, pytest, itertools, random
from BNMTF.code.models.nmtf_np import NMTF
""" Test the initialisation of Omega """
def te... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... | |
#
# 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 re
import urlparse
import pprint
import os
import sys
import redis
from beaker.middleware import SessionMiddleware
from MacroExecutor import MacroExecutorPage, MacroExecutorWiki, MacroExecutorPreprocess
from PortalAuthenticatorOSIS import PortalAuthenticatorOSIS
from RequestContext import RequestContext
from Po... | |
# Copyright 2017 Bracket Computing, 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.
# A copy of the License is located at
#
# https://github.com/brkt/brkt-cli/blob/master/LICENSE
#
# or in the "license" file... | |
#
# Copyright 2015 by Justin MacCallum, Alberto Perez, Ken Dill
# All rights reserved
#
import unittest
import mock
from meld import system
from meld.system import restraints
class TestAlwaysActiveCollection(unittest.TestCase):
def setUp(self):
self.coll = restraints.AlwaysActiveCollection()
def t... | |
import datetime
import functools
import logging
from threading import Lock
import MySQLdb as mariadb
import box
logger = logging.getLogger(__name__)
class DatabaseFile:
def __init__(self, user, password, database):
self.db_args = (user, password, database)
self.database_name = database
s... | |
"""
Field classes.
"""
from __future__ import unicode_literals
import copy
import datetime
import os
import re
import sys
import uuid
import warnings
from decimal import Decimal, DecimalException
from io import BytesIO
from django.core import validators
from django.core.exceptions import ValidationError
# Provide th... | |
import requests
import json
import re
import sys
if sys.version_info > (3,):
long = int
BASE_URL = 'http://things.ubidots.com/api/v1.6/'
def get_response_json_or_info_message(response):
if response.status_code == 204:
resp = {"detail": "this response don't need a body"}
try:
resp = resp... | |
from __future__ import absolute_import, division, print_function
from sqlalchemy import MetaData, Table, Column, types, create_engine, select
from sqlalchemy.sql import and_
from sqlalchemy.dialects import mysql
from ..model import Goal, Test
class LargePickleType(types.PickleType):
def load_dialect_impl(self,... | |
import os
import re
import shutil
import logging
from binascii import b2a_hex
from datetime import datetime
from cStringIO import StringIO
from ConfigParser import ConfigParser
import tg
os.environ['HGRCPATH'] = '' # disable loading .hgrc
from mercurial import ui, hg
from pymongo.errors import DuplicateKeyError
from ... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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 ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | |
"""
Various utilities and helper functions.
"""
from __future__ import division, print_function, absolute_import
import numbers
import math
import numpy as np
from scipy.optimize import brentq
from scipy.stats import (binom, hypergeom, ttest_ind, ttest_1samp)
def binom_conf_interval(n, x, cl=0.975, alternative="two-... | |
import numpy as np
import random
import itertools
import scipy.misc
import matplotlib.pyplot as plt
import tensorflow as tf
import os
#%matplotlib inline
class gameOb():
def __init__(self, coordinates, size, intensity, channel, reward, name):
self.x = coordinates[0]
self.y = coordinates[1]
... | |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | |
# 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... | |
import warnings
warnings.filterwarnings('ignore')
import tensorflow as tf
import numpy as np
import pickle
import time
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__))+'/../')
from dnc_v3 import DNC
from recurrent_controller import StatelessRecurrentController
from torchtext.datasets imp... | |
#!/usr/bin/env python3
"""Tests for the ClientSocket class.
Login with user "edemo" password "demouser" for a demo account that can be used
for basic testing.
"""
import asyncio
import unittest
import numpy as np
import ibapipy.data.contract as dc
import ibapipy.data.order as do
from asyncio import Future
from ibapip... | |
import unittest
import numpy as np
import copy
import builtins
import theano
import theano.tensor as T
import autodiff
import autodiff.utils as utils
import autodiff.context as c
from autodiff.functions import escape
context = autodiff.context.Context(force_floatX=False)
context_floatX = autodiff.context.Context(forc... | |
# Copyright 2012-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
import json
import time
import uuid
from multiprocessing import Process
from multiprocessing import active_children
from pyetcd import EtcdNodeExist, EtcdKeyNotFound
from etcdb import ProgrammingError, OperationalError, LOCK_WAIT_TIMEOUT
from etcdb.sqlparser.parser import SQLParser, SQLParserError
class ColInfo(ob... | |
'''
..
Red9 Studio Pack: Maya Pipeline Solutions
Author: Mark Jackson
email: rednineinfo@gmail.com
Red9 blog : http://red9-consultancy.blogspot.co.uk/
MarkJ blog: http://markj3d.blogspot.co.uk
This is a new implementation of the PoseSaver core, same file format
and ConfigObj but now suppo... | |
# Copyright 2010-2011 OpenStack Foundation
# Copyright (c) 2013 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/licens... | |
# coding: utf-8
"""
Simple gLite job manager. See https://wiki.italiangrid.it/twiki/bin/view/CREAM/UserGuide.
"""
__all__ = ["GLiteJobManager", "GLiteJobFileFactory"]
import os
import sys
import time
import re
import random
import subprocess
from law.config import Config
from law.job.base import BaseJobManager, Ba... | |
import os
import sys
import time
import math
import argparse
import subprocess
import numpy as np
np.set_printoptions(precision=2, linewidth=160)
# MPI
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
# prettyNeat
from neat_src import * # NEAT
from domain import * # Task environments
# -- Run ... | |
#!/usr/bin/python
'''
Copyright 2012 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
'''
Rebaselines the given GM tests, on all bots and all configurations.
'''
# System-level imports
import argparse
import json
import os
import re
import subprocess
... | |
import collections
import logging
import numpy as np
import platform
import random
from typing import List
# Import ray before psutil will make sure we use psutil's bundled version
import ray # noqa F401
import psutil # noqa E402
from ray.rllib.execution.segment_tree import SumSegmentTree, MinSegmentTree
from ray.r... | |
# Copyright (C) 2015 Artem Chepurnoy <artemchep@gmail.com>
#
# This script is published under the terms of the MIT license.
# See http://opensource.org/licenses/mit-license.php
# Python 3 is required
import sys
import itertools
from datetime import datetime
class Clue:
"""
A clue for solving the sudoku.
... | |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | |
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
"""
This file contains implementation of data model for SVC monitor
"""
from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
from cfgm_common.vnc_db import DBBase
from cfgm_common import svc_info
class DBBaseSM(DBBase):
obj_type = __name__
... | |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import os
import time
from... | |
#!/usr/bin/env python
# cmpcodesize/main.py - Command-line entry point for cmpcodesize -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https... | |
# 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 ... | |
#!/usr/bin/python
import fileinput
import string
import sys
import os
mpi = False
if ( mpi ):
print 'Using MPI'
else:
print 'Not using MPI'
fortran_compiler = 'ifort'
fortran_opt_flags = '-g -c -O2 -openmp -heap-arrays'
fortran_link_flags = '-g -O2 -openmp -heap-arrays'
c_compiler = 'icc'
c_opt_flags = '-g ... | |
import os
from aimes.emgr.utils.misc import *
__author__ = "Matteo Turilli"
__copyright__ = "Copyright 2015, The AIMES Project"
__license__ = "MIT"
# -----------------------------------------------------------------------------
def initialize_log(run):
'''Pass.
'''
f = open(run['files']['log'], "a", 1)... | |
#!/usr/bin/python
# Copyright (c) 2012 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.
from __future__ import print_function
import glob
import hashlib
import optparse
import os
import posixpath
import shutil
import ... | |
import unittest
from django import forms
from django.forms.utils import ErrorList
from django.core.exceptions import ValidationError
from wagtail.wagtailcore import blocks
class TestFieldBlock(unittest.TestCase):
def test_charfield_render(self):
block = blocks.CharBlock()
html = block.render("He... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram2d"
_path_str = "histogram2d.hoverlabel"
_valid_props = {
"align",
... | |
from django.test import TestCase
from django.conf import settings
from django.utils import timezone as tz
from django.utils import dateparse
import mock
from msgvis.apps.datatable import models
from msgvis.apps.corpus import models as corpus_models
from msgvis.apps.dimensions.models import CategoricalDimension
from ms... | |
"""The tests for the Entity component helper."""
# pylint: disable=protected-access
from collections import OrderedDict
from datetime import timedelta
import logging
from unittest.mock import Mock, patch
import asynctest
import pytest
from homeassistant.components import group
from homeassistant.const import ENTITY_M... | |
from collections import OrderedDict
from numpy import log10 as nplog10, zeros, min, max, linspace, array, concatenate, isfinite, greater
from uncertainties.unumpy import uarray, nominal_values, std_devs, log10 as umlog10
from CodeTools.PlottingManager ... | |
#!/usr/bin/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.
import glob
import optparse
import os.path
import socket
import sys
import thread
import time
import urllib
# Allow the import of thir... | |
#############################################################################
##
## Copyright (C) 2016 Riverbank Computing Limited.
## Copyright (C) 2006 Thorsten Marek.
## All right reserved.
##
## This file is part of PyQt.
##
## You may use this file under the terms of the GPL v2 or the revised BSD
## license as fol... | |
"""file_extraction.py: extracts the zip attachment(s) from raw email file
provided by the Simple Email Service"""
import os
import zipfile
from collections import namedtuple
from email import policy
from email.parser import BytesParser
__author__ = 'sweetjonnie'
__license__ = 'Apache License 2.0'
__email__ = 'jsavel... | |
# Copyright 2011 Justin Santa Barbara
# 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/lic... | |
# -*- coding: utf-8 -*-
# Copyright 2010-2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | |
# Copyright 2009, Peter A. Bigot
#
# 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 ... | |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from typing import Optional
''' IMPORTS '''
import re
import os
import json
import requests
from base64 import b64encode
''' GLOBAL VARS / INSTANCE CONFIGURATION '''
PARAMS = demisto.params()
USERNAME = PARAMS.get('c... | |
# Convert GPO Fdsys STATUTE metadata into bill files.
#
# GPO has the Statutes at Large from 1951 (the 65th
# volume, 82nd Congress) to the present, with metadata
# at the level of the law.
#
# The bill files have sort of made up action entries
# since we don't know the legislative history of the bill.
# We also assume... | |
# Copyright 2015 IBM Corp
# 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 agreed... | |
""" Visualization of :mod:`time series <pySPACE.resources.data_types.time_series>` based on EEG signals to combine it with mapping to real sensor positions """
import logging
import os, pylab, numpy, warnings
from pySPACE.missions.nodes.visualization.base import VisualizationBase
from pySPACE.resources.dataset_defs.s... | |
#!/usr/bin/env python
"""
github_buildbot.py is based on git_buildbot.py
github_buildbot.py will determine the repository information from the JSON
HTTP POST it receives from github.com and build the appropriate repository.
If your github repository is private, you must add a ssh key to the github
repository for the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.