src stringlengths 721 1.04M |
|---|
########################################################################################
## This file is a part of YAP package of scripts. https://github.com/shpakoo/YAP
## Distributed under the MIT license: http://www.opensource.org/licenses/mit-license.php
## Copyright (c) 2011-2013 Sebastian Szpakowski
#############... |
"""
Created on Oct 27, 2016
@author: Jafar Taghiyar (jtaghiyar@bccrc.ca)
"""
from __future__ import absolute_import
import os
#============================
# Celery imports
#----------------------------
from celery import Celery
#============================
# Django imports
#----------------------------
# set the... |
class TaskWaypoint:
"""
Consists of a target Pose defining a location and orientation, and a Task which should be run when the robot reaches
the target position. The task can be None, in which case the robot won't attempt to do anything at the target point.
"""
def __init__(self, pose, task=None, s... |
#!/usr/bin/env python
#
# Copyright 2014 M. David Bennett
#
# 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 a... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... |
# Sublime Suricate, Copyright (C) 2013 N. Subiron
#
# This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you
# are welcome to 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 (... |
info = {
"name": "it",
"date_order": "DMY",
"january": [
"gen",
"gennaio"
],
"february": [
"feb",
"febbraio"
],
"march": [
"mar",
"marzo"
],
"april": [
"apr",
"aprile"
],
"may": [
"mag",
"maggio"
... |
"""
New analytical routines for the interactome
"""
import pickle
from collections import namedtuple
from csv import reader
from csv import writer as csv_writer
from multiprocessing import Pool
from collections import defaultdict
import traceback
from pprint import pprint
import os
import psutil
from typing import Any,... |
import logging
import utils.messages.message_formats as msg
import uome
from utils.crypto import rsa
from utils.messages.connection import connect, ConflictError, ForbiddenError, \
UnauthorizedError, NotFoundError
class ProtocolError(Exception):
""" Raised when an error anticipated in the protocol """
d... |
from autostew_back.event_handlers.base_event_handler import BaseEventHandler
from autostew_web_enums.models import EventType, SessionStage
from autostew_web_session.models.event import Event
first_player_finished = [
"",
"",
"Congratulations to {winner_name} for winning this race!",
"See this race resu... |
<<<<<<< HEAD
<<<<<<< HEAD
from test.test_json import PyTest, CTest
import re
# 2007-10-05
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json.org... |
# Copyright 2019 Google LLC. 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 a... |
# -*- coding: utf-8 -*-
""" Framework for filtered REST requests
@copyright: 2013-14 (c) Sahana Software Foundation
@license: MIT
@requires: U{B{I{gluon}} <http://web2py.com>}
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentati... |
import warnings
import json
from django.conf import settings
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.template import TemplateDoesNotExist
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives, EmailMessage
from djan... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
lasinfo.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
D... |
######################################################################
# Preliminaries,
import scipy as sp
mat=sp.matrix
from scipy.linalg import inv
######################################################################
# an utility function to format a matrix for inclusion in a LaTeX file
def latex_print(data,name,fm... |
#!/usr/bin/python
# (c) 2018-2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
################################################################################
#
# Copyright 2015-2020 Félix Brezo and Yaiza Rubio
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Softwa... |
# This file is part of Bika LIMS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
import json
import urllib
import time
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone import api
from plon... |
# Copyright 2013 IBM Corp.
#
# 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 agree... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2020 by Brendt Wohlberg <brendt@ieee.org>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""Dictionary learning based ... |
from setuptools import setup
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
HISTORY = open(os.path.join(here, 'HISTORY.rst')).read()
version = "1.1.2.dev0"
install_requires = [
'setuptools',
'ploy >= 1.0.0, < 2dev',
'Fabric>=1.4.0,!=1... |
# Copyright 2013 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/LICENSE-2.0
#
# Unless requ... |
# Number spiral diagonals
#
# Problem 28
#
# Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:
#
# 21 22 23 24 25
# 20 7 8 9 10
# 19 6 1 2 11
# 18 5 4 3 12
# 17 16 15 14 13
#
# It can be verified that the sum of the numbers on the diagonals is 101... |
from rest_framework_extensions.etag.decorators import etag, api_etag
from rest_framework_extensions.settings import extensions_api_settings
class BaseETAGMixin:
# todo: test me. Create generic test like test_etag(view_instance,
# method, should_rebuild_after_method_evaluation)
object_etag_func = extension... |
import urlparse
import web
from libweasyl import ratings
from libweasyl import staff
from libweasyl.text import slug_for
from weasyl import (
character, comment, define, errorcode, folder, journal, macro, profile,
report, searchtag, shout, submission, orm)
from weasyl.controllers.base import controller_base
... |
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Plugin Tools v1.0.8
#---------------------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Based on code from youtube, parsedom and pelisalacarta addon... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
# -*- coding: utf-8 -*-
import re
from django import template
from django.template.defaultfilters import stringfilter
from relax import json, settings
register = template.Library()
class SettingNode(template.Node):
def __init__(self, setting_name, var_name=None, default_value=None):
# The variabl... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
#from Domain import Domain
from future import standard_library
standard_library.install_aliases()
from .HelicopterHover import HelicopterHover, HelicopterHoverExtended
fro... |
from __future__ import unicode_literals
import argparse
from .. import repo
from ..uis import get_ui
from .. import endecoder
from ..utils import resolve_citekey_list
from ..endecoder import BIBFIELD_ORDER
from ..completion import CiteKeyCompletion, CommaSeparatedListCompletion
class CommaSeparatedList(argparse.Act... |
from awacs.aws import (
Action,
Allow,
Policy,
Principal,
Statement,
)
from troposphere import (
Sub,
Join,
Region,
AccountId,
AWSHelperFn
)
from awacs import (
sts,
s3,
logs,
ec2,
dynamodb,
cloudwatch,
)
def make_simple_assume_statement(*principals):
... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Rename model 'TextOverlayImageMod'
db.rename_table('downloads_textoverlayimagemod', 'downloads_textoverlay... |
#!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2019/12/2 14:43
# @Author : Allen Woo
from bson import ObjectId
from flask import request, g
from flask_babel import gettext
from apps.app import mdbs, cache
from apps.core.flask.reqparse import arg_verify
from apps.utils.format.obj_format import json_to_pys... |
# -*- coding: utf-8 -*-
"""Module contains all models directly related to the main entity - tasks."""
from collections import namedtuple
from typing import Any, Dict, List
from bson import ObjectId
from flask_mongoengine import Document
from mongoengine import (
BooleanField,
CASCADE,
DateTimeField,
Di... |
#
# Copyright (c) 2008--2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... |
#!/usr/bin/env python
# This file should be compatible with both Python 2 and 3.
# If it is not, please file a bug report.
import pathConfig
#external imports
import sys,optparse
#internal imports
import subuserlib.classes.user,subuserlib.commandLineArguments,subuserlib.subuser
def parseCliArgs(sysargs):
usage = "u... |
import datetime
import time, pymongo
from elasticsearch import Elasticsearch
from django.utils.html import strip_tags
es = Elasticsearch([{'host': "192.168.0.107"}])
conn = pymongo.MongoClient("192.168.0.107", 27017)
stackoverflowdb = conn.stackoverflow
def save_es(items):
index = "it"
_type = "stackoverflow_... |
# Objects.py
"""
This file defines the various different objects that can be found in the world
"""
#--------------------------
# This file defines the objects in the world. Best practice for naming an object follows: <region><Room><Name>, where the region is lowercase and every other word in the smashed string is ca... |
import pickle
from feature_process import FeatureMapping
import feature_process
from text_processing import TextProcessing
from sklearn.cross_validation import train_test_split
is_not_important = {9:0,
13:0,
18:0,
19:0,
23:0,
28:0,
29:0,
33:0,
34:0,
37:0,
40:0,
44:0,
46:0,
50:0,
55:0,
59:0,
61:0,
62:0,
63:0,
72:0,
73:... |
from unittest import TestCase
from mock import Mock
from cloudshell.cp.openstack.command.operations.connectivity_operation import ConnectivityOperation
class TestConnectivityOperation(TestCase):
def setUp(self):
self.connectivity_service = Mock()
self.conn_operation = ConnectivityOperation(connect... |
# Generated by Django 3.0.4 on 2020-03-19 16:03
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields
import simple_history.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings... |
# -*- coding:utf-8 -*-
from django.template import Context, Template
from django.template.loader import get_template
from django import template
from django.template.defaultfilters import slugify
register = template.Library()
###################################################
# Core as_uni_form filter.
# You will... |
import numpy
from . import Generator, ScalingOperator, BoundedGenerator
class RandomDatetime(Generator):
def __init__(self, generator: BoundedGenerator, start: numpy.datetime64, end: numpy.datetime64, unit):
"""
A timezone-aware class to generate datetimes between start and end (inclusive) follow... |
#
# 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 us... |
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, division, absolute_import
import unittest
from panphon import permissive
class TestFeatureTableAPI(unittest.TestCase):
def setUp(self):
self.ft = permissive.PermissiveFeatureTable()
def test_fts(self):
self.ass... |
# 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 ... |
#
# Project Kimchi
#
# Copyright IBM, Corp. 2013
#
# 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 lib... |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _, throw
from webnotes.utils import flt, cint
from webnotes.utils import load_json, nowdate, cstr
from webnotes.... |
import numpy as np
from math import ceil
import tensorflow as tf
import math
import scipy.io as sio
VGG_MEAN = [103.939, 116.779, 123.68]
class Network:
def __init__(self, params, wd=5e-5, modelWeightPaths=None):
self._params = params
self._images = tf.placeholder("float")
self._batch_imag... |
from django.db import models
from projects.models import Project
from locations.models import Location
class LocalAward(models.Model):
project = models.ForeignKey(Project)
location = models.ForeignKey(Location)
title = models.CharField(max_length=100, blank=True)
def is_eligible(self):
if se... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import io
from datetime import timedelta
from mox3 import mox
import wsgiservice
import wsgiservice.application
import wsgiservice.exceptions
from webob import Request
def test_getapp():
"""get_app returns a list of resources from the dictionary."""
app = wsgiservice.get_app(globals())
print(app)
pr... |
# -*- coding: utf-8 -*-
from telegram.ext import Updater
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, RegexHandler,
ConversationHandler)
from bs4 import BeautifulSoup
from configparser import ConfigParser
from models import *
import logging
import re
import requ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 ~ 2012 Deepin, Inc.
# 2011 ~ 2012 Xia Bin
#
# Author: Xia Bin <xiabin@linuxdeepin.com>
# Maintainer: Xia Bin <xiabin@linuxdeepin.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
import logging
import json
from django.shortcuts import render_to_response
from django.http import Http404
from django.template import RequestContext
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.http import HttpResponseForbidden
from django.shortcuts import redirect
fro... |
# -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2011, 2012, 2013 CERN.
##
## Invenio 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 you... |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields, api
class StockWarehouseOrderpoint(mo... |
from django import template
from django.conf import settings
import json
from geotrek.outdoor.models import Practice, Site
register = template.Library()
@register.simple_tag
def is_outdoor_enabled():
return 'geotrek.outdoor' in settings.INSTALLED_APPS
@register.simple_tag
def site_practices():
practices =... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... |
# -*- coding: utf-8 -*-
"""Generator for moving averages from ROMS file(s)"""
import numpy as np
def roms_averator(ncid, var_name, L, grd):
"""Generator for moving averages from ROMS file(s)
var_name : text string, name of NetCDF variable
ncid : an open NetCDF Dataset or MFDataset
grd : a roppy.S... |
import tushare as ts
def getOneSpecifiedPriceHistoryData(code, start, end, priceType='close'):
data = getSpecifiedPriceHistoryData(code, start, end, priceType)
# print data
for item in data:
return data[item]
def getSpecifiedPriceHistoryData(code, start, end, priceType='close'):
# print code... |
from statsmodels.compat.python import lzip
from io import StringIO
import numpy as np
from statsmodels.iolib import SimpleTable
mat = np.array
_default_table_fmt = dict(
empty_cell = '',
colsep=' ',
row_pre = '',
row_post = '',
table_dec_above='=',
table_dec_below='=',
header_dec_below... |
# Copyright 2020 Makani Technologies 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... |
"""Bloem's Files application model serializers.
This file contains the various serializers used by the Files application's API.
It defines how the data is presented for each model viewed through the API.
"""
from django_celery_results.models import TaskResult
from rest_framework import serializers
from files.models i... |
# 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... |
#!/usr/bin/env python
"""
speed_test -- test how fast tasks can be submitted and processed.
The client/submitter side will run forever, submitting dummy tasks (that don't do anything)
in a loop. Periodically (every few seconds), a status line is printed showing how many
tasks are in the queue, how many running, etc.
... |
"""
The configurations system for dectest. Offers two different methods of
configuration; as a python file or from a dict. Each method is implemented in a
different class, but they all provide the same interface.
"""
import imp
import re
DEFAULTS = {
'testing': {
'testasrun': True,
'sideaffects': ... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Rodolphe Quiédeville <rodolphe@quiedeville.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
#... |
import requests
import secrets
import smtplib
headers = {
'content-type': 'application/vnd.api+json',
'accept': 'application/*, text/*',
'authorization': 'Bearer ' + secrets.tnyu_api_key
}
def get_emails(event_id, event_data, eboard_members, attendees):
res = requests.get('https://api.tnyu.org/v3/eve... |
__author__ = 'Lorenzo Argentieri'
import inspect
import ast
import mayaLib.pipelineLib.utility.docs as doc
from PySide2 import QtCore, QtWidgets
import pymel.core as pm
def test(a, b, c, d='ciao', e='stronzo', f=1):
"""
Test Function
:param a:
:param b:
:param c:
:param d:
:param e:
:... |
""" test """
import logging
import os
import tempfile
import sys
import random
from bzt.engine import Engine, Configuration, FileLister
from bzt.utils import load_class
from bzt.engine import Provisioning, ScenarioExecutor, Reporter, AggregatorListener
from bzt.modules.aggregator import ResultsReader
from tests import... |
import os, sys, logging, logging.config, pyutils
from pyutils import Options, LogAdapter, get_logger, log_level
def main():
from ConfigParser import ConfigParser
from argparse import ArgumentParser
options = {
'option': 'OPTION',
'secrets': {'token': 'secret'},
'loglevel': 'INFO'
... |
# ----------------------------- #
# Common simplifications passes #
# ----------------------------- #
from miasm2.expression.expression import *
from miasm2.expression.expression_helper import *
def simp_cst_propagation(e_s, e):
"""This passe includes:
- Constant folding
- Common logical identities
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Openstack, 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... |
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function # py2.6 with_statement
import sys
import pprint
import h5py
import numpy as np
import os.path
# date related stuff
import datetime
import dateutil
import dateutil.tz
import dateutil.parser
import arrow
# compatibility
import f... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016-Today: Odoo Community Association (OCA)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class GithubOrganization(models.Model):
_name = 'github.or... |
# Taken from https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/avg_checkpoints.py
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... |
"""Collections of linestrings and related utilities
"""
from ctypes import c_double, c_void_p, cast, POINTER
from shapely.geos import lgeos
from shapely.geometry.base import BaseMultipartGeometry
from shapely.geometry.linestring import LineString, geos_linestring_from_py
from shapely.geometry.proxy import CachingGeom... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('quizzes', '0002_auto_20150802_1350'),
]
operations = [
migrations.AlterModelOptions(
name='choice',
... |
import discord
from discord.ext import commands
from .utils.dataIO import dataIO, fileIO
import os
from cogs.utils import checks
import re
tags_path = "data/crtools/tags.json"
clans_path = "data/crtools/clans.json"
tags_bs_path = "data/crtools/tags_bs.json"
clubs_path = "data/crtools/clubs.json"
auth_path = "data/cr... |
# Django
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
from medicine.models import ActivePrinciple
from user.models import User, Patient, HealthProfessional
from medicine.views impo... |
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
"""
Convert shapefiles with z coordinates. Choose from the following formats:
'inp' to create an inp file, 'img' to create an image with a plot of the
feature, or 'shp' to output a shapefile with the average height of a
feature stored in ... |
#! /usr/bin/env python
"""
Taken from Denny Britz's tutorial on CNNs
http://www.wildml.com/2015/12/implementing-a-cnn-for-text-classification-in-tensorflow/
"""
import tensorflow as tf
import numpy as np
import os
import time
import datetime
import data_helpers
from text_cnn import TextCNN
from tensorflow.contrib im... |
from __future__ import absolute_import, print_function, division
import time
from nose.plugins.skip import SkipTest
from nose_parameterized import parameterized
import numpy
try:
from scipy import ndimage
except ImportError:
ndimage = None
from six.moves import xrange
import theano
from theano.gof.opt import ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 07 15:26:27 2016
Code relating to controlling 200^2, BiStim^2, and Rapid^2 Magstim TMS units
@author: Nicolas McNair
"""
from misc import calcCRC, parseMagstimResponse, connectionRobot, serialPortController
from time import sleep
import multiprocessing
cla... |
import sys, os
import dj_database_url
# PATH vars
here = lambda *x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
PROJECT_ROOT = here("")
root = lambda *x: os.path.join(os.path.abspath(PROJECT_ROOT), *x)
sys.path.insert(0, root('apps'))
SENDGRID_API_KEY = os.environ["SENDGRID_API_KEY"]
TWILIO_ACCOUN... |
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
import lactum
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Rackspace
# flake8: noqa
# 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 ap... |
# -*- coding: utf-8 -*-
import os
from robot.libraries.BuiltIn import BuiltIn
from robot.libraries.BuiltIn import RobotNotRunningError
from robot.api import logger
from .keywordgroup import KeywordGroup
class _LoggingKeywords(KeywordGroup):
LOG_LEVEL_DEBUG = ['DEBUG']
LOG_LEVEL_INFO = ['DEBUG', 'I... |
'''
* Copyright (C) 2017 Music Technology Group - Universitat Pompeu Fabra
*
* This file is part of jingjuSingingPhraseMatching
*
* pypYIN 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 (FSF), e... |
from os import path
from fabric.api import local, cd, lcd, roles, execute, task, run, \
settings, abort, hide
from fabric.colors import yellow
from haus_vars import with_vars
import logging
logging.basicConfig()
log = logging.getLogger(__name__)
# config....
USE_CELERY = False # this should ... |
from noise import snoise2
from worldengine.world import Step
from worldengine.simulations.basic import find_threshold_f
from worldengine.simulations.hydrology import WatermapSimulation
from worldengine.simulations.irrigation import IrrigationSimulation
from worldengine.simulations.humidity import HumiditySimulation
fro... |
from corrdb.common import logAccess, logStat, logTraffic, crossdomain, basicAuthSession, get_or_create
from corrdb.common.models import UserModel
from corrdb.common.models import ProfileModel
from corrdb.common.models import ProjectModel
from corrdb.common.models import ApplicationModel
from corrdb.common.models import... |
from __future__ import unicode_literals
import json
from django.db import models
from django.utils import timezone
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from .const import PAGINATION_CHOICES
try:
from urllib.parse import urlparse
except Imp... |
import pandas as pd
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import AdaBoostClassifier, RandomForestClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
df = pd.read_csv('... |
# -*- coding: utf-8 -*-
# vim: set expandtab tabstop=4 shiftwidth=4:
###############################################################
# #
# Alexandre Defendi - 01/04/2014 #
# ... |
#!/usr/bin/python
#----------------------------------------------------------------
#
#------------------------------------------------------
# Usage:
#
#------------------------------------------------------
# Copyright 2007, Oliver White
#
# This program is free software: you can redistribute it and/or modify
# it un... |
# -*- coding: utf-8 -*-
#歧視無邊,回頭是岸。鍵起鍵落,情真情幻。
URL_source = u'http://china-trade-research.hktdc.com/business-news/article/One-Belt-One-Road/The-Belt-and-Road-Initiative-Country-Profiles/obor/en/1/1X000000/1X0A36I0.htm'
encoding_source = "utf-8"
import os
URL_path, downloaded_source = os.path.split(URL_source)
file_outp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.