text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
from __future__ import print_function
import getopt
import os
import re
import sys
import json
import time
import hashlib
import binascii
import tarfile
import ssl
import atexit
#xunlei use self-signed certificate; on py2.7.9+
if hasattr(ssl, '_create_unverified_context') and hasattr(ssl, '_creat... |
import ed25519
import logging
import random
import string
from sqrl import baseconv
def _id_generator(size=22, chars=string.ascii_uppercase + string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def get_nut():
return _id_generator()
class SqrlCallback(object)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# tmp documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 8 21:26:50 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2018, Nigel Small
#
# 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
#
# Unle... |
# -*- coding: utf-8 -*-
"""Tools for programmatic generation of a YANG Abstract Syntax Tree."""
from six import StringIO
from pyang import statements as st
from pyang.error import Position
from pyang.translators import yang
from pyangext import __version__ # noqa
from pyangext.definitions import PREFIX_SEPARATOR
fro... |
import pycurl
import StringIO
from celery.decorators import task, periodic_task
from datetime import timedelta, datetime
import time
import urllib
from django.conf import settings
try:
import simplejson as json
except ImportError:
try:
import json
except ImportError:
raise ImportError("Need ... |
# Most code in this file was shamelessly borrowed from MoviePy
# http://zulko.github.io/moviepy/
# The MIT License (MIT)
#
# Copyright (c) 2015 Zulko
# Copyright (c) 2015 CNRS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "So... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Python implementation of the Adaptable Seismic Data Format (ASDF).
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2013-2015
:license:
BSD 3-Clause ("BSD New" or "BSD Simplified")
"""
from __future__ import (absolute_import, division, print_func... |
# -*- coding: utf-8 -*-
"""pybooru.api_danbooru
This module contains all API calls of Danbooru for Pybooru.
Classes:
Danbooru -- Contains all API calls.
"""
# __future__ imports
from __future__ import absolute_import
# pybooru imports
from .exceptions import PybooruAPIError
class DanbooruApi(object):
"""... |
# -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2017 Scifabric LTD.
#
# PYBOSSA 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 Free Software Foundation, either version 3 of the License, or
# (at your op... |
# -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2017 Scifabric LTD.
#
# PYBOSSA 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 Free Software Foundation, either version 3 of the License, or
# (at your op... |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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 Free Software Foundation, either version 3 of the License, or
# (at... |
import numpy as np
from pychemia.crystal import CrystalSymmetry
def plot_evolution_circular(searcher, target_function='energy_pa', tag='spacegroup'):
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(10, 10))
ax.cla()
plt.subplots_adjust(left=0.0, bottom=0.0, right=1.0, top=1.0, wspace=No... |
""" Implementation of linklets
class W_LinkletInstance(W_Object)
class W_Linklet(object)
class W_LinkletBundle(W_Object)
class W_LinkletDirectory(W_Object)
"""
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
from pycket.interpreter import *
from pycket.assign_convert import assign_convert
from pycket.values import... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import math
import operator
from pycket import values
from pycket.error import SchemeException
from pycket.prims.expose import expose, default, unsafe
from rpython.rlib.rbigint import rbigint
from rpython.rlib import jit
from rpython.rtyper.lltypesystem.lloperation... |
__version__ = '1.7.2'
__author__ = 'Nico Di Rocco'
__license__ = 'MIT'
|
#!/bin/env python
# This file contains methods to deal with criu images.
#
# According to http://criu.org/Images, criu images can be described
# with such IOW:
#
# IMAGE_FILE ::= MAGIC { ENTRY }
# ENTRY ::= SIZE PAYLOAD [ EXTRA ]
# PAYLOAD ::= "message encoded in ProtocolBuffer format"
# EXTRA ::= "arbitr... |
#!/usr/bin/env python
# (c) Olivier Verdier <olivier.verdier@gmail.com>, 2007-2009
"""
A wrapper around pdflatex to allow:
- hiding of the temporary files in various ways
- running pdflatex blazingly fast using the -batchmode option
and returning feedback by parsing the log file.
"""
import os
import sys
import shuti... |
# This file is part of pyTSEB for running different TSEB models
# Copyright 2016 Hector Nieto and contributors listed in the README.md file.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundati... |
# /usr/bin/env python
# -*- coding: utf-8 -*-
# ##############################################################################
#
#
# Project: ECOOP, sponsored by The National Science Foundation
# Purpose: this code is part of the Cyberinfrastructure developed for the ECOOP project
# http://tw.rpi.edu/web/project/ECOOP... |
# No shebang line, this module is meant to be imported
#
# Copyright 2015 Oliver Palmer
#
# 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... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.linalg import block_diag
class Network(object):
"""
Class for networks of boreholes with series, parallel, and mixed
connections between the boreholes.
Contains information regarding the physical dimensions and thermal
characteristics of the p... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
#def generate_kpap():
"""
Description:
------------
This script parses the geophysical indices from the yearly files located in
./kpap/ and ./dst/ . The files are obtained by running pyglow.update_indices()
After parsing the files, a variable is created, "geophysical_indices", whose
dimensions are 20 x (number of ... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Lexers for math languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, include, \
combine... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Lexers for math languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import re
from pygments.util import shebang_match... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Lexers for math languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, include, \
combine... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Lexers for math languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import re
from pygments.util import shebang_match... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.text
~~~~~~~~~~~~~~~~~~~~
Lexers for non-source code file types.
:copyright: 2006-2007 by Armin Ronacher, Georg Brandl,
Tim Hatch <tim@timhatch.com>,
Ronny Pfannschmidt,
Dennis Kaarsemaker.
:license: BSD, s... |
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
from . import Filter # prevent circular import in Python < 3.5
class Expwin(Filter):
r"""Design an exponential window filter.
Parameters
----------
G : graph
band_min : float
Minimum relative band. The filter t... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy import sparse
from pygsp import utils
logger = utils.build_logger(__name__)
class GraphFourier(object):
def _check_fourier_properties(self, name, desc):
if getattr(self, '_' + name) is None:
self.logger.warning('The {} G.{} is not avai... |
import datetime
import importlib
import json
import logging
import os
import pytz
import sqlite3
import sys
import time
from pyhindsight import __version__
from pyhindsight.browsers.chrome import Chrome
from pyhindsight.browsers.chrome import CacheEntry
from pyhindsight.browsers.brave import Brave
from pyhindsight.uti... |
from __future__ import unicode_literals
import re
from datetime import datetime
from dateutil.parser import parse as parse_date
from pyinfra.api import FactBase, ShortFactBase
from pyinfra.api.util import try_int
class Home(FactBase):
'''
Returns the home directory of the current user.
'''
command... |
#!/usr/bin/env python
import sys
import os
import json
import codecs
import string
from adsputils import u2asc
from jats import JATSParser
from pyingest.config.config import *
from pyingest.parsers.entity_convert import EntityConverter
from author_names import AuthorNames
class NoSchemaException(Exception):
pass
... |
#!/usr/bin/env python
#
# Copyright 2009 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... |
__all__ = ['cok', 'lapack', 'variogram_models']
|
from pylm.components.messages_pb2 import PalmMessage, BrokerMessage
from uuid import uuid4
import zmq
import sys
zmq_context = zmq.Context.instance()
class Broker(object):
"""
Broker for the internal event-loop. It is a ROUTER socket that blocks
waiting for the components to send something. This is more... |
#!/usr/bin/env python
##################################
#
# Utils for PyMag
#
##################################
import numpy as np
from math import *
try:
from scipy.spatial import cKDTree as KDT
except ImportError:
from scipy.spatial import KDTree as KDT
# ---
# matching unique id
# ---
def IdMatch(id1... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import re
import numpy as np
import warnings
from pymatgen.core.operations import SymmOp
from pymatgen import Element, Molecule, Composition
from monty.io imp... |
"""
Contains classes corresponding to the Maya type hierarchy, including `DependNode`, `Transform`, `Mesh`, and `Camera`.
"""
import sys, os, re
import inspect, itertools, math
import pymel.util as _util
import pymel.internal.pmcmds as cmds #@UnresolvedImport
import pymel.internal.factories as _factories
import pymel.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""DataPlatform module for the management of multimodal mechanical datasets.
The `samples` module provides a base class `SampleData` implementing a generic
data model and data paltform API, allowing to define by inheritance specific
data platform classes for specific mech... |
"""ebsd module to manipulate Electron Back Scattered data sets."""
import h5py
import numpy as np
import os
from pymicro.crystal.microstructure import Orientation
from pymicro.crystal.lattice import Symmetry, CrystallinePhase, Lattice
class OimPhase(CrystallinePhase):
"""A class to handle a phase. This is just a ... |
# Copyright 2009-2014 MongoDB, 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 writi... |
#!/usr/bin/env python
"""The :py:mod:`cards` module can be imported as such::
from pyne.simplesim import cards
The user does not interact with this module. Rather, the user interacts with
the :py:mod:`definition` module. Instances of classes in the :py:mod:`definition` module
contains instances of the classes in... |
# -*- coding: utf-8 -*-
'''
AND, Logical AND with Accumulator Test
This is a test for the logical instruction AND of
the 6502. In the 6502 the logical AND could be
performed against the content of the accumulator or
a content at a specific location.
'''
import unittest
from pynes.compiler import lexical, syntax, seman... |
'''miscellaneous utilities.'''
import binascii
from .provider import *
from .constants import param_query, params
from typing import Iterator
from .paproto import DeckSpawn, CardTransfer
from . import paproto
from .exceptions import InvalidDeckIssueModeCombo
def load_p2th_privkeys_into_local_node(provider: RpcNode,... |
# encoding: utf-8
import os
import sys
PY2 = (sys.version_info < (3,))
author_info = [
("Dmitry Orlov", "me@mosquito.su")
]
version_info = (0, 3, 15)
__version__ = ".".join(map(str, version_info))
__author__ = ", ".join("{0} <{1}>".format(*author) for author in author_info)
ROOT = os.path.abspath(os.path.dirn... |
from pypif.util.case import to_camel_case
from pypif.util.case import keys_to_snake_case
class Pio(object):
"""
Base class for all physical information objects.
"""
def __init__(self, **kwargs):
"""
Constructor. This is used to set an fields on a pio that do not have first level suppo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
拼音库,来源于[在线汉语字典](http://zi.artx.cn/zi/)
单字只有 3029 个多音字,但 segment 一个词库的词有 7万余个词包含多音字。
其中可以从[在线汉语词典](http://zi.artx.cn/ci/)查到的有 4万余个词。
XXX: 34 个未知读音字(部分通过 Google Translage 查询到读音,2 个未查到):
[硳硛猠鞥旕乥怾穒椧莻夞巼喸闏朩哛兺迲囕栍虄縇襨屗曢桛烪聁艈虲蝊闧瓲龥]
"""
... |
import unittest, time, sys, random, string
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_jobs
from h2o_test import verboseprint, dump_json, OutputObj
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClas... |
#!/usr/bin/env python
import unittest
import alpha_beta
import game
import rules
import human_player
from board import *
from ab_state import *
class AlphaBetaBridgeTest(unittest.TestCase):
def setUp(self):
player1 = human_player.HumanPlayer("Blomp")
player2 = human_player.HumanPlayer("Kubba")... |
#!/usr/bin/env python
###
# Copyright (c) 2002, Jeremiah Fincher
# 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,
# ... |
# Copyright (C) 2015 Haruhiko Matsuo <halm.matsuo@gmail.com>
#
# Distributed under the MIT License.
# See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT
"""Decorators"""
from functools import wraps
from itertools import product
import numpy as np
def tag_maker(counter_method):
"""T... |
#!/usr/bin/env python
#
# Copyright 2018 GoPro Inc.
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Colin Duquesnoy
#
# This file is part of pyQode.
#
# pyQode is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the Licen... |
"""Defines Get Config Reply message."""
# System imports
# Third-party imports
from pyof.v0x01.common.header import Type
from pyof.v0x01.controller2switch.common import SwitchConfig
__all__ = ('GetConfigReply',)
class GetConfigReply(SwitchConfig):
"""Get Config Reply message."""
def __init__(self, xid=No... |
import numpy as np
import pyradex
def grid_wrapper(molecule,
temperatures=[],
densities=[],
columns=[],
h2columns=[],
abundances=[],
transition_indices=[],
orthopararatios=[],
observa... |
__author__ = 'saeedamen' # Saeed Amen / saeed@thalesians.com
#
# Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians
#
# 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://... |
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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/LIC... |
import sys
import csv
import json
import requests
import os
import time
import time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),os.pardir)))
from housinginsights.sources.base import BaseApiConn
import housinginsights.tools.dbtools as dbtools
import sqlalchemy
class WmataApiConn(BaseApiConn):... |
"""
Apply smoothing to rate computation
[Longer Description]
Author(s):
Myunghwa Hwang mhwang4@gmail.com
Luc Anselin luc.anselin@asu.edu
Serge Rey srey@asu.edu
"""
import pysal
from pysal.weights import comb, Kernel
from pysal.cg import Point, Ray, LineSegment
from pysal.cg import get_angle_between, get_... |
#
# Copyright 2018 Analytics Zoo 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... |
import math
import random
import time
import itertools
from src.Surface import Surface
from collections import defaultdict
from shapely import geometry
from src.Bucket import Bucket
from src.Vehicle import Vehicle
from src.drivers.DriverTemplate import DriverTemplate
from src.vehicles.VehicleTemplate import VehicleTemp... |
"""
Defines the expectation class which is the basis for performing the assertions.
"""
import re
import hamcrest as hc
from .patched import IsNot
from .matchers import lookup, suggest
# Define the set of coordination operators assigning to them a weight to
# indicate their precedence. Higher values take precedence ... |
#
# Copyright 2018 Analytics Zoo 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... |
"""
SIGA.py is a command-line tool to generate Semantically Interoperable Genome Annotations from
GFF files [1] according to the RDF specification [2].
References:
[1] Generic Feature Format specification, http://www.sequenceontology.org/
[2] Resource Description Framework, https://www.w3.org/TR/rdf11-concepts/
Usage... |
try:
string_type = basestring
except NameError:
string_type = str
from pysm.errors import InvalidStateTransition
class StateMeta(type):
def __eq__(self, other):
return other is WhateverState or self is other
def __ne__(self, other):
return not self == other
def __unicode__(self... |
"""
SIGA.py is a command-line tool to generate Semantically Interoperable Genome Annotations from
GFF files [1] according to the RDF specification [2].
References:
[1] Generic Feature Format specification, http://www.sequenceontology.org/
[2] Resource Description Framework, https://www.w3.org/TR/rdf11-concepts/
Usage... |
from pysnmp.proto import rfc1902, rfc1905, error
from pysnmp.proto.api import v1
from pyasn1.type import univ, namedtype, namedval, constraint
# Shortcuts to SNMP types
Null = univ.Null
null = Null('')
ObjectIdentifier = univ.ObjectIdentifier
Integer = rfc1902.Integer
Integer32 = rfc1902.Integer32
OctetString = rfc19... |
"""Handle different OS platforms"""
import platform as python_platform
import importlib
from subprocess import run
from pysyte import oss
from pysyte.bash import shell
name = python_platform.system().lower()
platform = importlib.import_module(f'pysyte.oss.{name}', oss)
def put_clipboard_data(data):
run(platform... |
"""Fixtures for the GUI environment."""
import os
import fcntl
import socket
import re
try:
import subprocess32 as subprocess
except ImportError: # pragma: no cover
import subprocess
import pytest
from .locks import (
file_lock,
)
def xvfb_supports_listen():
"""Determine whether the '-listen' optio... |
from __future__ import print_function
import os
import time
import subprocess
import sys
from colorama import Fore, Style
from watchdog.events import (
FileSystemEventHandler, FileModifiedEvent, FileCreatedEvent,
FileMovedEvent, FileDeletedEvent)
from watchdog.observers import Observer
from watchdog.observers... |
import sys
from django.core.management import BaseCommand
from rdrf.models import Registry
from rdrf.models import Modjgo
import yaml
import jsonschema
explanation = "This command checks for schema validation errors"
class Command(BaseCommand):
help = 'Checks in clinical db against json schema(s)'
def add_ar... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This code demonstrates how to use RecordLink with two comma separated
values (CSV) files. We have listings of products from two different
online stores. The task is to link products between the datasets.
The output will be a CSV with our linkded results.
"""
import os
imp... |
# -*- test-case-name: vumi.transports.whatsapp.tests.test_whatsapp -*-
from twisted.internet import defer
from twisted.internet.threads import deferToThread
from vumi.transports.base import Transport
from vumi.config import ConfigText
from vumi import log
from yowsup.layers.network import ... |
#!/usr/bin/python
# Python 2 and 3, print compatibility
from __future__ import print_function
# Without this urllib.parse which is python 3 only cannot be accessed in python 2.
from future.standard_library import install_aliases
install_aliases()
import docopt
import psutil
import re
import signal
import subprocess
i... |
from datetime import datetime
from json import JSONEncoder
from flask import Flask
from flask_cdn import CDN
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_principal import Principal
from os import path
from flask_migrate import Migrate, MigrateCommand
from flask_script import ... |
"""
Probabilistic decision making by slow reverberation in cortical circuits.
X-J Wang, Neuron 2002.
http://dx.doi.org/10.1016/S0896-6273(02)01092-9
"""
from collections import OrderedDict
import random as pyrand # Import before Brian floods the namespace
# Once code is working, turn off unit-checking for speed
# i... |
#!/usr/local/bin/python2.7
#!/usr/local/bin/python2.7 -O
#!/usr/bin/env python2.7
__doc__ = info = '''
A small script using file .getmail/getmailrc to alert if there are 3 or more mails on the remote POP3 server.
This script can be used as a cron job in order to receive alerts via mail.
Kai Ellinger (c) 2015 - codin... |
import gzip
import os
from xbrowse.utils import get_progressbar
from xbrowse import vcf_stuff
from xbrowse.utils import get_aaf
from xbrowse.parsers.esp_vcf import get_variants_from_esp_file
from xbrowse.core import genomeloc
class PopulationFrequencyStore():
def __init__(self, db_conn, reference_populations):
... |
#!/bin/python
# Main functions/classes for bri-focal v2.
import numpy as np
# DO NOT PLAY NICE WITH NANS
np.seterr(all='raise')
np.seterr(under='warn')
from copy import deepcopy
import sys
import gzip
import time
import re
from copy import deepcopy
#import pathos.multiprocessing as mp
# yolo
#from thresholds_fn import... |
# encoding: utf-8
import os
import sys
import subprocess
from workflow import Workflow3 as Workflow, MATCH_SUBSTRING
from workflow.background import run_in_background
import cask_actions
import helpers
GITHUB_SLUG = 'fniephaus/alfred-homebrew'
OPEN_HELP = 'open https://github.com/fniephaus/alfred-homebrew && exit'
... |
"""A test file to see if Kayak can be used without modification in order to build a custom computation graph given
a graph corresponding to a molecule.
Dougal Maclaurin
David Duvenaud
Sept 22nd, 2014"""
import sys
import numpy as np
import numpy.random as npr
import time
from rdkit import Chem
from rdkit.Chem impor... |
"""
Flow Synchronous API Python Module.
All Flow API responses are represented with Python dicts.
"""
import sys
import subprocess
import platform as platform_module
import json
import threading
import Queue
import os
import string
import random
import logging
import time
import requests
from . import definitions
L... |
#!/usr/bin/python
from __future__ import print_function
from copy import deepcopy
import os.path
import getpass
import subprocess
import sys
import networkx as nx
import gkno.adminUtils
from gkno.adminUtils import *
import gkno.commandLine
from gkno.commandLine import *
import configurationClass.configurationClas... |
"""
LLUV backend
author: Jacob Potter CSH:(jpotter)
"""
import subprocess
import configparser
import shlex
import math
import sys
import threading
import os
from time import sleep
from lluv_classes import *
def check_config() -> bool:
"""
function to check for .lluvrc in the users home dir
if its not the... |
#!/usr/bin/env python3
# ./screenshot.py - make scrot more touchpad-friendly
# Instructions:
# Put whatever you want to capture on the next wm screen.
# The result will be saved in the current working directory, so you probably should
# run this script with the absolute path, e.g. ~/Dev/drafts-and-stuff/Python/screen... |
from datetime import datetime
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
import time
from .vk_support import get_last_visit_vk
from .engine import *
from .models import *
def process_message(message_id):
message = session.query(Message)\
.filter(Me... |
import numpy as np
from astropy.modeling.models import Ellipse2D
from astropy.stats import circmean
from astropy import units as u
from spectral_cube.lower_dimensional_structures import LowerDimensionalObject
from spectral_cube import SpectralCube
from warnings import warn
from log import overlap_metric
from utils im... |
import os
import sys
from bcbio.rnaseq import (featureCounts, cufflinks, oncofuse, count, dexseq,
express, variation, stringtie, sailfish, spikein, pizzly, ericscript,
kallisto, salmon, singlecellexperiment, arriba)
from bcbio.ngsalign import bowtie2, alignprep
from b... |
import numpy as np
from sklearn import mixture
from sklearn.externals import joblib
import matplotlib.pyplot as plt
#ファイル名
wavName = "../wav/sample_96000_24bit_000.wav"
csvName = "../result_hi.csv"
#取得する振幅値の数(次元数)
N = 20
#CSVファイルから振幅値の2次元配列取得
def getAmpArray(fileName):
#CSVファイルをfloatとして読み込み
data = np.recfrom... |
import sys
from yapf.yapflib.yapf_api import FormatFile
from coalib.bearlib import deprecate_settings
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from coalib.bears.LocalBear import LocalBear
from coalib.bears.requirements.PipRequirement import PipRequirement
from coalib.misc.ContextManagers import ... |
#!/usr/bin/python3
import os
import sys
import requests
import subprocess
import json
import click
from termcolor import colored, COLORS
from urllib.parse import urlencode
import webbrowser
from config import *
TWITCH_CLIENT_ID = 'e0fm2z7ufk73k2jnkm21y0gp1h9q2o'
COLORS.update({
'light_grey': 90,
'light_red': 9... |
"""
An extensible dictionary.
"""
from contextlib import contextmanager
def extend_as_list(original_dict, **kwargs):
new_dict = original_dict
for k, v in kwargs.items():
if k in original_dict:
oldv = new_dict[k]
if not hasattr(oldv, 'extend'):
oldv = [oldv]
... |
#!/usr/bin/env python3
import argparse
import os
from sys import stderr
from getpass import getpass
import src.file as bfile
from Crypto.Cipher import AES
def initialize_parser():
parser = argparse.ArgumentParser()
parser.add_argument("-v", "--version", action='version', version='%(prog)s 1.0')
parser.add... |
"""
BenchExec is a framework for reliable benchmarking.
This file is part of BenchExec.
Copyright (C) 2007-2015 Dirk Beyer
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
... |
import urwid
def do_nothing(data):
return
def do_exit(data):
raise urwid.ExitMainLoop()
func_keys = {
'F1': ('Blah', do_nothing),
'F2': ('Blah', do_nothing),
'F3': ('Blah', do_nothing),
'F4': ('Blah', do_nothing),
'F5': ('Blah', do_nothing),
'F6': ('Blah', do_nothing),
'F7': ('B... |
# BenchExec is a framework for reliable benchmarking.
# This file is part of BenchExec.
#
# Copyright (C) 2007-2015 Dirk Beyer
# 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 Lic... |
import sys
import os
os.environ['PANDA_PRC_DIR'] = os.path.join(os.path.dirname(__file__), 'etc')
from direct.showbase.ShowBase import ShowBase
from direct.gui.OnscreenImage import OnscreenImage
from direct.gui import DirectGui
from panda3d.core import *
class Game(ShowBase):
def __init__(self):
ShowBase.__ini... |
from discord.ext import commands
from discord.ext.commands.core import Command
from src.Minecraft import Minecraft
import json
def get_minecraft_object_for_server_channel(sid, cid):
sid = str(sid)
cid = str(cid)
minecrafts = {}
with open('servers.json') as json_data:
minecrafts = json.load(jso... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.