text stringlengths 12 6.59M |
|---|
import lldb
INTEL_ARGS_REGISTERS = [
"rdx", "rcx", "r8", "r9",
]
def class_from_reciever(reciever):
return reciever.split()[0].strip("<:")
def selector_from_register(register):
return register.split()[-1].strip('"')
def output_for_command(debugger, command):
interpreter = debugger.GetCommandInter... |
from collections import defaultdict
import os
import subprocess
import yaml
import multiprocessing
import gzip
import jobit
import pickle
import logging
from IMProv.IMProvDoc import IMProvDoc
from ProdCommon.FwkJobRep.ReportParser import readJobReport
from ProdCommon.FwkJobRep.FwkJobReport import FwkJobReport
from lob... |
import socket, json, re, os
from contextlib import suppress
from selectors import DefaultSelector, EVENT_WRITE, EVENT_READ
from functools import wraps
from collections import namedtuple, deque
from itertools import count
from coroutines import *
URL = namedtuple('URL', ['host', 'port', 'resource'])
# fetcher clas... |
# The MIT License (MIT)
#
# Copyright (c) 2016 Doss Gunter
#
# 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, modif... |
from datetime import datetime
from datetime import timedelta
from time import sleep
import argparse
import json
import requests
import sys
import urlparse
import yaml
DEFAULT_CONF_FILE = '/etc/loadmonitor/config.yml'
META_DATA_URL = 'http://169.254.169.254/openstack/latest/meta_data.json'
class Config():
def __... |
from watchdog.events import PatternMatchingEventHandler
import os.path as path
import set_queue as queue
class SyncHandler(PatternMatchingEventHandler):
def __init__(self, client, watchDirectory, destDirectory):
super(SyncHandler, self).__init__()
self.client = client
self.watchDirectory ... |
from .utils import utils
import traceback
import datetime
import asyncio
import discord
class Welcome(): #Allow to welcome new members who join guild. If it enable, will send them a message.
def __init__(self,bot):
self.bot = bot
self.redis = bot.db.redis
async def error(self,owner,e):
... |
"""
HTTP Client Mixin
=================
A Tornado Request Handler Mixin that provides functions for making HTTP
requests.
"""
import asyncio
import logging
import os
import socket
import time
from urllib import parse
from ietfparse import algorithms, errors, headers
from sprockets.mixins.mediatype import transcoders
... |
"""
Graph node classification using GraphSAGE.
Requires a EPGM graph as input.
This currently is only tested on the CORA dataset.
Example usage:
python epgm-example.py -g ../../tests/resources/data/cora/cora.epgm -l 20 20 -s 20 10 -e 20 -d 0.5 -r 0.02
usage: epgm-example.py [-h] [-c [CHECKPOINT]] [-n BATCH_SIZE] [-e ... |
# -*- coding:utf-8 -*-
#
# Copyright © 2013 Joseph Martinot-Lagarde
# based on p_profiler.py by Santiago Jaramillo
#
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""Unit testing Plugin"""
from qtpy.QtCore import Signal
# Local imports
from spyderlib.config.base import get_t... |
# encoding: utf8
#
# spyne - Copyright (C) Spyne contributors.
#
# This library 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 2.1 of the License, or (at your option) any later version... |
import discord
from discord.ext import commands
from .utils import checks
from discord.ext.commands.cooldowns import BucketType
from cogs.utils.dataIO import dataIO, fileIO
from __main__ import send_cmd_help
import json
import os
import asyncio
import aiohttp
import datetime
import random
import time
import urllib
im... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
# Either use real Python MongoDB module...
#
# import pymongo
# from pymongo import MongoClient as mongoclient
#
# Or from a mocking package...
from mongomock.connection import Connection
from mongomock.collection import Collection
# Mongomock does not have aggregate impl.
# Patch a quick impl.
def patch_aggregate(s... |
# 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 use ... |
import os.path, string
from contextlib import contextmanager
import wx, wx.stc
from editor_fonts import font_face, font_size
from find_replace_dialog import FindReplaceDetails, FindReplaceDialog
from go_to_line_dialog import GoToLineDialog
from menu_defs import edit_menu
from syntax import syntax_from_filename, plain
... |
#
# Copyright (C) 2008 The Android Open Source Project
#
# 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
import json
import redis
from django.shortcuts import render
from django.core.paginator import Paginator
from rest_framework.views import APIView
from judge.judger_controller.tasks import judge
from judge.judger_controller.settings import redis_config
from account.decorators import login_required
from... |
example_template = Template({
'A': RsrcDef({}, []),
'B': RsrcDef({}, []),
'C': RsrcDef({'a': '4alpha'}, ['A', 'B']),
'D': RsrcDef({'c': GetRes('C')}, []),
'E': RsrcDef({'ca': GetAtt('C', 'a')}, []),
})
engine.create_stack('foo', example_template)
|
#!/usr/bin/env python2.7
"""schedule_aws.py:
Query the database and schedule AWS.
TODO:
Add summary of policy here.
"""
from __future__ import print_function
__author__ = "Dilawar Singh"
__copyright__ = "Copyright 2016, Dilawar singh <dilawars@ncbs.res.in>"
__credits__ = ["NCBS Banga... |
"""
Pipeline: chain transforms and estimators to build a composite estimator.
"""
# Author: Edouard Duchesnay
# Gael Varoquaux
# Virgile Fritsch
# Licence: BSD
from .base import BaseEstimator
class Pipeline(BaseEstimator):
""" Pipeline of transforms with a final estimator
Sequentialy appl... |
# Author: Travis Oliphant
# 2003
#
# Feb. 2010: Updated by Warren Weckesser:
# Rewrote much of chirp()
# Added sweep_poly()
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
exp, cos, sin, polyval, po... |
"""
Distance computations (:mod:`scipy.spatial.distance`)
=====================================================
.. sectionauthor:: Damian Eads
Function reference
------------------
Distance matrix computation from a collection of raw observation vectors
stored in a rectangular array.
.. autosummary::
:toctree: g... |
from collections import namedtuple
from dataclasses import make_dataclass
from math import comb
import numpy as np
import warnings
from itertools import combinations
import scipy.stats
from scipy.optimize import shgo
from . import distributions
from ._common import ConfidenceInterval
from ._continuous_distns import chi... |
import six
import json
from abc import abstractproperty, abstractmethod
from requests.structures import CaseInsensitiveDict
class BaseProcessor(object):
NAME = None
def process_raw(self, raw_doc, **kwargs):
pass # pragma: no cover
def process_normalized(self, raw_doc, normalized, **kwargs):
... |
# -*- coding:utf-8 -*-
import json
from collections import defaultdict
from datetime import datetime
from collections import OrderedDict
def sorting_dict_by_key(src_dict, reverse=False):
return _sorting_dict(src_dict=src_dict, sorting_index=0, reverse=reverse)
def sorting_dict_by_value(src_dict, reverse=False):... |
"""
File : database_controller.py
Date : April, 2017
Author : eugene liyai
Desc : Acts as a service file for database population and db engine to be used
"""
# ============================================================================
# necessary imports
# ==========================================... |
import os
import sys
import time
import inspect
import datetime
import numpy as np
import code, traceback, signal
from contextlib import contextmanager
from peri import const, initializers
def callif(f, *args, **kwargs):
if hasattr(f, '__call__'):
return np.array(f(*args, **kwargs))
return np.array(f)... |
"""
byceps.services.seating.seat_group_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import Optional, Sequence
from ...database import db
from ...typing import PartyID
from ..ticketing.models.ticket impo... |
# coding=utf-8
# Copyright 2020 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 ... |
# Handles data input and output for Models
# For example:
# - loading data like img_features, osm_features, scores
# - provide final Model saving and loading
from DatasetHandler.FileHelperFunc import use_path_which_exists, make_folder_ifItDoesntExist
import os
import ModelHandler.CreateModel.KerasApplicationsModels as... |
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
from pandas.tools.plotting import parallel_coordinates
# Look pretty...
matplotlib.style.use('ggplot')
#
# TODO: Load up the Seeds Dataset into a Dataframe
# It's located at 'Datasets/wheat.data'
#
# .. your code here ..
wheat_dataset=pd.read_cs... |
# -*- coding: utf-8 -*-
from .object import Object
from .lobby import Lobby
class Community(Object):
"""Represents a Spectrum Community object
Supported Operations:
+-----------+--------------------------------------------+
| Operation | Description |
+====... |
import urllib.parse
import urllib.request
import json
def convert(fr, to, ur):
""" this function returns the converted text """
url = 'http://subjectrefresh.info/morpheus/api/convert'
values = {'from' : fr,
'to' : to,
'url' : ur }
data = urllib.parse.urlencode(values)
... |
#!/usr/bin/env python
import argparse
from datetime import datetime
import os
from os.path import abspath, expanduser
from select import select
import socket
import sys
import time
import Growl
import mpd
def msg(text):
dt = datetime.now()
timestamp = dt.strftime("[%Y-%m-%d %H:%M:%S] ")
print timestamp + ... |
import unittest
import os
import shutil
import stat
from mpm import MPMMetadata, mpm_init, mpm_purge, mpm_install, mpm_uninstall, mpm_update, mpm_load, mpm_freeze, mpm_purge, mpm_convert, mpm_show
from mpm_helpers import clone_and_checkout_helper, clone_helper, checkout_helper, yaml_to_path_helper, path_to_yaml_helper... |
# Copyright 2012 Daniel B. Allan
# dallan@pha.jhu.edu, daniel.b.allan@gmail.com
# http://pha.jhu.edu/~dallan
# http://www.danallan.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ve... |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This libra... |
__version__ = '1.5.0'
|
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
#!/usr/bin/env python
"""
SlipStream Client
=====
Copyright (C) 2013 SixSq Sarl (sixsq.com)
=====
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-... |
#!/usr/bin/env python
'''
Created on 2012-02-10
@author: coteharn
'''
import argparse
import logging
import os
import tractconverter
from tractconverter import FORMATS
from tractconverter import EXT_ANAT
# Script description
DESCRIPTION = 'Convert track files for {0}'.format(",".join(FORMATS.keys()))
#####
# Scrip... |
from matplotlib.colors import rgb2hex
import matplotlib.cm as cm
import numpy as np
# Colours drawn from material designs colour pallet at https://material.io/guidelines/style/color.html
class Colors(object):
def __init__(self):
self.color_map = {
"blue": "#1976D2",
"lblue": "#4FC3... |
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases()
import copy
import chainer
from chainer import cuda
import chainer.... |
# -*- coding: utf-8 -*-
import os
from PyQt5.QtCore import QDir, QFileInfo, QRect, QSettings, QSize, Qt
from PyQt5.QtGui import QKeySequence, QPainter
from PyQt5.QtSvg import QSvgGenerator
from PyQt5.QtWidgets import (QActionGroup, QApplication, QDialog, QFileDialog,
QGraphicsItem, QMessag... |
from .transform import *
__version__ = '3.14'
def test(*args, **kwargs):
"""
Run py.test unit tests.
"""
import testr
return testr.test(*args, **kwargs)
|
#!/usr/bin/env python
import os
import glob
import subprocess as sp
import argparse
import sys
from collections import defaultdict
from itertools import chain
import nose
from conda_build.metadata import MetaData
from toposort import toposort_flatten
PYTHON_VERSIONS = ["27", "34", "35"]
CONDA_NPY = "110"
CONDA_PERL ... |
#!/usr/bin/env python
import os
import glob
import subprocess as sp
import argparse
import sys
from collections import defaultdict
from itertools import chain
import networkx as nx
import nose
from conda_build.metadata import MetaData
PYTHON_VERSIONS = ["27", "34", "35"]
os.environ.update({
"CONDA_PERL": "5.22... |
#!/usr/bin/env python
"""
Requires:
Python
------
paramiko
Utilities
---------
nslookup
ipmitool
perl
git
sed
"""
from __future__ import unicode_literals, print_function, division
import argparse
import sys
import subprocess
import time
try:
import paramiko
except Impor... |
#BEGIN_HEADER
import os
import sys
import requests
import uuid
import numpy as np
from pprint import pformat
from Bio import SeqIO
from ReadsUtils.ReadsUtilsClient import ReadsUtils # @IgnorePep8
from ReadsUtils.baseclient import ServerError
from ReadsAPI.ReadsAPIClient import ReadsAPI # @IgnorePep8
from AssemblyUt... |
#
#
# Copyright (C) 2008, 2009, 2010, 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This... |
#
#
# Copyright (C) 2010, 2013 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distri... |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import re
import urlparse
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from gunicorn.http.body import ChunkedReader, LengthReader, EOFReader... |
from django.contrib.auth import views
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth import get_user_model
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render
import json
from task.models import Execution
from core.models imp... |
# This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Tests the h5py.File object.
"""
import h5py... |
import threading
import multiprocessing
import subprocess
import inspect
from ha_engine import ha_parser
from ha_engine import ha_infra
import os
import shutil
import utils.utils as utils
LOG = ha_infra.ha_logging(__name__)
class HAExecutor(object):
infra_path = "/tmp/ha_infra/"
xterm_position = {'monitors':... |
#!/usr/bin/env python
################################################################################
# Copyright (c) 2011-2016, National Research Foundation (Square Kilometre Array)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may... |
#!/usr/local/bin/python3.5
import csv
import glob
import os
import re
import urllib
import calendar
import sys
import json
import codecs
import resource
import argparse
import gzip
import shutil
from html import unescape
from digits import *
from cdecimal import Decimal
from astroquery.vizier import Vizier
from astroq... |
#!/usr/local/bin/python3.5
import csv
import glob
import os
import re
import urllib
import requests
import calendar
import sys
import json
import codecs
import resource
import argparse
import gzip
import io
import shutil
import warnings
from html import unescape
from digits import *
from cdecimal import Decimal
from a... |
"""Microsoft SQL Server database backend for Django."""
from __future__ import absolute_import, unicode_literals
import warnings
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures, BaseDatabaseValidation, BaseDatabase... |
#!/usr/bin/python
import os.path
class ClusterNode:
def __init__(self, spec_string):
(self.user, rest) = spec_string.split('@',1)
rest = rest.split(':', 1)
self.node = rest[0]
if (len(rest) > 1):
self.reuse_count = int(rest[1])
else:
self.reuse_count... |
import os
import sys
import hashlib
import base64
import collections
from functools import reduce
from operator import attrgetter
try:
from . import base
from ..reactor import reactor
from ..lib import DMP
from .. import msg, ignore, shared as G, utils
from ..exc_fmt import str_e
from ... impor... |
"""
sqery.py: Helpers for working with databases
Copyright 2014-2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
from __future__ import print_function
import os
im... |
import os
import sys
import hashlib
import base64
from operator import attrgetter
try:
from . import base
from ..reactor import reactor
from ..lib import DMP
from .. import msg, ignore, shared as G, utils
from ... import editor
from ..protocols import floo_proto
except (ImportError, ValueError)... |
#!/usr/bin/env python
import re
from itertools import product
from cached_property import cached_property
from pyclarity_lims.entities import Sample, Container
from EPPs.common import StepEPP, get_workflow_stage, InvalidStepError, RestCommunicationEPP
class CreateSamples(StepEPP, RestCommunicationEPP):
"""uses... |
#!/usr/bin/env python3
import os, sys, argparse, logging, shutil, asyncio, time, signal
import appdirs
import hangups
from threading import Thread
from utils import simple_parse_to_segments, class_from_name
from hangups.ui.utils import get_conv_name
import config
import handlers
from commands import command
from si... |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
# notify.py for https://github.com/Naereen/uLogMe/
# MIT Licensed, https://lbesson.mit-license.org/
#
"""
Defines one useful function notify() to (try to) send a desktop notification.
"""
from __future__ import print_function # Python 2 compatibility
from __future__ impo... |
"""
Generate the dailyb spam, run from RUN_12Z.sh
"""
import subprocess
import smtplib
import os
import datetime
import time
import psycopg2.extras
import json
import urllib2
import pytz
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import wwa
def get_github_commits():
""" ... |
#!/usr/bin/env python3
import os, sys, argparse, logging, shutil, asyncio, time, signal
import appdirs
import hangups
from threading import Thread
from utils import simple_parse_to_segments, class_from_name
from hangups.ui.utils import get_conv_name
import config
import handlers
from sinks.listener import start_lis... |
#! /usr/bin/env python
#===========================================================================
# Copyright (c) 2011, Martin Raue
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redi... |
# Copyright (c) 2013-2020, Freja Nordsiek
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions ... |
import numpy as np
class ModelParameters(object):
'''
In this class the model parameters are specified. It contains a lot of information which is (not always) necessary to run Chempy.
The individual definitions are given as comments.
'''
# Which zero point of abundances shall be used. Asplund 2005 is corrected... |
#!/usr/bin/env python3
import zmq
import time
import pickle
import logging
logger = logging.getLogger(__name__)
class CommandClient(object):
""" CommandClient
"""
def __init__(self, ip_address, port_range):
"""
Parameters
----------
ip_address: str
IP address ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
from contentbase.upgrader import upgrade_step
@upgrade_step('provisionalClassification', '1', '2')
def provisionalClassification_1_2(value, system):
# https://github.com/ClinGen/clincoded/issues/1196
if 'replicatedOverTime' not in value:
value['replicatedOverTime'] = False
if 'contradictingEviden... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = 5.0
"""
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDER... |
import os
import sys
fullname = sys.argv[1]
path, name = os.path.split(fullname)
if os.name == "posix":
node = "node"
elif os.path.exists("c:\\program files\\nodejs\\node.exe"):
node = "\"c:\\program files\\nodejs\\node\""
else:
node = "node"
if os.system("{} -q -t js {}".format(os.path.join("bin", "neon... |
# Copyright (c) 2012, Calxeda 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 th... |
import calendar
import codecs
import importlib
import inspect
import os
import re
import sys
from datetime import datetime
import git
from pywikibot import Site
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + os.sep + os.pardir + os.sep)
from scripts.service.author_list import AuthorList
from scripts.se... |
"""Functions for plotting data objects within YODA files."""
import matplotlib.pyplot as plt
import yoda
def data_object_names(file):
data_objects = yoda.readYODA(file)
return data_objects.keys()
def plot(file, data_object_name, errors_enabled=True, visible=True, **kwargs):
data_object = load_data_object... |
"""Methods to check and update the database files for sqlite."""
import json
import os.path
import re
from . import cm_table_info, mc
class SqliteHandling:
"""
Database csv table hash info handler.
Attributes
----------
cm_csv_path : str or None
Path containing the csv data files. If No... |
# encoding: utf8
# This module handles evaluation of external atoms via plugins for the Clingo backend.
# HEXLite Python-based solver for a fragment of HEX
# Copyright (C) 2017-2019 Peter Schueller <schueller.p@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... |
import sys
from xbrowse.parsers.vcf_stuff import iterate_vcf
from xbrowse.utils import get_aaf
if __name__ == '__main__':
vcf_file = open(sys.argv[1])
for variant in iterate_vcf(vcf_file, genotypes=True):
print '\t'.join([
str(variant.xpos),
variant.ref,
variant.al... |
# encoding: utf8
# This module handles evaluation of external atoms via plugins for the Clingo backend.
# HEXLite Python-based solver for a fragment of HEX
# Copyright (C) 2017-2019 Peter Schueller <schueller.p@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... |
from django import template
from django.contrib.contenttypes.models import ContentType
from molo.commenting.models import MoloComment
# NOTE: heavily inspired by
# https://github.com/santiagobasulto/django-comments-utils
register = template.Library()
def get_molo_comments(parser, token):
"""
Get a l... |
import enum, logging
import mac_cfg
class HeyMacDscplnEnum(enum.IntEnum):
NONE = 0
BCN = 1
PPS = 2
class HeyMacDiscipline:
"""A class to track HeyMac timing discipline
via GPS Pulse-per-Second (PPS) and RF Beacon arrivals.
In this context, "timing discipline" is the principle that every no... |
#!/usr/bin/env python
#
# Copyright (c) 2015, 2016, 2017, Intel Corporation
#
# 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... |
# coding: utf-8
# from __future__ import division
import pandas as pd
import os
from os.path import join, abspath, normpath, dirname, split
import numpy as np
from util.utils import getParentDir, rename_cols
import json
def add_datetime(df, year='year', month='month'):
if type(df.index) is not pd.MultiIndex:
... |
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
from wagtail.core.models import Page
from wagtail.search.models import Query
def search(request):
search_query = request.GET.get('q', None)
page = request.GET.get('page', 1)
# Search
if searc... |
from pax import plugin, units
class AdHocClassification1T(plugin.TransformPlugin):
def transform_event(self, event):
for peak in event.peaks:
# Don't work on noise and lone_hit
if peak.type in ('noise', 'lone_hit'):
continue
width = peak.range_area_de... |
#!/usr/bin/env python2
# -*- coding: <utf-8> -*-
"""Hovering script"""
from rospy import init_node, Subscriber, spin, Publisher
from geometry_msgs.msg import Twist, PoseStamped
from tf.transformations import euler_from_quaternion
init_node('go_to_location')
TWIST_PUB = Publisher('/cmd_vel', Twist, queue_size=1)
MAR... |
#!/usr/bin/env python
import sys
import select
import termios
import tty
import time
import roslib
roslib.load_manifest('great-ardrones')
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import Empty
from geometry_msgs.msg import PoseStamped
def getKey():
tty.setraw(sys.stdin.fileno())
se... |
# coding: utf-8
""" Gaia Challenge 2 -- Pal 5 Challenge """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import logging
import os
import sys
# Third-party
from astropy import log as logger
import matplotlib.pyplot as plt
import numpy as np
import ... |
"""empty message
Revision ID: 33b3645dc7f5
Revises:
Create Date: 2014-12-17 11:37:24.122882
"""
# revision identifiers, used by Alembic.
revision = '33b3645dc7f5'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generat... |
#!/usr/bin/env python2
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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, ... |
#!/usr/bin/env python
"""Look at reads mapping to decoy STR chromosomes and use their pairs to
determine which STR locus they originated from.
Generates counts of reads mapping to the decoy originating each STR locus.
"""
import argparse
import pysam
#from insert_size import parse_bed, span_intervals
import pybedtools... |
from datetime import datetime
import iso8601
from flask import Blueprint, jsonify, request, current_app
from app.config import QueueNames
from app.dao.dao_utils import dao_save_object
from app.dao.templates_dao import dao_get_template_by_id_and_service_id
from app.dao.users_dao import get_user_by_id
from app.dao.broad... |
import requests
import json
import pprint
import time
import argparse
host = "http://stg-els601.phonepe.nm2:9200/"
r = requests.get(host + "foxtrot-*-table*/_settings/index.creation_date")
data = r.json()
# pprint.pprint(data)
oneDaySeconds = 86400
oneMonthSeconds = 2592000
currentTime = int(time.time())
parser = a... |
# -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2018 Kresimir Tusek <kresimir.tusek@gmail.com> *
# * Copyright (c) 2019-2021 Schildkroet *
# * ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.