src stringlengths 721 1.04M |
|---|
import yaml
import json
import logging as log
import tornado.websocket
from QueryLayer import InfoQuery
from RequestHandler import RequestHandler
from NDStore import get_config
websockets = []
class Websocket(tornado.websocket.WebSocketHandler):
INPUT = RequestHandler.INPUT
RUNTIME = RequestHandler.RUNTIME
... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
from abc import ABCMeta, abstractmethod
import tensorflow as tf
import prettytensor as pt
import zutils.tf_math_funcs as tmf
import net_modules.auto_struct.utils as asu
from net_modules import keypoints_2d
from net_modules.distribution_utils import reshape_extended_features
from zutils.py_utils import *
import zutils.p... |
"""Execute Ansible tests."""
from __future__ import absolute_import, print_function
import json
import os
import collections
import datetime
import re
import tempfile
import time
import textwrap
import functools
import pipes
import sys
import hashlib
import lib.pytar
import lib.thread
from lib.core_ci import (
... |
# Copyright (C) 2014, 2015, Hitachi, Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
# Copyright (c) 2017 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# 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 3 of the License, or
# (at your option) any later version.
... |
"""Unit tests for pkgmgr
Just import this package into the python repl. We can eventually
convert this to unit tests.
You can allow run from the command line:
python -c "from test_pkgmgr import *"
"""
DRY_RUN=False
import logging
logging.basicConfig(level=logging.DEBUG)
import tempfile
import shutil
from pkgmgr... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... |
# Copyright 2013 Google 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 by applicable law or ag... |
from wine_env import wine_rc
import argparse
import os
import re
import sys
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument('bottle', help='The name of the Wine bottle, e.g. PvZ', type=is_valid_bottle)
parser.add_argument('--wine', help='The path to the Wine executable to use')... |
#-------------------------------------------------------------------------------
# Name: geometry
# Purpose:
#
# Author: Yavor
#
# Created:
# Copyright: (c) Yavor
# Licence: GLPv3
#-------------------------------------------------------------------------------
import math
class Point:
"""A clas... |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy import log
#from scrapy.core.exceptions import DropItem
from twisted.enterprise import adbapi
import time
import MySQLdb.cursors
class Scr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Migrates files older than specified date from source to destination.
"""
import argparse
import os
import logging
import datetime
import time
import shutil
import random
from threading import Thread
from Queue import Queue
parser = argparse.ArgumentParser(description=... |
# Copyright 2013 IBM Corp.
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... |
def primes_in_block(small_primes, L, R, B):
# Algorithm 3.2.1 in Prime Numbers, A Computational Perspective.
# p. 122
# 0. Choose R>L even,
# L > P := int_sqrt(R),
# B|R-L
primes_in_range = []
# 1. Initialize offsets.
primes_with_offsets = []
for p in small_... |
"""
content_list.py: Content list request handler, and suggestion form handler
Tekhenu
(c) 2014, Outernet Inc
All 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 uni... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Paul Goeser
#
# This 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 3, or (at your option)
# any later version.
#
# This softw... |
import os
import unittest
from tests.config import IdeascalyTestCase
from ideascaly.models import Idea, Vote, Comment, Campaign, Author
"""Unit tests"""
class IdeascalyAPITests(IdeascalyTestCase):
# ---
# Testing variables
# ---
campaign_id = 28416
idea_id_votes = 137010
idea_id_comments = ... |
import json
import swiftclient
from server.models import database, ObjectModel, PatientModel
from server.hmsexceptions import UserNotExistException
from server.config import conf
from server.utils import logger
def upload_obj(patientid, post_data):
"""
Upload an obj in the system. The post data is a dict.
... |
from sgmllib import SGMLParseError
from datetime import datetime
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from ..items import ScrapedUrl
from HTResearch.DataModel.model import PageRankInfo, PageRankVector, UrlCountPair
from HTResearch.Utilities.url_tools import UrlUtility
from HTResearch.Util... |
import numpy as np
import pytest
from spectrum_overload import Spectrum
from mingle.utilities.simulation_utilities import (check_inputs, max_delta,
spec_max_delta)
c = 299792.458
@pytest.mark.parametrize("xaxis, rv, gamma", [
([1, 2, 3, 4, 5], 3, 5),
([1.1,... |
#
# checkversions.py - Find if the installed version of a package is the latest
#
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 2002-08 Chris Lawrence
# Copyright (C) 2008-2014 Sandro Tosi <morph@debian.org>
#
# This program is freely distributable per the following license:
#
## Permission to use, cop... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import os
import re
from flexget import plugin
from flexget.event import event
from flexget.utils.template import render_from_entry, RenderError
from flexge... |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... |
#!/usr/bin/env python
#
# Author: Alta Fang (altafang @caltech and alta @princeton)
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 1997-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project... |
import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).upper()
# Each *simple* type that supports different byte orders has an
# __ctype_be__ attribute that specifies the same type in BIG ENDIAN
# byte order, and a __ctype_... |
#!/usr/bin/env python
from ps4a import *
import time
#
#
# Problem #6: Computer chooses a word
#
#
def compChooseWord(hand, wordList, n):
"""
Given a hand and a wordList, find the word that gives
the maximum value score, and return it.
This word should be calculated by considering all the words
... |
#!/usr/bin/env python3.5
import csv
import re
import sys
result = []
with open(sys.argv[1]) as csvfile:
reader = csv.reader(csvfile)
for raw_row in reader:
tipo, status, descr, detalhe, cliente = raw_row
tipo = tipo.strip().replace("\n", " ")
status = status.strip().replace("\n", " ")... |
# atg: a small timezone utility
# Copyright (C) 2015 Rohan Jain
#
# 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 3 of the License, or
# (at your option) any later version.
#
# Th... |
#!/usr/bin/env python
# Jacqueline Kory Westlund
# July 2016
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Personal Robots Group
#
# 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 ... |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
"""
Created by anthony on 09.12.2017
keyboard_builder
"""
import json
import logging
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from emoji import emojize
from abc import ABC, abstractmethod
from components.message_source import message_source
from config.state_config import Action, CallbackData, L... |
import argparse
import logging as lg
from src.utils.io_pointcloud import PCLHolder
def read_cameras_list(path):
"""
Loads the SFM camera list
:param path: Path to the camera list file
:return: [filepaths]
"""
cameras_list = None
with open(path, "r") as f:
cameras_list = [line.sp... |
#!/usr/bin/python
#
# 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 ag... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import Tix
import tkMessageBox
from utils import settings
from utils import calendar_tixradiobutton as date_picker
from utils.symbols import U_TOOLS, U_TRUCK
def main(_):
"""List products for creating orders.
Enter prices and order amounts and save as a multiple... |
#!/bin/env python3
"""
A John Shots - A tool to get the Security Hash Algorightms (SHA) of all file in a given path.
Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Contributors:
Let's contribute to A John Shots!
Project link:
https://github.com/funilrys/A-John-Shots
License:
::
MI... |
"""
Author: Ali Hajimirza (ali@alihm.net)
Copyright Ali Hajimirza, free for use under MIT license.
"""
import numpy as np
from algorithm.softmax import softmax
from algorithm.epsilon_greedy import epsilon_greedy
import matplotlib.pyplot as plt
def simulator(algorithm, arg, mean_arms, std=1, num_sim=2000, num_steps=10... |
#!/usr/bin/python
from k5test import *
for realm in multipass_realms(create_host=False):
# Check that kinit fails appropriately with the wrong password.
output = realm.run([kinit, realm.user_princ], input='wrong\n',
expected_code=1)
if 'Password incorrect while getting initial creden... |
# These tests are similar to the ones in the scripts directory. They not ran on
# real data so the testing db needs to be filled with info.
import os
from django.test.client import Client
from django.test import TestCase
from mozdns.soa.models import SOA
from mozdns.domain.models import Domain
from mozdns.address_reco... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Sarielsaz Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importprunedfunds and removeprunedfunds RPCs."""
from test_framework.test_framework import S... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 - 2015 -- Lars Heuer <heuer[at]semagia.com>
# All rights reserved.
#
# License: BSD, see LICENSE.txt for more details.
#
"""\
Tests classificationist parsing.
:author: Lars Heuer (heuer[at]semagia.com)
:organization: Semagia - <http://www.semagia.com/>
:license: ... |
#!/usr/bin/env python
#
# Jetduino Example for using the Grove Single Axis Analog Gyro (http://www.seeedstudio.com/wiki/Grove_-_Single_Axis_Analog_Gyro)
#
# The Jetduino connects the Jetson and Grove sensors. You can learn more about the Jetduino here: http://www.NeuroRoboticTech.com/Projects/Jetduino
#
# Have a ques... |
import ConfigParser
import re
import math
config= ConfigParser.ConfigParser()
config.read('config.cfg')
def hash_word(match):
return '#' + match.group()
def hash_line(line,kw_re):
for kr in kw_re:
line = re.sub(kr, hash_word, line)
return line
def prepare_chants(source,num_bursts,keywords):
... |
# encoding: utf-8
import random
import unicodedata
import py
from rpython.rlib.unicodedata import (
unicodedb_3_2_0, unicodedb_5_2_0, unicodedb_6_0_0, unicodedb_6_2_0,
unicodedb_8_0_0)
class TestUnicodeData(object):
def setup_class(cls):
if unicodedata.unidata_version != '5.2.0':
py.... |
""" Implementation of the block ciphers """
import logging
import pol.serialization
import Crypto.Cipher.AES
import Crypto.Util.Counter
l = logging.getLogger(__name__)
class BlockCipherParameterError(ValueError):
pass
class BaseStream(object):
def encrypt(self, s):
raise NotImplementedError
d... |
# -*- coding:utf-8 -*-
# This file is part of agora-results.
# Copyright (C) 2014-2016 Agora Voting SL <agora@agoravoting.com>
# agora-results 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 v... |
import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="linkpile.urls",
INSTALLED_APPS=[
... |
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.common.exceptions import NoSuchElementException
from webium import BasePage as WebiumBasePage, Find
class BasePage(WebiumBasePage):
url_path = None
a... |
# -*- coding: utf-8 -*-
"""Shared functions and classes for testing."""
import io
import os
import shutil
import re
import tempfile
import unittest
from dfdatetime import time_elements
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import... |
#!/usr/bin/env python
#
# Copyright 2007-2016 The Python-Twitter Developers
#
# 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 ... |
#!/usr/bin/env python
from ion.core.bootstrap_process import BootstrapPlugin
from pyon.public import Container
from interface.objects import IngestionQueue
from interface.services.dm.iingestion_management_service import IngestionManagementServiceProcessClient
class BootstrapIngestion(BootstrapPlugin):
"""
Bo... |
import random
import tensorflow as tf
from FCNet import FCNet
LOSS_V = 100
ENTROPY_BETA = 0.05
_EPSILON = 1e-6
L2_P = 1e-5
L2_V = 1e-2
actor_learning_rate = 1e-3
critic_learning_rate = 1e-3
class ACNet(object):
def __init__(self, state_size, action_size):
self.state_size = state_size
self.action_... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... |
"""===========================
Variant annotation pipeline
===========================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
The Variants pipeline attempts to annotate variants in
a :term:`vcf` formatted file. It computes
1. the effects of SNPs on transcripts and genes
This pipeline ... |
# Copyright 2014, candidtim (https://github.com/candidtim)
#
# This file is part of Vagrant AppIndicator for Ubuntu.
#
# Vagrant AppIndicator for Ubuntu 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 v... |
'''
This file is used to combine multiple no-intro xml files into one
sqlite file. This is used for checksum lookups to set up the artwork scraper.
'''
import xml.etree.ElementTree as ET
import sqlite3
import os
import sys
import getopt
UNKNOWN_VALUE = ""
TABLE_VALUE = "NOINTRO"
VERSION_FILE = "console_database_vers... |
"""
Tests for the HubSpot template tags and filters.
"""
import pytest
from django.http import HttpRequest
from django.template import Context
from django.test.utils import override_settings
from utils import TagTestCase
from analytical.templatetags.hubspot import HubSpotNode
from analytical.utils import AnalyticalEx... |
# Virtual memory analysis scripts.
# Developed 2012-2014 by Peter Hornyack, pjh@cs.washington.edu
# Copyright (c) 2012-2014 Peter Hornyack and University of Washington
# This file contains methods that implement a wrapper around the
# binutils "addr2line" utility, which can be used to look up instruction
# pointer val... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Sean Poyser and Richard Dean (write2dixie@gmail.com) - With acknowledgement to some original code by twinther (Tommy Winther)
#
import xbmc
from xml.etree import ElementTree
from xml.parsers.expat import ExpatError
import ConfigParser
import os
import re
import xbm... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2015, IOhannes m zmölnig, forum::für::umläute
# 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
#... |
#! usr/bin/env python
# This script is for testing without having to host the flask app.
import folium
import pandas as pd
import os
from sqlalchemy import create_engine
import geojson
DATABASE_URL = os.environ["DATABASE_URL"]
STATES_GEOJSON_PATH = "static/us-states.json"
engine = create_engine(DATABASE_URL)
with e... |
import gevent
from gevent import queue
from wal_e import exception
from wal_e import retries
class Deleter(object):
def __init__(self):
# Allow enqueuing of several API calls worth of work, which
# right now allow 1000 key deletions per job.
self.PAGINATION_MAX = 1000
self._q = qu... |
import logging
from flask import request, flash, abort, Response
from flask.ext.admin import expose
from flask.ext.admin.babel import gettext, ngettext, lazy_gettext
from flask.ext.admin.model import BaseModelView
from flask.ext.admin._compat import iteritems, string_types
import mongoengine
import gridfs
from mongo... |
"""
SoftLayer.ordering
~~~~~~~~~~~~~~~~~~
Ordering Manager
:license: MIT, see LICENSE for more details.
"""
class OrderingManager(object):
"""Manager to help ordering via the SoftLayer API.
:param SoftLayer.API.BaseClient client: the client instance
"""
def __init__(self, client):
... |
import peewee
from peewee import *
DEBUG = True
db = MySQLDatabase(None)
class COINModel(Model):
class Meta:
database = db
class Order(COINModel):
class Meta:
db_table = 'order'
## CREATE TABLE `order` (
## `address` varchar(40) NOT NULL DEFAULT '',
## `btc_address` varchar(40) DE... |
# -*- coding: utf-8; -*-
import re
import os.path
import inspect
import subprocess
import platform
import jinja2
import shlex
from jinja2.runtime import StrictUndefined
import ino.filters
from ino.commands.base import Command
from ino.environment import Version
from ino.filters import colorize
from ino.utils import... |
# -*- test-case-name: txweb2.test.test_stream -*-
import os
import time
from txweb2 import http, http_headers, responsecode, stream
# Some starts at writing a response filter to handle request ranges.
class UnsatisfiableRangeRequest(Exception):
pass
def canonicalizeRange((start, end), size):
"""Return ca... |
"""
DataFrame
---------
An efficient 2D container for potentially mixed-type time series or other
labeled data series.
Similar to its R counterpart, data.frame, except providing automatic data
alignment and a host of useful data manipulation methods having to do with the
labeling information
"""
from __future__ import... |
# This file is part of the GBI project.
# Copyright (C) 2015 Omniscale GmbH & Co. KG <http://omniscale.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/licens... |
from django.core.urlresolvers import reverse as r
from django.contrib.auth.models import User
from django.test import TestCase
from cmdbox.snippets.models import Snippet
from cmdbox.snippets.forms import CreateSnippetForm
class SnippetsAddTests(TestCase):
def setUp(self):
self.user = User.objects.create_... |
"""test building messages with Session"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import hmac
import os
import sys
import uuid
from datetime import datetime
try:
from unittest import mock
except ImportError:
import mock
import pytest
import zmq
f... |
# Copyright 2016 Capital One Services, 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... |
# Copyright (c) 2016, Intel Corporation.
# 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 r... |
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import pytest #This module contains unit tests.
import unittest.mock #To monkeypatch some mocks in place of dependencies.
import cura.Settings.CuraContainerStack #To get the list of container types.
from cura.Settings.Exce... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
import numpy
import pandas
"""
Script for preparing geography data. Writes output to geography.csv.
Run from commandline, like this:
prepare_geography.py treedef_filename basetree_filename [--sweden filename]
"""
def append_country_geog... |
<<<<<<< HEAD
from __future__ import unicode_literals
import os
import sys
import tempfile
import unittest
import warnings
from django.apps import apps
from django.contrib.sites.models import Site
from django.core import management
from django.core.files.temp import NamedTemporaryFile
from django.core.mana... |
# encoding: utf-8
# Broadcast protocol used to build a distributed cluster of solver processes.
#
# This code uses the twisted event driven networking framework:
# http://twistedmatrix.com/documents/13.0.0/core/howto/servers.html
#
import json
import logging
import threading
import time
import twisted
from twisted.i... |
from typing import List, Optional
from numpy.testing import assert_almost_equal
from thinc.api import registry, with_padded, Dropout, NumpyOps, Model
from thinc.backends import NumpyOps
from thinc.util import data_validation, get_width
from thinc.types import Ragged, Padded, Array2d, Floats2d, FloatsXd, Shape
from thi... |
"""DNS Server Groups Class."""
from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
import logging
class DNSServerGroups(APIClassTemplate):
"""The DNSServerGroups Object in the FMC."""
VALID_JSON_DATA = [
"id",
"name",
"type",
"retries",
"timeout",
... |
# -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import logging
import json
from aiohttp import web
from foglamp.common.plugin_discovery import PluginDiscovery
from foglamp.services.core.api.plugins import common
from foglamp.common import logger
from foglamp.services.core.... |
#! /usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distr... |
"""
Set of tools to work with HiNT database
"""
from bioflow.bio_db_parsers.proteinRelParsers import parse_hint
from bioflow.configs.main_configs import hint_csv_path
from bioflow.neo4j_db.GraphDeclarator import DatabaseGraph
from bioflow.utils.log_behavior import get_logger
log = get_logger(__name__)
def get_unipr... |
# -*- encoding: latin-1 -*-
##############################################################################
#
# Copyright (c) 2010 NaN Projectes de Programari Lliure, S.L. All Rights Reserved.
# http://www.NaN-tic.com
#
# WARNING: This program as such is intended to be used by professional
# programme... |
from fabric.api import *
from tempfile import mkstemp
import os
import utility
try:
import configparser
except:
from six.moves import configparser
__all__ = []
def get_current_redcap_version():
"""
gets the current redcap version from database
"""
with settings(user=env.deploy_user):
... |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
class HP1IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HP1IsolatedLHS.
"""
# Flag this instance as compiled now
self.is_compiled = T... |
###############################################################################
# ICE Explorer: A viewer and reader for ICE cache data
# Copyright (C) 2010 M.A. Belzile
#
# 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
... |
__author__ = 'Joe Linn'
import unittest
import hashlib
import random
import pylastica
from tests.base import Base
class QueryStringTest(unittest.TestCase, Base):
def test_search_multiple_fields(self):
string = hashlib.md5(str(random.random())).hexdigest()
query = pylastica.query.QueryString(strin... |
# 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
# distributed under the... |
import json
from django.shortcuts import get_object_or_404
from catmaid.control.common import get_relation_to_id_map, get_class_to_id_map
from catmaid.models import ClassInstance, ClassInstanceClassInstance, Log
from catmaid.models import Treenode, TreenodeClassInstance, TreenodeConnector
from catmaid.models import U... |
#!/usr/bin/python
#Copyright (C) 2009 Gabes Jean, naparuba@gmail.com
#
#This file is part of Shinken.
#
#Shinken 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 yo... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.conf import settings
import copy
import io
import os
import petname
import random
import six
import warnings
from importlib import import_module
from django.utils import timezone
from django.utils.text import... |
'''
Messages managing views
'''
import email
import json
from datetime import date, timedelta
from email.message import EmailMessage
from email.utils import formatdate
from importlib import import_module
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.... |
"""
This file is part of honstats.
honstats 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 3 of the License, or
(at your option) any later version.
honstats is distributed in the hope that it wil... |
"""
(C) Copyright 2009 Igor V. Custodio
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 3 of the License, or
any later version.
This program is distributed in the hope that ... |
import TsPacketError
class TsPacket(object):
"""
A wrapper class to represent an MPEG2-TS packet.
"""
TS_PKT_LEN_188 = 188
TS_PKT_LEN_204 = 204
def __init__(self, pkt):
if isinstance(pkt, bytes):
if len(pkt) in (TsPacket.TS_PKT_LEN_188, TsPacket.TS_PKT_LEN_204):
self._content = pkt
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Top Block
# Generated: Thu Mar 2 00:11:20 2017
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.st... |
import time
import struct
import random
from hashlib import sha256
from binascii import hexlify, unhexlify
JOB_TYPES = ['FOO', 'BAR', 'FOOBAR']
def sha256d(x):
return sha256(sha256(x).digest()).digest()
def swap_endian_words(hex_words):
'''Swaps the endianness of a hexidecimal string of words and converts t... |
"""
Libvirtd Logs
=============
This module contains the following parsers:
LibVirtdLog - file ``/var/log/libvirt/libvirtd.log``
----------------------------------------------------
LibVirtdQemuLog - file ``/var/log/libvirt/qemu/*.log``
------------------------------------------------------
"""
from insights.specs im... |
from enum import Enum
import ssl
import socket
import traceback
class Client:
# Client
#
# This is the backbone to each client, providing an interface for
# communications. Connection info is kept here.
def __init__(self, engine, profile):
self.engine = engine
self.profile = profi... |
#! /usr/bin/python
# encoding: -*- utf-8 -*-
# dialogs.py
# This file is part of miniPOS.
# miniPOS 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 3 of the License, or
# (at ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.