gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import os
import argparse
import json
from multiprocessing import Pool
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from tmd.pwscf.parseScf import total_energy_eV_from_scf, fermi_from_scf, D_from_scf
from tmd.wannier.parseWout import atom_order_from_wout
from tmd.wannier.bands import Hk... | |
import os
import scipy.stats
import SummedLikelihood
try:
import cPickle as pickle
except:
print("cPickle not found, using pickle instead")
from enrico.fitmaker import FitMaker
from enrico.gtfunction import Observation
from enrico import Loggin
from enrico import utils
class ModelTester(Loggin.Message):
""... | |
# coding: utf-8
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
impor... | |
import os
import numpy as np
import pytest
from pandas import (
Categorical,
DatetimeIndex,
Interval,
IntervalIndex,
NaT,
Series,
TimedeltaIndex,
Timestamp,
cut,
date_range,
isna,
qcut,
timedelta_range,
)
from pandas.api.types import CategoricalDtype as CDT
from pan... | |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <[email protected]>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
# ... | |
# -*- coding: utf-8 -*-
"""
.. _tut-timefreq-twoway-anova:
====================================================================
Mass-univariate twoway repeated measures ANOVA on single trial power
====================================================================
This script shows how to conduct a mass-univariate r... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
"""Clipper Management Utilities"""
from __future__ import print_function, with_statement, absolute_import
from fabric.api import *
from fabric.contrib.files import append
import os
import requests
import json
import yaml
import pprint
import subprocess32 as subprocess
import shutil
from sklearn import base
from sklear... | |
# QMS Classes/Functions stored in this file
# Main methods are used from Shipyard class
# (ie. traverseGrabPackageInside uses traverseGrabPackage
# within container class) to access container/package class methods.
#
# double linked list functions taken from Ron's lecture slides / DLListV2.py
# to ... | |
import logging
import time
import requests
import six.moves.urllib.parse as urlparse
from .. import SSS_VERSION
from .. import SSS_FORMAT
from .. import ACTION_PREFIX
from .. import client
from ..common import constants
from ..common import exceptions
from ..common import serializer
from ..common import utils
from ..... | |
# CSH Touchscreen Software
# Author: Angelo DiNardi ([email protected])
# Beginnings: Nov 21, 2008
import pygame
from pygame.locals import *
import drinkAPI
import math
import time
import sys
from threading import Thread
import signal
pygame.init()
pygame.mouse.set_visible(False)
font = pygame.font.Font(None, 36)
... | |
'''
'
' Spotpost serverside. Provides all functionality for the website and application.
' Allows for location based notes to be viewed and made by users.
'
' @author Jakub Wlodarczyk
' @author Brian Truong
' @author Nate Norgaard
' @author Adam Davis
'
'''
from flask import Flask, session, request, abort, rende... | |
from __future__ import unicode_literals
import itertools
import os
import random
import unicodedata
from collections import defaultdict
from django.conf import settings
from django.core.files import File
from django.template.defaultfilters import slugify
from django.utils.six import moves
from faker import Factory
fr... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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/LICEN... | |
#!/usr/bin/env python
from __future__ import print_function
import sys, os, datetime, time, shutil, tarfile, tempfile, subprocess, os.path
from optparse import OptionParser
from ._backup import *
info = "'rethinkdb dump' creates an archive of data from a RethinkDB cluster"
usage = "rethinkdb dump [-c HOST:PORT] [-p] ... | |
# Copyright 2013: Mirantis 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 b... | |
import unittest
from django.core.exceptions import FieldError
from django.db import IntegrityError, connection, transaction
from django.db.models import CharField, Count, F, IntegerField, Max
from django.db.models.functions import Abs, Concat, Lower
from django.test import TestCase
from django.test.utils import regist... | |
# 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
#... | |
"""Fourier Series"""
from __future__ import print_function, division
from sympy import pi, oo, Wild
from sympy.core.expr import Expr
from sympy.core.add import Add
from sympy.core.compatibility import is_sequence
from sympy.core.containers import Tuple
from sympy.core.singleton import S
from sympy.core.symbol import ... | |
import os
import sys
import random
import time
import cPickle
import subprocess
import math
import pdb
import inspect
import types
import imp
### define globals
rproc_nqstat_time = None
rproc_nqstat_output = None
MATLAB_RETURN_VALUE = None
THIS_IS_A_RPROC_PROCESS = None
rproc_wait_jobinfo = None
#### define jobinfo c... | |
"""
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | |
""" Steward extension for monitoring servers """
from __future__ import unicode_literals
import imp
import os
import sys
from datetime import timedelta
import inspect
import logging
import yaml
from pyramid.path import DottedNameResolver
from pyramid.settings import aslist
from .check import Check
from .handlers imp... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Stephane Caron <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org... | |
import random
import string
from datetime import timedelta
from django import forms
from django.conf import settings
from django.contrib import messages, auth
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.contrib.auth.views import LoginView
from django.core.mai... | |
from functools import update_wrapper
from weakref import WeakSet
from django.apps import apps
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured
from django.db.models.base import ModelBase
from django.http imp... | |
import collections
class Terminate(Exception):
pass
class SegmentationFault(Exception):
pass
class Operand(collections.namedtuple("Operand", "value ref")):
MASK_REF = 2**12
MASK_VAL = 2**12 - 1
def __new__(cls, data):
obj = super(Operand, cls).__new__(
cls,
... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterpolar"
_path_str = "scatterpolar.textfont"
_valid_props = {"color", "colorsrc", "fa... | |
"""n-body simulator to derive TDV+TTV diagrams of planet-moon configurations.
Credit for part of the source is given to
https://github.com/akuchling/50-examples/blob/master/gravity.rst
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
"""
import numpy
import math
import matplotlib.pylab as plt... | |
#!/usr/bin/env python
import hashlib
import uuid
import hmac
import time
import memcache
from Cookie import SimpleCookie
from saml2 import mcache
from saml2.mcache import ToOld
from oic.utils import time_util
import logging
logger = logging.getLogger(__name__)
def _expiration(timeout, strformat=None):
if time... | |
"""This file implements all-or-nothing package transformations.
An all-or-nothing package transformation is one in which some text is
transformed into message blocks, such that all blocks must be obtained before
the reverse transformation can be applied. Thus, if any blocks are corrupted
or lost, the original message... | |
import operator
from merc import channel
from merc import errors
from merc import feature
from merc import message
from merc import mode
MAX_MODES = 4
class ModeFeature(feature.Feature):
NAME = __name__
install = ModeFeature.install
def show_modes(target, modes):
flags = []
args = []
for k, mode_factor... | |
import numpy as np
from .base import PlotChecker, InvalidPlotError
class BarPlotChecker(PlotChecker):
"""A plot checker for bar plots.
Parameters
----------
axis : ``matplotlib.axes.Axes`` object
A set of matplotlib axes (e.g. obtained through ``plt.gca()``)
"""
def __init__(self, ... | |
# 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... | |
#!/usr/bin/env python
#
# License: BSD
# https://raw.githubusercontent.com/stonier/py_trees/devel/LICENSE
#
##############################################################################
# Imports
##############################################################################
import py_trees
import py_trees.console ... | |
# 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... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
#!/bin/sh -
# Copyright 2011,2012,2013 James McCauley
#
# 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... | |
# -*- coding: utf-8 -*-
"""
@author : Armando Casillas <[email protected]>
@author : Marco Pritoni <[email protected]>
Created on Wed Jul 26 2017
Update Aug 08 2017
"""
from __future__ import division
import pandas as pd
import os
import sys
import requests as req
import json
import numpy as np
import dat... | |
"""
:copyright: (c) 2014 Building Energy Inc
:license: see LICENSE for more details.
"""
import os
import base64
import json
import hmac
import hashlib
from annoying.decorators import ajax_request
from django.conf import settings
from django.contrib.auth.decorators import login_required
from ajaxuploader.views import ... | |
#!/usr/bin/env python3
"""
Parts of this file were taken from the pyzmq project
(https://github.com/zeromq/pyzmq) which have been permitted for use under the
BSD license. Parts are from lxml (https://github.com/lxml/lxml)
"""
import argparse
import multiprocessing
import os
from os.path import join as pjoin
import pl... | |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
import config
import glob
import os
import re
import sys, urllib
import shutil
import tarfile
import zipfile
import subprocess
def cmake_command(build_dir, source_dir, cmake_params):
"""Invoke correct cmake commands to c... | |
import time
import uuid
from datetime import datetime
from unittest import SkipTest
from django.conf import settings
from django.db import connections, DEFAULT_DB_ALIAS
from django.test import TestCase
from corehq.apps.change_feed.data_sources import get_document_store_for_doc_type
from corehq.form_processor.backends... | |
import mock
from stem import Flag
from twisted.internet import defer
from twisted.trial import unittest
from oppy.path import path
from oppy.path import util as path_util
from oppy.path.exceptions import NoUsableGuardsException
class PathTest(unittest.TestCase):
@mock.patch('oppy.path.path.selectExitNode', re... | |
# -*- coding: utf-8 -*-
"""TimeDelayingRidge class."""
# Authors: Eric Larson <[email protected]>
# Ross Maddox <[email protected]>
#
# License: BSD (3-clause)
import numpy as np
from scipy import linalg
from .base import BaseEstimator
from ..cuda import _setup_cuda_fft_multiply_repeated
from .... | |
import random
import math
tolerance_error = 0.05
alpha = 0.3
threshold = 0.0
cluster_count = 0
parameter_assigned = dict()
member = list()
network_dimensions = list()
start_nodes= list()
end_nodes =list()
prev_vector = list()
vector = list()
min_dist_index = list()
v_center = list()
distance = list()
nodes = list()
t... | |
"""Automatically download MLdata datasets."""
# Copyright (c) 2011 Pietro Berkes
# License: Simplified BSD
import os
from os.path import join, exists
import re
import numbers
try:
# Python 2
from urllib2 import HTTPError
from urllib2 import quote
from urllib2 import urlopen
except ImportError:
# P... | |
#!/usr/bin/env python
"""
Developer script to convert yaml periodic table to json format.
Created on Nov 15, 2011
"""
from __future__ import division
import json
from itertools import product
import ruamel.yaml as yaml
import re
from monty.serialization import loadfn
from pymatgen import Element
from pymatgen.core... | |
import base64
import functools
import os
from django.conf import settings
from django.contrib.auth import login, logout
from django.core import signing
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import Http404, HttpResponseRedirect
from django.utils.encoding import for... | |
# Written by Ross Cohen
# see LICENSE.txt for license information
from bencode import bdecode, bencode
from crypt import crypt
from errno import EINTR
import os
try:
import select
except ImportError:
import selectpoll as select
import sha
import socket
import SRP
from cStringIO import StringIO
import struct
A... | |
# Time-stamp: <2008-03-19 15:01:53 Tao Liu>
"""Module to read the motif scan data file which is in binary format.
Copyright (c) 2007 Tao Liu <[email protected]>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distr... | |
# -*- coding: utf-8 -*-
### get it from: http://www.crummy.com/software/BeautifulSoup/
import re
import sys
import os
import pycurl
import time
import datetime
import simplejson as json
ADC_COLOR = {
'CA': '#FF1F1F',
'CERN': '#AE3C51',
'DE': '#000000',
'ES': '#EDBF0... | |
# Copyright 2015 gRPC 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 applicable law or agreed to in writing... | |
from tests.base import BaseTestCase
from mod_auth.models import Role
from mod_regression.models import RegressionTest, Category, InputType, OutputType
from mod_sample.models import Sample
from flask import g
class TestControllers(BaseTestCase):
def test_root(self):
response = self.app.test_client().get('/r... | |
# Copyright (C) 2010 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 or agreed to in writ... | |
from __future__ import absolute_import
import collections
import logging
import os
import re
import warnings
from pip._vendor import pkg_resources, six
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.pkg_resources import RequirementParseError
from pip._internal.exceptions import Installati... | |
"""Support for FFmpeg."""
from __future__ import annotations
import asyncio
import re
from haffmpeg.tools import IMAGE_JPEG, FFVersion, ImageFrame
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
CONTENT_TYPE_MULTIPART,
EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP,
)
... | |
import asyncio
import binascii
import cgi
import collections
import datetime
import enum
import http.cookies
import io
import json
import math
import time
import warnings
from email.utils import parsedate
from types import MappingProxyType
from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy
... | |
"""
Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
... | |
"""
Created on May 16, 2016
@author: Jafar Taghiyar ([email protected])
"""
from __future__ import unicode_literals
#============================
# Django imports
#----------------------------
from django.core.urlresolvers import reverse
from django.db import models
#============================
# App imports
#--... | |
#!/usr/bin/env python
import argparse
import datetime
import logging
import os
import statistics
import sys
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from functools import partial
from multiprocessing.pool import ThreadPool
import math
from eviltransform import... | |
import os
import logging
import sys
import time
import json
import base64
import shutil
import etcd
import random
import subprocess
import boto.route53
class DnsCtl:
REGION = os.environ['EC2_REGION']
DOMAIN = os.environ['DOMAIN']
MAX_MEMBERS = 5 # max number of members allowed in the cluster
RECORD_T... | |
# Node Base #
import numpy as np
from abc import ABCMeta, abstractmethod
import ActionBase
# action wrapper for NodeBase.broadcast
class ActionBroadcast(ActionBase.ActionBase):
def __init__(self, node, env, data):
self.node = node
self.env = env
self.data = data
def execute(self):
... | |
from __future__ import absolute_import
from django.contrib.auth.decorators import login_required
from django.contrib.messages.views import SuccessMessageMixin
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse, reverse_lazy
from django.utils.decorators import method_decorator
from... | |
# Copyright 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 list of conditions and the f... | |
# -*- encoding: cp1251 -*-
from __future__ import absolute_import, print_function
from pony.py23compat import izip, iteritems
import re, threading, os.path, copy, cPickle
from operator import attrgetter
from itertools import count, cycle
import datetime
from pony import auth
from pony.utils import decorator
from po... | |
r"""
FASTQ format (:mod:`skbio.io.format.fastq`)
===========================================
.. currentmodule:: skbio.io.format.fastq
The FASTQ file format (``fastq``) stores biological (e.g., nucleotide)
sequences and their quality scores in a simple plain text format that is both
human-readable and easy to parse. T... | |
__docformat__ = "reStructuredText"
import logging
import platform
import weakref
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Hashable,
List,
Optional,
Set,
Tuple,
Union,
)
from pymunk.shape_filter import ShapeFilter
from pymunk.space_debug_draw_options import Space... | |
# 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
# not use this file except in compliance wi... | |
# processor.py
# version 2013.06.21
def processMutations(first_file, second_file , input_directory, output_file, output_directory, lines_skip):
import methodslist as ml
import xlwt
import os
# Set directory
old_dir = os.getcwd()
os.chdir(output_directory)
print('\nStarting at %r' % input_directory)
# Imp... | |
#
# PgHelp.py -- web application threading help routines.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import tornado.web
import tornado.websocket
import tornado.template
from tornado.ioloop import IOLoop
import random
import json
import os, time
impor... | |
from ascension.util import SettingSet, Singleton, SettingBased
from pykfs.kfslog import CONSOLE_HANDLER, CONSOLE_FORMATTER
import yaml
import os
import math
CONF_FILE_NAME = "ascension_conf.yaml"
game_settings = SettingSet([
{
"name": "target_frame_rate",
"default": 60,
"parse": int,
... | |
import multiprocessing
import warnings
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer.dataset import convert
from chainer import reporter
from chainer.training.updaters import standard_updater
try:
from cupy.cuda import nccl
_available = True
except Exception:
_ava... | |
"""
User Account
"""
import datetime
from flask import redirect, request, url_for, session, jsonify, abort, make_response
from webportfolio import (WebPortfolio, route, flash_error, flash_success,
flash_info, flash_data, get_flashed_data, register_package, init_app,
... | |
# 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... | |
#
# 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... | |
from __future__ import unicode_literals
import base64
from collections import OrderedDict
from datetime import timedelta
import logging
from django.core.exceptions import ImproperlyConfigured, MultipleObjectsReturned, ObjectDoesNotExist
from django.urls import reverse, Resolver404
from django.utils.translation import... | |
"""
Updates made:
- Fixed Rotation
Updates to be made:
repeated code needs to be made into functions:
- startCol and startRow
- dividing check win into check color win
Safe vault for bad inputs
diagonal check for win
make min max heuristic
Add alpha be... | |
import xml.etree.ElementTree as ET
from xml.etree import ElementTree
from os.path import sep
import csv
import os
import os.path
import sys
import shutil
# instance and name must be the first two items
resource_keys = { "db": [ "instance", "name", "initialSize", "maxActive", "maxIdle", "minIdle", "defaultAutoCommit", ... | |
from __future__ import unicode_literals
from .subtitles import SubtitlesInfoExtractor
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
parse_duration,
qualities,
strip_jsonp,
unified_strdate,
url_basename,
)
class NPOBaseIE(SubtitlesInfoExtractor):
def _get_toke... | |
from TASSELpy.utils.helper import make_sig
from TASSELpy.utils.Overloading import javaOverload, javaConstructorOverload, javaStaticOverload
from TASSELpy.java.lang.Object import Object
from TASSELpy.java.lang.String import metaString
from TASSELpy.java.lang.Integer import metaInteger
from TASSELpy.net.maizegenetics.dna... | |
#!/usr/bin/env python
from calendar import timegm
import rfc822
import time
from twitter import json, Hashtag, TwitterError, Url
class Status(object):
"""A class representing the Status structure used by the twitter API.
The Status structure exposes the following properties:
status.contributors
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this f... | |
# -*- coding: utf-8 -*-
# File: nvml.py
import threading
from ctypes import (
CDLL, POINTER, Structure, byref, c_uint,
c_ulonglong, create_string_buffer)
__all__ = ['NVMLContext']
NVML_ERROR_FUNCTION_NOT_FOUND = 13
NvmlErrorCodes = {"0": "NVML_SUCCESS",
"1": "NVML_ERROR_UNINITIALIZED",
... | |
#!/usr/bin/arch -32 /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
#!/usr/bin/env python
#a Imports
import pygame
import sys, os
sys.path.insert(0, os.path.abspath('../python'))
import gjslib.math.bezier as bezier
import gjslib.graphics.font as font
import gjslib.math.mesh as mesh
#a Polygon clas... | |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# 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... | |
from unittest import mock
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import Prefetch, QuerySet
from django.db.models.query import get_prefetcher, prefetch_related_objects
from django.db.models.s... | |
from __future__ import unicode_literals
import argparse
import re
import sys
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.statemachine import ViewList
from six.moves import range
from rbtools import commands
from rbtools.commands import OptionGroup, Option
class CommandClassN... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Functionality to build scripts, as well as signature hash functions.
This file is modified from python... | |
import numpy as np
import pickle
from malpi import optim
class Solver(object):
"""
A Solver encapsulates all the logic necessary for training classification
models. The Solver performs stochastic gradient descent using different
update rules defined in optim.py.
The solver accepts both training and validat... | |
from __future__ import annotations
import base64
import binascii
import ipaddress
import re
from typing import Callable, List, Optional, Sequence, Tuple, TypeVar, cast
from . import exceptions
from .typing import (
ConnectionOption,
ExtensionHeader,
ExtensionName,
ExtensionParameter,
Subprotocol,
... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
import time
import warnings
from datetime import datetime, timedelta
from StringIO import StringIO
from django.conf import settings
from django.core.handlers.wsgi import WSGIRequest, LimitedStream
from django.http import HttpRequest, HttpResponse, parse_cookie, build_request_repr, UnreadablePostError
from django.test.... | |
import importlib.util
import itertools
import os
import re
import shutil
from collections import defaultdict
from typing import Optional, IO, Dict, List
import pytest
import numpy as np
from numpy.typing.mypy_plugin import (
_PRECISION_DICT,
_EXTENDED_PRECISION_LIST,
_C_INTP,
)
try:
from mypy import a... | |
# Canvas module for simple drawing and mouse handling
# Quintin Cutts
# Last modified 20 - 9 - 09
# Last modified 8/8/2015 Ross Meikleham for python 3 compatibility
### --------------------------------------------------------
### IF YOU JUST WANT TO KNOW WHAT FUNCTIONS ARE AVAILABLE
### THEN JUMP STRAIGHT TO THE E... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# metadata
from __future__ import unicode_literals
import frappe, json
from frappe.utils import cstr, cint
from frappe.model import integer_docfield_properties, default_fields, no_value_fields, optional_fields
from fra... | |
import os
import sys
sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path
sys.path = [os.path.abspath(os.path.dirname(os.path.dirname(__file__)))] + sys.path
os.environ['is_test_suite'] = 'True'
from auto_ml import Predictor
import dill
from nose.tools import assert_equal, assert_not_equal, with_setup... | |
# coding=utf-8
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/li... | |
import urllib
import sys
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.core.handlers.base import BaseHandler
from django.core.handlers.wsgi import WSGIRequest
from ... | |
"""
@package mi.instrument.nortek.vector.ooicore.driver
@file mi/instrument/nortek/vector/ooicore/driver.py
@author Rachel Manoni, Ronald Ronquillo
@brief Driver for the ooicore
Release notes:
Driver for vector
"""
__author__ = 'Rachel Manoni, Ronald Ronquillo'
__license__ = 'Apache 2.0'
import re
import base64
impo... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script takes CWB-SGML format input
and outputs EtherCalc/SocialCalc spreadsheet data
Author: Amir Zeldes
"""
import re, tempfile, subprocess, os
from collections import defaultdict
from collections import OrderedDict
from operator import itemgetter
from gitdox_sql i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.