src stringlengths 721 1.04M |
|---|
""" These are the zre_msg messages
HELLO - Greet a peer so it can connect back to us
sequence number 2 Cyclic sequence number
endpoint string
groups strings
status number 1
name string
headers dictionary
WHISPER - Send a mes... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2018 Cordell Bloor
#
# 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... |
"""Test Rotest's TestCase class behavior."""
# pylint: disable=missing-docstring,unused-argument,protected-access
# pylint: disable=no-member,no-self-use,too-many-public-methods,invalid-name
from __future__ import absolute_import
from rotest.core import request, BlockInput
from rotest.management.models.ut_resources im... |
# Copyright 2015 TellApart, 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/env/python
"""
2D numerical model of diffusion, implemented using ModelGrid.
Provides example of a radial grid.
Last updated GT May 2014
"""
from landlab import RadialModelGrid
import pylab
def main():
"""
In this simple tutorial example, the main function does all the work:
it sets the parame... |
from unittest import TestCase
from nose.tools import assert_equals
from rdkit import Chem
import deepchem as dc
from deepchem.data import DiskDataset
from deepchem.feat.one_hot import zinc_charset
from deepchem.models.autoencoder_models.autoencoder import TensorflowMoleculeEncoder, TensorflowMoleculeDecoder
class T... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import re
import time
import uuid
from builtins import object, range
from colle... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(primary... |
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test mulitple rpc user config option rpcauth
#
from test_framework.test_framework import BitcoinTestFrame... |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
try:
# python3
from xmlrpc.client import DateTime
except ImportError:
# python2
from xmlrpclib import DateTime
def image_list(options):
ret = [{'author_id': 248842,
'datacenter_id': 3,
'date_created': DateTime('20130902T15:04:18'),
'date_updated': DateTime('201... |
#/***************************************************************************
# * Copyright (c) Victor Titov (DeepSOIC) *
# * (vv.titov@gmail.com) 2016 *
# * *
# * Th... |
#!/usr/bin/env python3
from USB import *
from USBDevice import *
from USBConfiguration import *
from USBInterface import *
from USBEndpoint import *
class PwnUSBDevice(USBDevice):
name = "USB device"
def handle_buffer_available(self, lll):
return
def __init__(self, maxusb_app, verbose=0):
... |
# -*- coding: utf-8 -*-
# pylint: disable=broad-except
"""try except return finally 执行顺序
无论except是否执行,finally都会执行,且最后执行
无论try except是否有return(有return时,程序暂存返回值),finally都会执行, 且最后执行
except, finally中return,则会覆盖之前暂存的返回值, so,不要在finally中写return
"""
import logging
__authors__ = ['"sue.chain" <sue.chain@gmail.com>']
loggi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
import sys, requests
from rrdtool import *
from rrdtool import update as rrd_update
galileo_path = "/opt/";
if galileo_path not in sys.path:
sys.path.append(galileo_path);
from coderdojo_library import *
if __name__ == '__main__':
GalileoBoard = CoderDojo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import sys
import utils
included_organizers = {
2491303902, # http://www.eventbrite.com/o/itcamp-2491303902
6873285549, # http://www.eventbrite.com/o/sponge-media-lab-6873285549
3001324227, # http://www.eventbrite.com/o/labview-student-ambassador-upb-30... |
# Copyright (C) 2011 Canonical
#
# Authors:
# Matthew McGowan
#
# 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; version 3.
#
# This program is distributed in the hope that it will be useful, bu... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'worker.ui'
#
# Created: Tue Jul 12 16:21:50 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(se... |
# -*- 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... |
from d_toolbox import *
import d_help
# Holds the verb commands to be called by the game.
# Each command must be in the VERB BANK as well as have a function which uses the exact same name.
# The main game can pass NONE to the functions. Depending on the command this may or may not be valid input.
# All must re... |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import functools
import logging
import sys
... |
#!/bin/python
# id3.py
# -------------------------
# Winter 2013; Alex Safatli
# -------------------------
# A program that carries out
# the ID3 algorithm on a
# given data file.
#
# Usage: python id3.py
# Imports
import os, sys
from math import log
# Constants
RULES_FILE = 'RULES'
# ID3 Class(es)
class id3:
... |
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved.
#
# 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. Redistrib... |
import re
import os
from django import forms
from django.db import transaction
from django.utils.translation import ugettext as _
from django.forms.formsets import BaseFormSet
from localflavor.us.us_states import US_STATES
from django_countries import countries
from OpenSSL import crypto
from darkknight.models import... |
# Main menu python file
import pygame
import translate
import database
import options
import packetevent
# Import button lib
import button
def update(game):
pass
def init(game):
pass
def loadgame(game):
game.players.clear()
res = database.execute_query("SELECT * FROM savegames ORDER BY id DESC")
... |
# coding:utf-8
__author__ = "gaunt"
from models import (SysMenuDao)
def get_user_menu(auths):
"""
根据权限获取主菜单
:param auths:
:return:
"""
menus = SysMenuDao.get_all_menu()
# 获取自己权限的菜单
self_menus = []
[self_menus.append(m) for m in menus if not m["authority"] or m["authority"] in aut... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" A simple device interface for build steps.
"""
import logging
import os
import re
import sys
import build_utils
BUILD_ANDROID_DIR = os.path.join(os.p... |
# This script is part of pymaid (http://www.github.com/schlegelp/pymaid).
# Copyright (C) 2017 Philipp Schlegel
#
# 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logging.basicConfig()
#logging.debug("-- log message: ")
from granule_utils import generate_avhrr_platform_passes_over_aoi, get_pass_for_granule,save_passes_as_shp, read_tle_from_file_db, get_tle_spacetrack
import numpy as np
import datetime
from shapely.... |
# -*- coding: utf-8 -*-
import operator
import warnings
from collections import namedtuple
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.query_utils import Q
from django.template import TemplateSyntaxError, NodeList, Variable, Context, Template, engines
... |
# webreak.py: Web vulnerability scanner software
# Copyright (C) 2011 Carlos del Ojo Elias
#
# 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, or (at your option)
# ... |
import re
import time
import requests
import pbl.pollers
from pbl.pollers.baseentry import BaseEntry
from pbl.pollers.recentitemspoller import RecentItemsDownloader
from pbl.pollers.recentitemspoller import RecentItemsPoller
class PastebayEntry(BaseEntry):
def __init__(self, data, metadata):
BaseEntry.... |
import threading
class AbstractComparableInstance(object):
"""Abstract class that must be used together with SingletonByArgsMeta class"""
def check_params_equality(self, *args, **kwargs):
"""Check if instance have the same attributes as provided in args and kwarg. Method must accept the same
... |
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import re
from powerline.lib.unicode import unichr
NON_PRINTABLE = re.compile('[^\t\n\x20-\x7E' + unichr(0x85) + (unichr(0xA0) + '-' + unichr(0xD7FF)) + (unichr(0xE000) + '-' + unichr(0xFFFD... |
#!/usr/bin/env python
"""
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");... |
# coding: utf-8
# This example was based on:
# https://github.com/compjour/search-script-scrape/blob/master/scripts/101.py
from __future__ import print_function
from io import BytesIO
import requests
import rows
# Capture
url = 'http://unitedstates.sunlightfoundation.com/legislators/legislators.csv'
csv = BytesIO(... |
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
# Copyright 2012 Google Inc. All Rights Reserved.
"""Tests for the Fingerprint flow."""
import os
from grr.lib import aff4
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib.aff4_objects import aff4_grr
class TestFingerprintFlow(te... |
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from stix.test import EntityTestCase, assert_warnings
from stix.test import data_marking_test
from stix.test.common import (confidence_test, information_source_test,
s... |
"""ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
class python3(ShutItModule):
def build(self, shutit):
shutit.send('mkdir /tmp/build/python')
shutit.send('cd /tmp/build/python')
shutit.send('wget -qO- https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz | xz -d | tar -... |
#!/usr/bin/env python
"""
aptask Development Client
"""
import json
import socket
import configuration
#=============================================================================
class Client( object ):
"""
Development Client Class
"""
#========================================================... |
#!/usr/bin/env python
"""
Draws a colormapped image plot
- Left-drag pans the plot.
- Mousewheel up and down zooms the plot in and out.
- Pressing "z" brings up the Zoom Box, and you can click-drag a rectangular
region to zoom. If you use a sequence of zoom boxes, pressing alt-left-arrow
and alt-right-arrow m... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright 2016 Timothy Dozat
#
# 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 ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(ver... |
#imports
import pygame, math, json
from pygame.locals import *
from config import *
#setup code
pygame.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
#world object
class World(object):
def __init__(self, screen, bgcolor):
self.screen = screen
self.bgcolor = bgcolor
def render(self):... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ver... |
from django.core.urlresolvers import reverse_lazy
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from django.utils import timezone
from mptt.models import MPTTModel, TreeForeignKey
class ONode(MPTTModel):
... |
"""Handle control over dolphin parsing"""
import urllib
from bs4 import BeautifulSoup
def get_dolphin_html():
url = 'https://dolphin-emu.org/download/'
response = urllib.request.urlopen(url)
data = response.read()
return data.decode('utf-8')
def get_dolphin_link(dolphin_html=None):
if dolphin_... |
def writeBinary(filename):
"""Writes binary data to file"""
f1=open(filename, 'w')
for x in range(8192):
f1.write(chr((x*3)&0xFF))
f1.close()
def writeTestPalette(filename):
"""Write a test palette (20 bytes)
lda #$01
lda #$02
lda #$03
lda #$04
lda #$05
lda #$06
lda #$07
lda #$08
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... |
import numpy as np
from .meefl_meeMl import meefl_meeMl
__author__ = "Nathan I. Budd"
__email__ = "nibudd@gmail.com"
__copyright__ = "Copyright 2017, LASR Lab"
__license__ = "MIT"
__version__ = "0.1"
__status__ = "Production"
__date__ = "27 Mar 2017"
def mee_meeMl0(T, meeMl0, mu=1.0):
"""Convert MEEs with mean l... |
"""proyecto_DAI URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# Copyright 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
# Copyright 2015 Antiun Ingenieria S.L. - Antonio Espinosa
# Copyright 2017 Tecnativa - Pedro M. Baeza
from odoo import api, fields, models
from odoo.a... |
import numpy
import scipy.sparse as spsparse
from formulaic.utils.stateful_transforms import stateful_transform
@stateful_transform
def scale(data, center=True, scale=True, ddof=1, _state=None):
data = numpy.array(data)
if 'ddof' not in _state:
_state['ddof'] = ddof
else:
ddof = _state[... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutClasses(Koan):
class Dog(object):
"Dogs need regular walkies. Never, ever let them drive."
def test_instances_of_classes_can_be_created_adding_parentheses(self):
fido = self.Dog()
self.assertEqual('Dog... |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 12 18:08:52 2017
@author: Shaun Werkhoven
@purpose: To create a image classification system for the Image Intelligence
TakeHome Assignment
Licensed under the Apache License, Version 2.0 (the "License");
Simple image classification with flask-based HTTP API, TensorFlow ... |
import sys
import argparse
ID,FORM,LEMMA,UCPOS,UPOS,UFEAT,UHEAD,UDEPREL,UDEPS,UMISC=range(10)
ID,FORM,LEMMA,PLEMMA,POS,PPOS,FEAT,PFEAT,HEAD,PHEAD,DEPREL,PDEPREL=range(12)
if __name__=="__main__":
parser = argparse.ArgumentParser(description='Convert conllu to conll09 and back. Infers the direction on its own if n... |
#!/usr/bin/env python
'''
013.py: https://projecteuler.net/problem=13
Large Sum
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
...
208496039801340017239306716668235552452528... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
from moto.core.responses import BaseResponse
from .models import logs_backends
import json
# See http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/Welcome.html
class LogsResponse(BaseResponse):
@property
def logs_backend(self):
return logs_backends[self.region]
@property
d... |
import pytest
from desmod.timescale import parse_time, scale_time
@pytest.mark.parametrize('test_input, expected', [
('12 s', (12, 's')),
('12s', (12, 's')),
('+12s', (12, 's')),
('-12s', (-12, 's')),
('12.0 s', (12.0, 's')),
('12. s', (12.0, 's')),
('+12.0 s', (12.0, 's')),
('-12.0 s... |
import re
import xml.etree.ElementTree
from .common import InfoExtractor
class SpiegelIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?spiegel\.de/video/[^/]*-(?P<videoID>[0-9]+)(?:\.html)?(?:#.*)?$'
_TESTS = [{
u'url': u'http://www.spiegel.de/video/vulkan-tungurahua-in-ecuador-ist-wieder-aktiv-v... |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import pytest
from cryptography.exceptions import (
Already... |
from django.conf import settings
from django.db import models
from django.db.models.functions import Lower, Concat
from django.utils.translation import gettext_lazy, pgettext_lazy
from cradmin_legacy.viewhelpers import listfilter
from cradmin_legacy.viewhelpers.listfilter.basefilters.single import abstractselect
from ... |
# Copyright (c) 2010 Joshua Harlan Lifton.
# See LICENSE.txt for details.
"For use with a computer keyboard (preferably NKRO) as a steno machine."
from plover.machine.base import StenotypeBase
from plover.oslayer.keyboardcontrol import KeyboardCapture
class Keyboard(StenotypeBase):
"""Standard stenotype interfa... |
import io
import socket
import struct
from PIL import Image
# Start a socket listening for connections on 0.0.0.0:8000 (0.0.0.0 means
# all interfaces)
server_socket = socket.socket()
server_socket.bind(('0.0.0.0', 8000))
server_socket.listen(0)
# Accept a single connection and make a file-like object out of it
conne... |
# -*- coding: utf-8 -*-
# Copyright (C) 2007 Osmo Salomaa
#
# 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.
#
# This pr... |
'''
Copyright (c) 2017 Coda authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, s... |
import psycopg2
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.backends.ddl_references import IndexColumns
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s"
sql_create_sequence... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'miyanishi'
import caffe
import numpy as np
class CaffeExtractor():
def __init__(self, caffe_root=None, feature_layers=["fc6"], gpu=True):
self.feature_layers = feature_layers
MODEL_FILE = caffe_root + 'examples/imagenet/imagenet_deploy.... |
# -*- coding: utf-8 -*-
u"""
Functions dealing with geodesic projection systems.
WGS84 (EPSG 4326) projection system
“OpenStreetMap uses the WGS84 spatial reference system used by the
Global Positioning System (GPS). It uses geographic coordinates
between -180° and 180° longitude and -90° and 90° latitu... |
import csv
import glob
from django.core.management.base import BaseCommand
from frontend.models import Practice, PCT
class Command(BaseCommand):
args = ''
help = 'Imports practice data either from epraccur.csv, or from HSCIC '
help += 'address files, depending on options. '
def add_arguments(self, pa... |
from openslides.poll.serializers import (
BASE_OPTION_FIELDS,
BASE_POLL_FIELDS,
BASE_VOTE_FIELDS,
BaseOptionSerializer,
BasePollSerializer,
BaseVoteSerializer,
)
from openslides.utils.rest_api import (
BooleanField,
DecimalField,
IdPrimaryKeyRelatedField,
IntegerField,
ModelS... |
from __future__ import print_function
from __future__ import division
import os
import time
import numpy as np
import numpy.ma as ma
from scipy.misc import imsave
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib
# Force matplotlib to not use any Xwindows backend.
# See- https://stackoverflow... |
from binascii import hexlify, unhexlify
from mnemonic import Mnemonic
from bip32utils.BIP32Key import *
import ed25519
#Replace secret words from koinify wallet below
words = "legal winner thank year wave sausage worth useful legal winner thank yellow"
#uncomment print statements below to see interim datapoints
s... |
"""
How plugins work
----------------
From a user's perspective, plugins are enabled and disabled through the command
line interface or through a UI. Users can also configure a plugin's behavior
through the main Kolibri interface.
.. note::
We have not yet written a configuration API, for now just make sure
... |
# DF Everywhere
# Copyright (C) 2014 Travis Painter
# 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... |
"""Code for talking to ensembl rest API"""
import logging
from urllib.parse import urlencode
import requests
LOG = logging.getLogger(__name__)
HEADERS = {"Content-type": "application/json"}
RESTAPI_37 = "http://grch37.rest.ensembl.org"
RESTAPI_38 = "http://rest.ensembl.org"
PING_ENDPOINT = "info/ping"
BIOMART_37 = ... |
from multiprocessing import Process, Queue
from Queue import Empty, Full
from datetime import datetime
from copy import deepcopy
import json
import time
import re
from Snmp import SnmpWalkTask, GraphiteSnmpData
from polymer.Polymer import ControllerQueue, TaskMgr
""" Gardener.py - Prune unwanted interfaces from your ... |
import pickle
import matplotlib.pyplot as plt
import numpy as np
from feature_format import featureFormat, targetFeatureSplit
from sklearn.feature_selection import SelectKBest, SelectPercentile, f_classif
import pprint
import operator
# loading the enron data dictionary
with open("final_project_dataset.pkl", "r") as d... |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# Modified by: echel0n
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import os
import platform
import re
import shutil
import stat
import subprocess
import tarfile
import traceback
from six.moves.urllib.req... |
"""
Copyright 2017-present Airbnb, 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 writing, sof... |
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from test_project.test_app.models import Post
from test_project.test_app.tests.factories import UserFactory, PostFactory, CommentFactory... |
#!/usr/bin/python3
__author__ = 'Imre'
import sys
import os
import re
def main():
if len(sys.argv) == 2:
inputfile = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), sys.argv[1])
if os.path.isfile(inputfile):
output = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0]... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
################################################################################
# copyright 2009 Gabriel Pettier <gabriel.pettier@gmail.com> #
# #
# This file is part of Ultimate Smash Friends. ... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# streamondemand - XBMC Plugin
# Conector para idowatch
# http://www.mimediacenter.info/foro/viewforum.php?f=36
#------------------------------------------------------------
import re
from core import jsunpack
from core import logge... |
# Prepares a complex for AlGDock
try:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('ligand_mol2', default=None,
help='Input mol2 of the ligand with sybyl atom types')
parser.add_argument('receptor_pdb', default=None,
help='Input PDB of the receptor with AMBER atom types')
pa... |
# $Id$
##
## This file is part of pyFormex 0.8.9 (Fri Nov 9 10:49:51 CET 2012)
## pyFormex is a tool for generating, manipulating and transforming 3D
## geometrical models by sequences of mathematical operations.
## Home page: http://pyformex.org
## Project page: http://savannah.nongnu.org/projects/pyformex/
##... |
# -*- coding: utf-8 -*-
import datetime
import time
from flask import url_for
from flaskext.mail.message import Message
from mongoengine import fields, Document
from mongoengine.queryset import QuerySet
def get_week_number(when=None):
if not when:
when = datetime.date.today()
return when.isocalendar()... |
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# 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 ... |
import time
class Time(object):
def __init__(self, t=None, c=None):
if t is not None and c is not None:
self.time = t
self.cpu = c
else:
self.time = time.time()
self.cpu = time.clock()
def __add__(self, t):
return Time(
self.t... |
#! /usr/bin/env python
# -*- coding: utf-8
'''
Name: dating.py(KNN algorithm)
Training and test dataset: dating.txt
Created on Feb 8, 2015
@author: Tao He
'''
__author__ = 'Tao He'
from numpy import array as nmarray
from matplotlib import pyplot as plt
LABEL_MAP = {
'didntLike': 1,
'sma... |
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... |
""" Dynamical TT-approximation """
import numpy as np
import dyn_tt
import tt
def ksl(A, y0, tau, verb=1, scheme='symm', space=8, rmax=2000):
""" Dynamical tensor-train approximation based on projector splitting
This function performs one step of dynamical tensor-train approximation
for the equatio... |
#! /usr/bin/env python
import os
import thread
from live_vis import LiveVis
from bindings import bindings
try:
import settings
except:
print '\nError importing settings.py. Check the error message below for more information.'
print "If you haven't already, you'll want to open the settings_model_selector.py... |
from django.http import JsonResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.core.urlresolvers import reverse
from urllib import unquote
#spotify tools
from spot import pl
from spot import keys
import json
from json import loads as dict #converts json back to dictionary
#ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.