text stringlengths 12 6.59M |
|---|
# Author: Wei Xue <xuewei4d@gmail.com>
# Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import sys
import copy
import warnings
import pytest
import numpy as np
from scipy import stats, linalg
from sklearn.covariance import EmpiricalCovariance
from sklearn.datasets.samples_gener... |
import os
import time
import sys
import math
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from vmmaster.core.utils.init import home_dir
from vmmaster.core.config import setup_config, config
setup_config('%s/config.py' % home_dir())
from vmmaster.core.db import Session, LogStep
from vmm... |
import os
import numpy as np
from .spectrogram import db_scale, positive_freq_magnitudes, create_window, \
select_positive_freq_fft, fftfreqs
from .analysis import read_blocks
from .tuning import PitchQuantizer, Tuning
from .plots import save_raw_spectrogram_bitmap
def cross_spectrum(spectrumA, spectrumB):
""... |
import os
import sys
import glob
import shutil
import errno
import logging
from contextlib import contextmanager
from plumbum.lib import _setdoc, IS_WIN32, six
from plumbum.path.base import Path, FSUser
from plumbum.path.remote import RemotePath
try:
from pwd import getpwuid, getpwnam
from grp import getgrgid, ... |
#
# localDocker.py - Implements the Tango VMMS interface to run Tango jobs in
# docker containers. In this context, VMs are docker containers.
#
import random, subprocess, re, time, logging, threading, os, sys, shutil
import config
from tangoObjects import TangoMachine
def timeout(command, time_out=1):... |
"""This module implements all state handling during uploads and downloads, the
main interface to which being the TftpContext base class and the TftpState
base class.
The concept is simple. Each context object represents a single upload or
download, and the state object in the context object represents the current
sta... |
from os import path
import torch
import torch.utils.data as td
import torchvision.datasets as dsets
import torchvision.transforms as tt
import vsrl_utils as vu
from faster_rcnn.datasets.factory import get_imdb
import faster_rcnn.roi_data_layer.roidb as rdl_roidb
import numpy as np
import model as md
COCO_IMGDIR = "/... |
import json
from botapi import Message
class TGCommandBase(object):
def __init__(self, command, method, description='', prefix=False, printable=True):
self.command = command
self.method = method
self.description = description
self.prefix = prefix
self.printable = printable
... |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
"""
Tool Description
================
This tool helps with finding Qt4 tools and libraries,
and also provides syntactic sugar for using Qt4 tools.
The following snippet illustrates the tool usage::
def options(opt):
opt.load('compiler_cxx qt... |
"""Network structures commonly used in simulations of evolution."""
from .models import Network
from .nodes import Agent, Source
import random
from operator import attrgetter
class Chain(Network):
"""Source -> Node -> Node -> Node -> ...
The source is optional, but must be added first.
"""
__mapper... |
# Copyright (c) 2013 OpenStack Foundation
#
# Author: Swann Croiset <swann.croiset@bull.net>
#
# 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.... |
"""Services implemented by the AWS provider."""
import logging
import string
from botocore.exceptions import ClientError
import cachetools
import requests
import cloudbridge.cloud.base.helpers as cb_helpers
from cloudbridge.cloud.base.resources import ClientPagedResultList
from cloudbridge.cloud.base.services impor... |
import hashlib
import logging
import time
import uuid
from collections import namedtuple
import googleapiclient
from retrying import retry
import cloudbridge as cb
from cloudbridge.cloud.base.resources import ClientPagedResultList
from cloudbridge.cloud.base.resources import ServerPagedResultList
from cloudbridge.cl... |
#!/usr/bin/env python
# encoding: UTF-8
import functools
import unittest
import xml.etree.ElementTree as ET
from chameleon import PageTemplateFile
import pkg_resources
from cloudhands.burst.appliance import find_catalogueitems
from cloudhands.burst.appliance import find_customizationscript
from cloudhands.burst.appl... |
"""Rstcheck configuration functionality."""
import configparser
import contextlib
import enum
import pathlib
import typing
import pydantic
from . import _extras
if _extras.TOMLI_INSTALLED: # pragma: no cover
import tomli
CONFIG_FILES = [".rstcheck.cfg", "setup.cfg"]
if _extras.TOMLI_INSTALLED: # pragma: no ... |
#Programmer: Chris Tralie
#Purpose: To provide a simple polygon mesh class on top of numpy and PyOpenGL
#capable of reading and writing off files, as well as rendering meshes and
#performing some simple geometric and topological manipulations
from Primitives3D import *
from OpenGL.GL import *
from OpenGL.arrays import ... |
import os
import cmd
import signal
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from blackwidow import BlackWidow
from blackwidow import parser
from blackwidow.network import *
import spider
import json
from cStringIO import StringIO
class BlackWidowInteractive(cmd.Cmd):
def create_netwo... |
# Copyright (C) 2016 Antoine Carme <Antoine.Carme@Laposte.net>
# All rights reserved.
# This file is part of the Python Automatic Forecasting (PyAF) library and is made available under
# the terms of the 3 Clause BSD license
import pandas as pd
import numpy as np
# from memory_profiler import profile
from . import ... |
##############################################################################
#
# Copyright (C) 2019 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Christopher Meier <dev@c-meier.ch>
#
# The licence is in the file __manifest__.py
#
#####################... |
from vtk import *
source = vtkRandomGraphSource()
source.SetNumberOfVertices(15)
source.SetStartWithTree(True)
source.SetIncludeEdgeWeights(True)
bfs = vtkBoostBreadthFirstSearch()
bfs.AddInputConnection(source.GetOutputPort())
bfs.SetOriginVertex(0)
view = vtkGraphLayoutView()
view.AddRepresentationFromInputConnect... |
"""
Django settings for server project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
#!/usr/bin/env python
'''Rudix Package Manager -- RPM ;D
Usage: rudix [-h|-v|-l|-R|-K|-u] [-I <pkg-path>|-L <package-id>|-i <package-id>|-r <package-id>|-s <package-id>|-S <path>|-V <package-id>|-f <package-id>|-n <package-id>]
List all installed packages (package-id) unless options are given, like:
-h This help... |
from os.path import abspath, dirname, join
from devilry.defaults.settings import *
## Convenience to use paths relative to this file. With the magic below,
## PARENT_DIR is set to the productionenv directory. Some settings below use
## join(PARENT_DIR, 'something') to create OS-independent filesystem paths
## relative... |
"""
Utils: surface2ind_topo
=======================
Here we show how to use :code:`Utils.surface2ind_topo` to identify
cells below a topographic surface and compare the different options
"""
import numpy as np
from SimPEG import Mesh
from SimPEG import Utils
from SimPEG.Utils import surface2ind_topo, mkvc
import matpl... |
"""
=====================
Resampling Strategies
=====================
In *auto-sklearn* it is possible to use different resampling strategies
by specifying the arguments ``resampling_strategy`` and
``resampling_strategy_arguments``. The following example shows common
settings for the ``AutoSklearnClassifier``.
"""
im... |
#!/usr/bin/env python2
import os.path
from datetime import time
from osgeo import ogr, osr
import TimeGenerator
import LocGenerator
import LocConstraintChecker
import TripGenerator
import trips_io
import sla_io
import vic_planning_zones_info as pz_info
import od_reader_VISTA as od_reader
#import test_data
def get_tr... |
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
from FWCore.ParameterSet.VarParsing import VarParsing
options =VarParsing('analysis')
options.register('config', default = '', mult = VarParsing.multiplicity.singleton, mytype = VarParsing.varType.string, info = 'Single-switch config. Values: 03Feb2017, 23Sep2016, Spring16, Summer16')
options.register('globaltag', def... |
import os
from FWCore.ParameterSet.VarParsing import VarParsing
options =VarParsing('analysis')
options.register('config', default = '', mult = VarParsing.multiplicity.singleton, mytype = VarParsing.varType.string, info = 'Single-switch config. Values: 03Feb2017, 23Sep2016, Spring16, Summer16')
options.register('globa... |
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# conse... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
##############################################################################
#
# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole respons... |
# Copyright 2018 Northern.tech AS
#
# 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 a... |
#!/usr/bin/env python
from __future__ import division
import sys, os, subprocess, inspect, shutil, argparse, re
from natsort import natsorted
import warnings
from Bio import SeqIO
with warnings.catch_warnings():
warnings.simplefilter('ignore')
from Bio import SearchIO
#import funannotate library
currentdir = o... |
#
# Copyright (c) 2008 Daniel Truemper truemped@googlemail.com
#
# __init__.py 07-Jan-2011
#
# 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
#
# U... |
#!/bin/env python
#
# RnaChipIntegrator.py: analyse RNA-seq and ChIP-seq data
# Copyright (C) University of Manchester 2011 Peter Briggs
#
########################################################################
#
# RnaChipIntegrator.py
#
#########################################################################... |
#
# Copyright (c) 2008 Daniel Truemper truemped@googlemail.com
#
# __init__.py 07-Jan-2011
#
# 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 licen... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
#! /usr/bin/env python
import os
import datetime
import optparse
import lsf
option_parser = optparse.OptionParser()
option_parser.add_option('-m','--make_jobs',action='store_true')
option_parser.add_option('-s','--submit_jobs',action='store_true')
option_parser.add_option('-q','--queue',default='long_serial')
option... |
import logging
from cStringIO import StringIO
from math import exp
from lxml import etree
from path import path # NOTE (THK): Only used for detecting presence of syllabus
import requests
from datetime import datetime
import dateutil.parser
from xmodule.modulestore import Location
from xmodule.seq_module import Sequen... |
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
#!/usr/bin/env python
#
# module_tests.py: testing modules / external sources.
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under ... |
import os
import pyfits
import numpy as np
import glob
import shutil
import time
import matplotlib.pyplot as plt
# testing by Britt
USE_PLOT_GUI=False
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
import matplotlib.ticker as mticker
from pyraf import iraf
from iraf... |
""" NIPAP API
=========
This module contains the Nipap class which provides most of the backend
logic in NIPAP apart from that contained within the PostgreSQL database.
NIPAP contains four types of objects: ASNs, VRFs, prefixes and pools.
VRF
------
A VRF represents a Virtual Routing and ... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Heffte(CMakePackage, CudaPackage, ROCmPackage):
"""Highly Efficient FFT for Exascale"""
... |
"""
This module implements a simple REST API that behaves like SONATA's gatekeeper.
It is only used to support the development of SONATA's SDK tools and to demonstrate
the year 1 version of the emulator until the integration with WP4's orchestrator is done.
"""
import logging
import os
import uuid
import hashlib
impo... |
# deal with unicode literals: http://www.python.org/dev/peps/pep-0263/
# vim: set fileencoding=utf-8 :
"""
----------------
IMAP SYNC ENGINE
----------------
Okay, here's the deal.
The IMAP sync engine runs per-folder on each account. This allows behaviour
like the Inbox to receive new mail via polling while we're st... |
from __future__ import division
from hoomd import *
from hoomd import hpmc
import numpy as np
import math
import unittest
context.initialize()
#seed_list=[123, 456]
seed_list = [123]
#phi_c_list=[0.01, 0.05, 0.10, 0.2, 0.3]
phi_c_list=[0.1]
#eta_p_r_list=[0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0]
eta_p_r_l... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import shutil
import string
import math
import random
from os.path import (
abspath,
join,
)
from argparse import ArgumentParser
from collections import namedtuple
from subprocess import (
check_call,
CalledProcessError,
)
import shle... |
#!/usr/bin/python
# Copyright (c) Lightstreamer Srl.
#
# 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... |
#
# actions.py: routines that actually run the svn client.
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2006 CollabNet. All rights reserved.
#
# This software is ... |
#!/usr/bin/env python
# coding: utf-8
import re
from collections import Counter
def clean(s):
""" Get rid of any non-alphabetic character and clean up whitespace. """
# Remove everything that isn't an alphabet character (only interested
# in words, not numbers or punctuation).
s = re.sub(r'[^a-zA-Z]... |
from lib.settings_base import *
from mkt.settings import *
from settings_base import *
import private_mkt
SERVER_EMAIL = 'zmarketplacedev@addons.mozilla.org'
DOMAIN = "marketplace-dev.allizom.org"
SITE_URL = 'https://marketplace-dev.allizom.org'
SERVICES_URL = SITE_URL
STATIC_URL = 'https://marketplace-dev-cdn.alliz... |
#!/usr/bin/env python
# coding: utf-8
import sys
import calendar
import requests
import zenhan
import argparse
class CSV_Struct:
""".csvに書き込む際の構造体."""
def __init__(self):
self.sub = ''
self.start = ''
self.end = ''
# 終日はTRUEとしておく
self.ALL_DAY = 'TRUE'
def month_search(... |
#!/usr/bin/env python
"""
This module is for creating or editing a MagIC contribution,
(or a piece of one).
You can build a contribution or an individual table from the ground up,
or you can read in one or more MagIC-format files.
You can also extract specific data from a table --
for instance, you can build a DIblock... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from pyotp.hotp import HOTP # noqa
from pyotp.otp import OTP # noqa
from pyotp.totp import TOTP # noqa
from . import utils # noqa
def random_base32(length=16, random=None,
chars=list('ABC... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Heffte(CMakePackage):
"""Highly Efficient FFT for Exascale"""
homepage = "https://bit... |
import ast
import inspect
import warnings
import linecache
from uuid import uuid4
from textwrap import dedent
from collections import OrderedDict
from astmonkey.transformers import ParentNodeTransformer
from astmonkey.visitors import SourceGeneratorNodeVisitor
SPLIT = 'split'
def split(func, name=None):
return ... |
class modERN_TF_control(object):
def __init__(self, alignments=None, unique_signal=None,
normalized_signal=None, assembly=None, replicates=None):
self.alignments = alignments
self.unique_signal = unique_signal
self.normalized_signal = normalized_signal
self.assembly... |
from nose.tools import eq_
from bleach import Bleach
"""More advanced security tests"""
b = Bleach()
def test_nested_script_tag():
eq_('<<script>script>evil()<</script>/script>',
b.clean('<<script>script>evil()<</script>/script>'))
eq_('<<x>script>evil()<</x... |
#
# factory.py: Automatically generate a (near-)complete new cmdline test
# from a series of shell commands.
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) ... |
"""
find.py - Willie Spelling correction module
Copyright 2011, Michael Yanovich, yanovich.net
Copyright 2013, Edward Powell, embolalia.net
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net
Contributions from: Matt Meinwald and Morgan Goose
This module will fix spelling errors if someone corrects the... |
import os
import pyfits
import numpy as np
import glob
import shutil
import matplotlib.pyplot as plt
USE_PLOT_GUI=False
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from pyraf import iraf
from iraf import iraf
import threedhst
import threedhst.eazyPy as eazy
impo... |
# Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... |
"""Module containing tools to assist in building of WSGI routers.
This routing system works by tracking the UNrouted part of the request, and
watching how it changes as it passes through various routers.
"""
from pprint import pprint
import collections
import logging
from webtest import TestApp as WebTester
fro... |
""" Funcitons to compute the right hand side matrix of neutrino evolution and diagonalized it.
"""
import tables
import numpy as np
import scipy as sp
from numpy import linalg as LA
def get_RHS_matrices(energy_nodes, sigma_array, dxs_array, ReverseTime=False):
""" Returns the right hand side (RHS) matrices.
... |
#!/usr/bin/env python
import os
import sys
import atexit
import json
import sqlite3
from multiprocessing import Pool
import requests
from colorama import init
from .db import Database
from .utils import Utils
class DocumentCloudUploader(object):
"""
Main class containing functions to build and confirm file l... |
#!/bin/python
#
#
# The MIT License (MIT)
#
# Copyright (c) 2015 JP Senior jp.senior@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitat... |
import idaapi
from idc import *
class SMC:
GlobalCounter = 0
def make_unknown(self):
for seg in Segments():
if idc.SegName(seg) == '.text':
start = idc.SegStart(seg)
end = idc.SegEnd(seg)
while start < end:
i=idautils.DecodeInstruction(start)
... |
__author__ = 'Will Hart'
import logging
import os
import threading
import time
from redis import ConnectionError
import serial
from serial.tools.list_ports import comports
from blitz.constants import CommunicationCodes, SerialUpdatePeriod, SerialCommands
from blitz.data.database import DatabaseServer
from blitz.comm... |
# Copyright 2014-2015 ARM Limited
#
# 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 w... |
# -*- coding: utf-8 -*-
##############################################################################
# Copyright (C) 2012 SICLIC http://siclic.fr
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Fr... |
from weatbag import words
from weatbag.utils import transfer
class Tile:
def __init__(self):
self.contents = {'match': 42}
def describe(self):
print("You are standing in the mouth of a cave. The air "
"feels cool and is filled with the stench of rotting flesh. "
"A ... |
import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = "1"
from src.python.consts import *
from src.python.preprocess import *
from src.python.geneontology import *
from src.python.baselines import *
from pymongo import MongoClient
from tqdm import tqdm
import tensorflo... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
import logging
l = logging.getLogger("rex.Crash")
import os
import md5
import angr
import angrop
import tracer
from rex.exploit import CannotExploit, CannotExplore, ExploitFactory, CGCExploitFactory
from rex.vulnerability import Vulnerability
from simuvex import s_options as so
class NonCrashingInput(Exception):
... |
from math import isclose
from random import choice, random, uniform
import numpy as np
from scipy.spatial import Delaunay, distance
from sqlalchemy import text
from sqlalchemy.orm.session import make_transient
from htsohm import db
from htsohm.db import Material, Structure, LennardJones, AtomSites
from htsohm.pseudom... |
import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = "1"
from src.python.consts import *
from src.python.preprocess import *
from src.python.geneontology import *
from src.python.baselines import *
from pymongo import MongoClient
from tqdm import tqdm
import tensorflo... |
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
'''
The MIT License (MIT)
Copyright (c) 2013-2017 Robert H Chase
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,... |
from random import randint
from Crypto.Hash import SHA256
from zlib import crc32
from htsohm.db import Material
from htsohm.structure import Structure, LatticeConstants, AtomSite, AtomType
def get_n_digit_seed(n):
range_start = 10 ** (n - 1)
range_end = (10 ** n) - 1
return randint(range_start, range_end... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Metall(CMakePackage):
"""An allocator for persistent memory"""
homepage = "https://github.com/LLNL/metall"... |
import json
class Property(object):
"""Abstracts a property parsed from a spec file."""
def __init__(self, name, data_type, functional=False, locking=True):
"""
Defines a property parsed from a spec file.
:param name: The name of the property
:type name: str
:param da... |
'''
Flexible Data Gathering: process_status
=================================
This fdg module allows for displaying the currently-running
processes, with various options for filtering
'''
from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
def list_processes(chained=None):
... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
from flask import Flask, session, redirect, url_for, escape, request, jsonify
from flask.ext.pymongo import PyMongo
from bson.objectid import ObjectId
from pprint import pformat
import sys
import re
app = Flask("tianguis")
mongo = PyMongo(app)
@app.route('/ofertas/save', methods=['POST', 'GET'])
def ofertas_save()... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.code import StaticForEach, connect
from hwt.hdlObjects.types.struct import HStruct
from hwt.interfaces.std import Handshaked, Signal
from hwt.interfaces.utils import propagateClkRstn, addClkRstn
from hwt.synthesizer.interfaceLevel.unit import Unit
from hwt.synthe... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path
import shutil
import sys
import tempfile
import spack.util.environment
class Octave(AutotoolsPackage, GNU... |
from ethereum import tester
from ethereum import utils
from hydrachain import native_contracts as nc
from ethereum import abi, slogging
from ethereum.utils import zpad
import pytest
import logging
import random, string
logging.NOTSET = logging.INFO
slogging.configure_logging(':info')
"""
test registration
test calli... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import platform
import re
import llnl.util.tty as tty
from llnl.util.lang import match_predicate
from llnl.util... |
# -*- coding: utf-8 -*-
"""
rio.setup
~~~~~~~~~
"""
from os import environ
from os import path
from .core import db
from .core import celery
from .core import redis
from .core import cache
from .core import sentry
from .core import migrate
def configure_app(app):
"""Configure Flask/Celery application.
* Rio... |
# -*- coding: utf-8 -*-
"""
rio.tasks
~~~~~~~~~~
Implement of rio tasks based on celery.
"""
from time import time
from celery import chord
from requests import ConnectionError
from celery.utils.log import get_task_logger
from rio.core import celery
from rio.core import sentry
from rio.utils.http import dispatch_w... |
import datetime
import logging
from decimal import Decimal
from django.conf import settings
from django.db import models
from django.db.models import Q, Avg, Sum, Max, Min
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS
from timepiece import utils
from... |
import joblib
import mdp
import numpy as np
import sys
from enum import Enum
import foreca.foreca_node as foreca_node
import gpfa
import sffa
#sys.path.append('/home/weghebvc/workspace/git/explot/src/')
#import explot as ep
sys.path.append('/home/weghebvc/workspace/git/GNUPFA/src/')
import PFANodeMDP
sys.path.appe... |
# coding: utf-8
from __future__ import unicode_literals
import copy
import requests
import webbrowser
from .exceptions import ResponseProcessException
class TapiocaInstantiator(object):
def __init__(self, adapter_class):
self.adapter_class = adapter_class
def __call__(self, *args, **kwargs):
... |
"""
Analyzer for running analysis on given data models :)
Hopefully all the methods in here will be uses for analyzing the data. If that
stops being true and if I were a good developer (it wouldn't have happened in
the first place) I would update this documentation.
"""
import operator
import time
from collections im... |
import pandas as pd
from pyne import nucname, material
from astropy import units as u
class IsotopeAbundances(pd.DataFrame):
@property
def _constructor(self):
return IsotopeAbundances
def _update_material(self):
self.comp_dicts = [{}] * len(self.columns)
for (atomic_number, mass_n... |
import json
import re
import os.path
import subprocess
import time
def parse_setting():
setting_file = open('setting.json', 'r')
return json.loads(setting_file.read())
setting = parse_setting()
if not os.path.isdir(setting['server_directory']):
raise FileNotFoundError('서버 프로그램이 존재하지 않습니다: ' + setting['... |
import os
import json
import sys
import numpy as np
from maxEntropyModel import cond_prob, loadWordListDict, train
from utilities import loadUsefulTrainingData
from srs import settings
def getPredictorDataFilePath(filename):
predictor_datafile_path = os.path.join(settings["predictor_data"], filename)
if os.path.e... |
import urllib2, httplib, datetime, operator
try:
import json
except ImportError:
import simplejson as json
# Site constants
StackOverflow = 'api.stackoverflow.com'
SuperUser = 'api.superuser.com'
ServerFault = 'api.serverfault.com'
StackApps = 'api.stackapps.com'
MetaStackOverflow = 'api.meta.stackoverflow.com'
###... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.