src stringlengths 721 1.04M |
|---|
# Copyright (c) 2014 Artem Rozumenko (artyom.rozumenko@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
""" Route implementation for the BlueSky FMS."""
from os import path
from numpy import *
import bluesky as bs
from bluesky.tools import geo
from bluesky.tools.aero import ft, kts, g0, nm, mach2cas
from bluesky.tools.misc import degto180
from bluesky.tools.position import txt2pos
from bluesky import stack
from ... |
#
# Copyright 2014 Thomas Rabaix <thomas.rabaix@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
# Copyright 2015 NEC 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 required ... |
from __future__ import absolute_import, print_function, division
import mailcap
import mimetypes
import os
import os.path
import shlex
import signal
import stat
import subprocess
import sys
import tempfile
import traceback
import weakref
import six
import urwid
from typing import Optional # noqa
from mitmproxy impo... |
# -*- coding: utf-8 -*-
from .project import * # noqa
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['*']
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
... |
# -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'
from flask import jsonify, request, render_template, g, make_response
from web import app
from web.model.host_group import HostGroup
from web.model.group_host import GroupHost
from web.model.grp_tpl import GrpTpl
from web.model.host import Host
from web.model.template imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa
import io
import re
import sys
from os.path import join, dirname
from setuptools import setup, find_packages
ROOT = dirname(__file__)
RE_REQUIREMENT = re.compile(r'^\s*-r\s*(?P<filename>.*)$')
RE_MD_CODE_BLOCK = re.compile(r'```(?P<language>[\w+]+)?\n(... |
# vim: set expandtab sw=4 ts=4:
#
# Unit tests for Stages class
#
# Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net>
#
# This file is part of buildtime-trend
# <https://github.com/ruleant/buildtime-trend/>
#
# This program is free software: you can redistribute it and/or modify
# it under the term... |
# 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... |
#!/usr/bin/env python
"""
Make plots showing how to calculate the p-value
"""
import matplotlib.pyplot as pl
from scipy.stats import norm
from scipy.special import erf
import numpy as np
mu = 0. # the mean, mu
sigma = 1. # standard deviation
x = np.linspace(-4, 4, 1000) # x
# set plot to render labels using latex
... |
#!/usr/bin/env python
#
# @brief VCProject file generator
# @date $Date: 2008-02-29 04:52:14 $
# @author Norkai Ando <n-ando@aist.go.jp>
#
# Copyright (C) 2008
# Noriaki Ando
# Intelligent Systems Research Institute,
# National Institute of
# Advanced Industrial Science and Technology (AIST), Japan
... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2013-2021 GEM Foundation
#
# OpenQuake 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 Licen... |
#!/usr/bin/python
#title :check_sync.py
#description :Checks Satellite 6 repository sync status
#URL :https://github.com/RedHatSatellite/sat6_disconnected_tools
#author :Geoff Gatward <ggatward@redhat.com>
#notes :This script is NOT SUPPORTED by Red Hat Global Support Servic... |
import pytest
import copy
from datetime import timedelta
import maya
from maya.core import _seconds_or_timedelta # import private function
def test_rfc2822():
r = maya.parse('February 21, 1994').rfc2822()
d = maya.MayaDT.from_rfc2822(r)
assert r == 'Mon, 21 Feb 1994 00:00:00 GMT'
assert r == d.rfc28... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-22 19:46
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('events', '0... |
# This file is part of OpenHatch.
# Copyright (C) 2010 Jack Grigg
# Copyright (C) 2010 John Stumpo
# Copyright (C) 2011 Krzysztof Tarnowski (krzysztof.tarnowski@ymail.com)
# Copyright (C) 2010, 2011 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
import json
from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.PipRequirement import PipRequirement
from coalib.results.Result import Result
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.settings.Setting import typed_list
@linter(executable='bandit')
class B... |
## pythonFlu - Python wrapping for OpenFOAM C++ API
## Copyright (C) 2010- Alexey Petrov
## Copyright (C) 2009-2010 Pebble Bed Modular Reactor (Pty) Limited (PBMR)
##
## 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 F... |
"""Karrigell HTTP Server
Written by Pierre Quentel quentel.pierre@wanadoo.fr
Published under the BSD licence. See the file LICENCE.txt
This script launches Karrigell with webservers.SimpleAsyncHTTPServer.Server as web server.
It is built on the asyncore/asynchat framework (non-blocking sockets, use of
the select() f... |
import subprocess
from tools import win32_kill
import settings
class PHP(object):
def __init__(self, addresses):
self.path = settings.PHP_CWD
self.executable = settings.PHP_EXECUTABLE
self.ini = settings.PHP_INI
self.addresses = addresses
self.processes = []
def start(s... |
'''
Created on 11May,2016
@author: linyufeng
'''
from utils.TimeZoneConverter import TimeZoneConverter
class Asset(object):
'''
contain the values will be insert into table Asset
'''
convert = TimeZoneConverter();
def __init__(self, startTime, endTime, directory, fileName, fileType, duration... |
class Trie:
def __init__(self, final):
self.final = final
self.children = {}
def insert(self, word):
head = word[0]
tail = word[1:]
# Check string in trie prefixes `word'
if self.final:
return False
# Check `word' prefixes string in trie
if len(tail) == 0 and head in self.child... |
"""
Copyright 2017 Matthew W. Allen
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 writin... |
'''
Copyright [2020] [Arun Kumar G]
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
... |
from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
tasks = Table('tasks', pre_meta,
Column('id', INTEGER, primary_key=True, nullable=False),
Column('priority', INTEGER, nullable=False),
Column('user_id', INTEGER),
Column('ta... |
"""Helper methods for various modules."""
from collections.abc import MutableSet
from itertools import chain
import threading
import queue
from datetime import datetime
import re
import enum
import socket
import random
import string
from functools import wraps
from types import MappingProxyType
from typing import Any,... |
# ------------------------------------------------------------
# Developping with MicroPython in an async way
#
# ------------------------------------------------------------
# === application: neopixel klok ===
# ------------------------------------------------------------
print("== module klok_... |
#!/usr/bin/env python2
from __future__ import division
from __future__ import with_statement
from __future__ import print_function
import execnet
if __name__=='__channelexec__':
import os.path
import subprocess
if not os.path.exists('models/facemodel/model.t7'):
url='https://www.dropbox.com/s/18s63zomyfacj... |
# Initialize App Engine and import the default settings (DB backend, etc.).
# If you want to use a different backend you have to remove all occurences
# of "djangoappengine" from this file.
from djangoappengine.settings_base import *
import os
SECRET_KEY = '=r-$b*8hglm+858&9t043hlm6-&6-3d3vfc4((7yd0dbrakhvi'
INSTALL... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
import asyncio
import pickle
import select
import socket
import sys
import time
import unittest
from uvloop import _testbase as tb
_SIZE = 1024 * 1024
class _TestSockets:
async def recv_all(self, sock, nbytes):
buf = b''
while len(buf) < nbytes:
buf += await self.loop.sock_recv(soc... |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 8 09:21:38 2016
@author: Felipe Leno
This file implements our advisor-advisee proposal.
This agent act as SARSA, and the exploration strategy is changed according to our proposal
"""
from sarsatile import SARSATile
from threading import Thread
from advice_util import ... |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from freezegun import freeze_time
from odoo.exceptions import ValidationError
from odoo.fields import Command
from odoo.tests import tagged
from odoo.tools import mute_logger
from .common import PayULatamCommon
from ..controllers.main import ... |
from django import test
from pacientes_app import forms
from pacientes_app import models
class PacienteEditFormTestCase(test.TestCase):
def setUp(self):
self.paciente = models.Paciente.objects.create(
cedula='18423347',
fecha_nacimiento='1988-03-26'
)
def test_valid_form(self):
data =... |
#!/usr/bin/python2.5
#
# Copyright 2010 Google 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... |
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
from PIL import Image, ImageFilter
except ImportError:
import Image
import ImageFilter
from cropresize2 import CM_AUTO, crop_resize
from django.core.files.base import ContentFile
from thumbnail_... |
#!/usr/bin/env python
import numbers
import numpy as np
import pycuda.driver as drv
import pycuda.elementwise as elementwise
import pycuda.gpuarray as gpuarray
from pycuda.tools import dtype_to_ctype
# List of available numerical types provided by numpy:
# XXX This try/except is an ugly hack to prevent the doc buil... |
# -*- coding: utf8 -*-
"""Migrate the Redis key names from version before and including 0.4 to the new
naming conversion used by 0.5.
The only changes are that keys related are key spaced using Redis hashtags.
For example;
user:1 would become {user:1}
user:1:followers would become {user:1}:followers
post... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 12 13:24:12 2014
"""
#####################################################################################################
# Groupe d'Étude pour la Traduction/le Traitement Automatique des Langues et de la Parole (GETALP)
# Homepage: http://getalp.i... |
#!/usr/bin/env python
# *-* coding:utf-8 *-*
""" TriViSiJu: Graphical interface for the AstroJeune Festival
Copyright (C) 2012 Jules DAVID, Tristan GREGOIRE, Simon NICOLAS and Vincent PRAT
This file is part of TriViSiJu.
TriViSiJu is free software: you can redistribute it and/or modify
it under the terms... |
import sys
import socket
import time
import os
import getpass
path = [] #list to hold file paths
def handshake(address):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #open socket
s.bind((address,5010)) #bind socket
s.listen(1) #wait for connection
conn, addr = s.accept() #accept one connectio... |
#!/usr/bin/env python
#coding:utf-8
import os,sys
import shutil
imageFormat = ('jpg', 'png', 'gif', 'jpeg')
videoFormat = ('mp4', 'm4v', 'avi', 'wmv', 'mov', 'flv', 'mkv', 'swf','webm', 'ogg')
delFormat = ('url', 'txt', 'rar', 'html')
def getCurPath():
path = sys.path[0]
if os.path.isdir(path):
retur... |
'''
OobFusion_2D.py
This code uses two different types of feature vectors (word2vec and n-grams) on the training set to train two random forests.
Probabilities of these two models are then fused by weighted averaging to calculate the final predictions.
'''
import nltk, re, os, pickle, time
import numpy as np
from gen... |
from datetime import timedelta
from django.db.utils import ProgrammingError
import pytest
import requests.exceptions
from normandy.recipes import checks, signing
from normandy.recipes.tests import ActionFactory, RecipeFactory, SignatureFactory, UserFactory
@pytest.mark.django_db
class TestSignaturesUseGoodCertific... |
import sqlite3
import os
import datetime
import logging
ACTION_TYPES = ('grab', 'hit') # possible API actions
class ActionTypeError(ValueError):
message = 'atype must be one of %s' % ', '.join(
'"%s"' % at for at in ACTION_TYPES)
class AccountDB(object):
'''Handle account data. '''
logger ... |
import codecs, importlib, json, os
from typing import Dict, List, Sequence
from .auth import ProviderBase
class ProviderDescriptor:
def __init__(
self,
*,
name: str,
desc: str,
chals: Sequence[str],
args: Sequence[Dict[str, str]],
deps: Sequence[str],
... |
#!/usr/bin/env python
import pytest
import py.test
import datetime
from BeautifulSoup import BeautifulSoup
import wpl
import kpl
from data import Hold
from data import LoginError
from fakes import MyCard
from fakes import MyOpener
def test__parse_holds__numeric_position__reads_position():
response = BeautifulS... |
#!python
# coding=utf-8
from pocean.cf import CFDataset
class IncompleteMultidimensionalTimeseriesProfile(CFDataset):
@classmethod
def is_mine(cls, dsg, strict=False):
try:
assert dsg.featureType.lower() == 'timeseriesprofile'
assert len(dsg.t_axes()) >= 1
assert l... |
from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect
from django.utils import simplejson
from myreadings.models import Book, ReadRate
response_data = dict()
def read_rate_book(request):
try:
b = Book.objects.get(pk=int(request.POST['book_id']))
rr = ReadRate()
... |
import logging
from mbot.event import Event
from mbot.state import User
from mbot.utils.packages import install_package
from .base import Dispatcher
LOG = logging.getLogger(__name__)
class Slack(Dispatcher):
"""Yet another simple bot
Uses slack RTM and calls middlewares for all messages
:param: sla... |
'''
VisualOps agent requests objects
(c) 2014 - MadeiraCloud LTD.
@author: Thibault BRONCHAIN
'''
# Protocol defines import
from opsagent.objects import codes
# Handshake request
def handshake(config, errors):
init = config.get('init')
version = (config['userdata'].get('version') if config.get('userdata') ... |
import cv2
import numpy as np
# number of available patterns:
maxpat = 10
# defining functions for all possible patterns follow,
# activated by patternswitch function
# pattern1: Bruker style crosshair with circles and ticks
def pattern1( arr, width, height, x, y, rad, col ):
cv2.line(arr,(0,y),(width,y),col,1)... |
"""
A range of say.text.Text lines that can be edited on their own,
effecting the underlying lines. If the underlying text object
changes (especially changing the number of lines somewhere
before or overlapping whether the text range lies), TextRange
will probably become confused. However, edits made through the
TextRa... |
import ast
import logging
import time
import unittest
from malcolm.profiler import Profiler
# https://github.com/bdarnell/plop/blob/master/plop/test/collector_test.py
class ProfilerTest(unittest.TestCase):
def filter_stacks(self, results):
# Kind of hacky, but this is the simplest way to keep the tests
... |
#!/usr/bin/env python
import optparse
import sys
import numpy
import math
def main(argv):
#Shameless copy
optparser = optparse.OptionParser()
optparser.add_option("-d", "--data", dest="train", default="data/hansards", help="Data filename prefix (default=data)")
optparser.add_option("-e", "--english", dest="englis... |
from setuptools import setup, find_packages
setup(
name = 'extopen',
version = '0.1.1',
description = "Cross platform helper for opening a file with the default external application.",
long_description = open('README.rst').read(),
url='https://github.com/timsavage/extopen',
author = 'Tim Savage... |
# -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... |
import wx
import vtk
import time
import numpy
from vtk.util import numpy_support
from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor
from pubsub import pub as Publisher
import invesalius.constants as const
import invesalius.data.vtk_utils as vtku
import invesalius.data.converters as converters... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 3 16:24:02 2012
@author: Stuart Mumford
This module imports matplotlib with customisations I use when creating
figures for inclusion in print publications.
Usage
-----
>>> from penygader.plotting.publication import *
>>> plt.plot(x,y)
>>> thick_ticks(plt.gca())
>>> p... |
"""Main function
Copyright (c) 2015 Francesco Montesano
MIT Licence
"""
import os
import sys
from dodocs.cmdline import parse
import dodocs.logger as dlog
__version__ = "0.0.1"
def main(argv=None):
"""
Main code
Parameters
----------
argv : list of strings, optional
command line argum... |
#!/usr/bin/python2.7
# Copyright 2014 by Andrew L. Blais.
# This program is distributed under the terms of the
# GNU General Public License version 3.
from constants import Range8, Egnar8, Egnar16, listToList, \
listToLists, listsToList, RangeMEM
from random import randint
from thread import start_new_thread
#... |
from PySide import QtGui
from pages import Page
from view.widgets.buttonvbox import ButtonVBox
from view.widgets.tablebox import TableBox
class TableBoxPage(Page):
def __init__(self, parent, name):
super(TableBoxPage, self).__init__(parent, name)
def _setup(self):
self.headerlabeltext = "Thi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
def get_args():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
'--procs',
type=int,
default=4,
help='number of processors.'
)
parser.add_argument(
'--nearl',
type=float,
de... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import buildconfig
import os
f... |
# -*- coding: utf-8 -*-
##################################################################################################
import hashlib
import threading
import xbmc
import xbmcgui
import xbmcaddon
import xbmcvfs
import artwork
import utils
import clientinfo
import downloadutils
#################... |
#! /usr/bin/env python3
import os
import sys
import math
from itertools import product
# REXI
from mule_local.rexi.REXICoefficients import *
from mule_local.rexi.pcirexi.BeanREXI import BeanREXI
from mule_local.rexi.pcirexi.LRREXI import LRREXI
from mule_local.rexi.trexi.TREXI import *
from mule_local.rexi.cirexi.CI... |
from __future__ import print_function
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.sparse import coo_matrix
# Expect matrix market format. If A is the matrix, replicates like:
# [A, A ... ; A A .. ], so for n = 2, writes [A, A; A, A]
def plot_coo_matrix(m):
if not isinstance(m, coo_mat... |
#!/usr/bin/env python
from setuptools import setup, find_packages
from os import environ as env
# pull in active plugins
plugins = env['CABOT_PLUGINS_ENABLED'].split(',') if 'CABOT_PLUGINS_ENABLED' in env else ["cabot_alert_hipchat", "cabot_alert_twilio", "cabot_alert_email"]
setup(
name='cabot',
version='0.0... |
"""Write initial TrueGrid files for one Sandia blade station.
Usage
-----
start an IPython (qt)console with the pylab flag:
$ ipython qtconsole --pylab
or
$ ipython --pylab
Then, from the prompt, run this script:
|> %run sandia_blade_lib/prep_stnXX_mesh.py
or
|> import sandia_blade_lib/prep_stnXX_mesh
Au... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
import warnings
warnings.filterwarnings('ignore')
from ipywidgets import interactive, IntSlider, widget, FloatText, FloatSlider, Checkbox
def fempipeWidget(alpha, pipedepth):
respEW, respNS, X, Y = fempipe(alpha, pipedepth)
fig = plt.figure(... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <brett@belizebotanic.org>
# Copyright (c) 2012-2015 Mario Frasca <mario@anche.no>
#
# This file is part of ghini.desktop.
#
# ghini.desktop is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... |
# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Product release interfaces."""
__metaclass__ = type
__all__ = [
'IProductRelease',
'IProductReleaseEditRestricted',
'IProductReleaseFile',
'IProductReleas... |
from __future__ import absolute_import
import random
from jmc.algorithms.searching import binary_search
def coin_flip(seed=None):
"""Generates coin flips using a fair six-sided die."""
if seed:
random.seed(seed)
return random.randint(1, 6) > 3
def test_coin_flip(count):
heads = 0
tails = 0
for x i... |
#!/usr/bin/python
"""code to help run the image-computable version of the model
we're using this primarily to check the effect of vignetting, but this does make our project
image-computable (though it's a linear model and so will fail in some trivial cases)
"""
import itertools
import argparse
import numpy as np
impo... |
from jobmanager.utils import parse_msg_body
class TestUtils(object):
def setUp(self):
pass
def test_parse_msg_body(self):
d1 = {"map": {"entry": [{"string": ["command", "choose"]}, {"string": ["named-parameter-value1", "8a98c0c3-5560-41df-8b86-67435b25d565"]}, {"string": ["named-parameter-key... |
#!C:\Users\SeanSaito\Dev\aviato\flask\Scripts\python.exe
#******************************************************************************
# $Id$
#
# Name: gdalimport
# Project: GDAL Python Interface
# Purpose: Import a GDAL supported file to Tiled GeoTIFF, and build overviews
# Author: Frank Warmerdam, war... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.contrib.auth.decorators import login_required
from django_tinsel.decorators import route, render_template, json_api_call
from django_tinsel.utils import decorate as do
fro... |
import unittest
import database
import logged_menu
class database_tests(unittest.TestCase):
def setUp(self):
database.create_users_table()
database.create_restaurant_table()
database.create_orders_table()
database.create_taxes_table()
database.register('Barney', '420', "Mcl... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script provides two files:
- context.jsonld, that serves https://schema.lab.fiware.org/ld/fiware-data-models-context.jsonld
- mapping_list.yml, that serves https://uri.fiware.org/ns/data-models
context.jsonld is combined by extracting the properties, types and enu... |
# encoding: utf-8
# The MIT License
#
# Copyright (c) 2012 the bpython 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... |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
try:
# Workaround for http://bugs.python.org/issue15881
import multiprocessing
except ImportError:
pass
VERSION = '0.3.4'
if __name__ == '__main__':
setup(
name = 'django-pushserver',
version = VERSION,
... |
#! /usr/bin/env python
import sys
import os
import errno
import random
import string
from pymsbayes.utils import GLOBAL_RNG
from pymsbayes.fileio import process_file_arg
def mkdr(path):
"""
Creates directory `path`, but suppresses error if `path` already exists.
"""
try:
os.makedirs(path)
... |
import simplejson
from django.views import generic
from django.http import HttpResponse
from django.views.decorators.csrf import (csrf_exempt,
requires_csrf_token)
from rest_framework import (viewsets,
generics,
)
from re... |
# -*- coding: utf-8 -*-
import requests
from autoslug import AutoSlugField
from django.db import models
def query_latlong(location):
data = requests.get("https://nominatim.openstreetmap.org/search?q=" + str(location) + " Deutschland" +
"&format=json&polygon=1&addressdetails=1").json()[0]
... |
# search_data: The data to be used in a search POST.
search_data = {
'metodo': 'buscar',
'acao': '',
'resumoFormacao': '',
'resumoAtividade': '',
'resumoAtuacao': '',
'resumoProducao': '',
'resumoPesquisador': '',
'resumoIdioma': '',
'resumoPresencaDGP': '',
'resumoModalidade': '... |
# -*- coding: utf-8 -*-
# Copyright {2014} {Instituto Superior Técnico - Lisboa}
#
# 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... |
"""Tests for the bob_emploi.importer.offers_per_city module."""
from os import path
import unittest
from unittest import mock
from bob_emploi.data_analysis.lib import mongo
from bob_emploi.data_analysis.importer import offers_per_city
from bob_emploi.frontend.api import commute_pb2
@mock.patch(offers_per_city.tqdm.... |
from . import awslib
from app import app
from flask import render_template
from flask import send_from_directory
import json
import yaml
from json import dumps
from os.path import join
from flask import make_response, request, redirect, url_for
import os
import time
import traceback
BUCKET_NAME = os.environ.get('IPLIS... |
import math
import os
n=0
print ("MATHLIB (TM)2017")
print ("-"*50)
print ("Las funciones que puede realizar la libreria son las siguientes:")
print ("")
'''En esta parte se crea el menú principal'''
print ("FUNCIONES BASICAS:")
print ("")
print ("-(1) Suma ")
print ("-(2) Multiplicacion ")
print ("-(... |
"""
Production settings for nomadgram project.
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis for cache
"""
from .base import * # noqa
# SECRET CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://d... |
# -*- 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... |
#!/usr/bin/python
import sys
if len(sys.argv) != 5:
sys.stderr.write("Usage: " + sys.argv[0] + " <instances> <full_output_dir> <timelimit_pbs> <timelimit_heinz>\n")
sys.exit(1)
lines = open(sys.argv[1]).readlines()
n = len(lines)
bins = n / 15
if n % 15 != 0:
bins += 1
full_output_dir = sys.argv[2]
timelim... |
import pytest
from random import randint
from speck import SpeckCipher
from simon import SimonCipher
# Official Test Vectors
class TestOfficialTestVectors:
"""
Official Test Vector From the Original Paper
"The SIMON and SPECK Families of Lightweight Block Ciphers"
"""
# Speck Test Vectors
def ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Functions for normalizing signals
"""
import numpy as np
from collections import namedtuple
import scipy.signal
from .Utils import peak_to_peak
__all__ = ["normalize_max", "center_to_zero", "normalize_minmax", "normalize_plusminus_peak"]
NormalizationResult = namedtu... |
# Copyright 2010-2020 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is part of feedparser.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistribut... |
#!/usr/bin/env python
import pyemma
import numpy as np
import mdtraj
import os
# Source directory
source_directory = '/cbio/jclab/projects/fah/fah-data/munged/no-solvent/10471'
source_directory = '/cbio/jclab/projects/fah/fah-data/munged/no-solvent/10490'
#############################################################... |
"""
:mod:`Crossovers` -- crossover methods module
=====================================================================
In this module we have the genetic operators of crossover (or recombination) for each chromosome representation.
"""
from random import randint as rand_randint, choice as rand_choice
from random i... |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Simone Campagna
#
# 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... |
#!/usr/bin/python
# Malwina Prater, mn367@cam.ac.uk, 2017, Copyright
# Centre for Trophoblast Research, University of Cambridge
#
# Script version: v01.
#
# Script to calculate the percent of transcripts mapping to rRNA
#
# INPUTS :
# 1. HTseq_counts file
# 2. Original reference transcriptome alignned to
#
# USAGE ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.