text
stringlengths
12
6.59M
""" Python implementation of the fast ICA algorithms. Reference: Tables 8.3 and 8.4 page 196 in the book: Independent Component Analysis, by Hyvarinen et al. """ # Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux, # Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann # License: BS...
from braces.views import CsrfExemptMixin, LoginRequiredMixin import datetime from ipware.ip import get_real_ip import pytz from django.http import HttpResponse from django.views.generic import TemplateView, View from clowder_account.models import ClowderUser from clowder_server.emailer import send_alert from clowder_...
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import copy import logging import sys import weakref from xml.etree import cElementTree as ET from sleekxmpp.xmlstream import JID from sleekxmp...
"""Miscellaneous operations for traditional philology and simple statistics.""" __author__ = ['Kyle P. Johnson <kyle@kyle-p-johnson.com>', 'Steven Bird <stevenbird1@gmail.com>', # original author of NLTK's ConcordanceIndex() 'Edward Loper <edloper@gmail.com>'] # original author of NLTK's ...
import json, ast from urllib import urlencode from base64 import b64encode from io import StringIO from twisted.web import http from twisted.internet import defer from twisted.internet.defer import inlineCallbacks from twisted.internet.error import ConnectionRefusedError from twisted.web.resource import Resource from ...
#!/usr/bin/env python """ Attempt to figure out what options need to be added to the Exim Makefile to embed a Python interpreter for your particular platform. Most of the info seems to be available in the Python distutils.sysconfig module, cross your fingers. 2002-10-19 Barry Pederson <bp@barryp.org> """ import di...
"""PCSC Smartcard request. __author__ = "http://www.gemalto.com" Copyright 2001-2007 gemalto Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com This file is part of pyscard. pyscard is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as ...
## ## patts-qt - Qt GUI client for PATTS ## Copyright (C) 2015-2016 Delwink, 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, version 3 only. ## ## This program is distribu...
from pdfplumber.pdf import PDF import pdfplumber.utils import pdfminer import pdfminer.pdftypes from ._version import __version__ pdfminer.pdftypes.STRICT = False pdfminer.pdfinterp.STRICT = False def load(file_or_buffer, **kwargs): return PDF(file_or_buffer, **kwargs) open = PDF.open # Old idiom from_path = PDF...
#!/usr/bin/env python3 # vim: set fenc=utf8 ts=4 sw=4 et : import time import sys import json import dict2xml import argparse import xml.sax import functools FLOW_DEF_NESTCHAR = '.' FLOW_DEF=[ 'vlan{}id'.format(FLOW_DEF_NESTCHAR), 'ip{}src'.format(FLOW_DEF_NESTCHAR), 'ip{}dst'.form...
# # collect.py, collector functions for mod_python collectors # try: import socorro.lib.uuid as uuid except ImportError: import uuid try: import json except ImportError: import simplejson as json import socorro.lib.ooid as ooid import socorro.lib.util as sutil import socorro.lib.JsonDumpStorage as jds import...
# coding: utf-8 from collections import OrderedDict from pdp.tutorial.models import Tutorial, Part, Chapter, Extract def move(obj, new_pos, position_f, parent_f, children_fn): ''' Move an object and reorder other objects affected by moving. This function need the object, the new position you want the o...
#BEGIN_HEADER import os import sys import traceback import json import logging import subprocess import tempfile import uuid import hashlib from datetime import datetime from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from biokbase.workspace.client import Workspace as workspaceServi...
#!/bin/bash """The Emu object esentially wraps the George gaussian process code. It handles building, training, and predicting.""" import warnings from glob import glob from itertools import izip from multiprocessing import cpu_count from os import path from time import time from abc import ABCMeta, abstractmethod im...
#!/usr/bin/python # Copyright: Ansible Project # 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'], ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Dag Wieers <dag@wieers.com> # This file is part of Ansible # # Ansible 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 py import re from utils import rd, rs, rt, imm, jtarg, shamt from utils import trim, trim_5, signed, sext, sext_byte # we mark pure (trace elidable) functions that don't have any side effects from rpython.rlib.jit import elidable #======================================================================= # Regis...
#encoding=utf8 import os import random import operator import numpy as np import FukuML.Utility as utility import FukuML.MLBase as ml import FukuML.LinearRegression as linear_regression #np.set_printoptions(threshold=np.nan) class LogisticRegression(ml.Learner): def __init__(self): """init""" ...
""" Plugin mixin classes """ import logging import json import requests from django.conf.urls import url, include from django.db.utils import OperationalError, ProgrammingError from plugin.models import PluginConfig, PluginSetting from plugin.urls import PLUGIN_BASE logger = logging.getLogger('inventree') class ...
""" Plugin mixin classes """ import logging import json import requests from django.conf.urls import url, include from django.db.utils import OperationalError, ProgrammingError from plugin.models import PluginConfig, PluginSetting from plugin.urls import PLUGIN_BASE logger = logging.getLogger('inventree') class ...
import discord from discord.ext import commands import asyncio import datetime import time import clients from modules import conversions from modules import utilities from utilities import checks def setup(bot): bot.add_cog(Discord(bot)) class Discord(commands.Cog): def __init__(self, bot): self.bot = bot ...
# Copyright 2011 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...
#!/usr/bin/env python ''' general.py: general models for text and images ''' from som.api.google.storage.client import ClientBase from som.api.google.storage.models import * from som.api.google.storage.utils import * from som.logman import bot from som.utils import read_json import six #############################...
import requests import re from time import sleep from bs4 import BeautifulSoup from os.path import basename class PTTparser: def __init__(self): self.PTTaddress = 'https://www.ptt.cc/bbs/' def getSoup(self, URL, encoding='utf-8'): response = requests.get(URL, cookies={'over18': '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...
# Display Node - Python and Javascript plotting and data visualisation. # Stefano Pedemonte # Aalto University, School of Science, Helsinki # 20 Oct 2013, Helsinki # Harvard University, Martinos Center for Biomedical Imaging # Dec 2013, Boston, MA, USA __all__ = ['DisplayNode','examples'] from DisplayNodeProxy im...
""" jetpack.management.commands.force_sdk ------------------------------------- Force all addons depending on SDK which version is between given versions to depend on another SDK """ import commonware from optparse import make_option from django.core.management.commands.loaddata import Command as BaseCommand from d...
""" nb-NO to nn-NO Metadata Macro will perform the following changes to current content item: - change the language to nn-NO """ import requests from requests.auth import HTTPBasicAuth def nob_NO_translate_macro(item, **kwargs): creds = HTTPBasicAuth("superdesk", "babel") payload = { k: item.get(k) ...
import string import re Zero = "PyUFunc_Zero" One = "PyUFunc_One" None_ = "PyUFunc_None" class TypeDescription(object): def __init__(self, type, f=None, in_=None, out=None): self.type = type self.func_data = f if in_ is not None: in_ = in_.replace('.', type) self.in_ = ...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html from settings import DATABASE from sqlalchemy.orm import sessionmaker from sqlalchemy.engine.url import URL from sqlalchemy impo...
#!/usr/bin/env python """ Extract genome signal sequence labels like Transcription Start Site [TSS], Translational Initiation Site [TIS] and Splice Sites [don, acc] from the genome annotation in GTF/GFF with genome sequence in FASTA format. The number of positive and negative labels for each signal sequence are ge...
# Copyright (c) Charl P. Botha, TU Delft # All rights reserved. # See COPYRIGHT for details. from module_kits.misc_kit.mixins import SubjectMixin import vtk # z-coord of RBB box RBBOX_HEIGHT = 0.5 ############################################################################# class DeVIDECanvasObject(SubjectMixin): ...
#!/usr/local/bin/python # -*- coding: utf-8 -*- ''' ********************************************* File Name: 3d_printer_camera.py Python Version: 2.7.11 Author: Joe Kaufeld Email: joe.kaufeld@gmail.com Purpose: Runs a constant camera stream to attempt to auto-detect 3D prints, photograph them, and use the p...
import string import re Zero = "PyUFunc_Zero" One = "PyUFunc_One" None_ = "PyUFunc_None" class TypeDescription(object): def __init__(self, type, f=None, in_=None, out=None): self.type = type self.func_data = f if in_ is not None: in_ = in_.replace('.', type) self.in_ = ...
import os import unittest from webtest import TestApp from ..run_webservices import app from ..directory_helpers import _get_clean_directory_path test_app = TestApp(app) class TestDirectoryPathCleaner(unittest.TestCase): PATH_LEADER = '/tmp/foo' VALID_CLEAN_DIR = '/tmp/foo/bar' if not os.path.exists(PAT...
""" @author Swarbhanu Chatterjee @file ion/services/dm/utility/uns_utility_methods.py @description A module containing common utility methods used by UNS and the notification workers. """ from pyon.public import get_sys_name, OT, IonObject, CFG from pyon.util.ion_time import IonTime from pyon.util.log import log from p...
#! /usr/bin/env python import os, mapnik from osgeo import ogr from ocitysmap import BoundingBox try: import cairo except ImportError: cairo = None class GLOBALS: MAIN_PROJECTION = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over" ...
"get actual recommendations" "tweak below" import sys import codecs import cPickle as pickle from collections import defaultdict from math import log1p, sqrt from github_utils import * from settings import * # TODO: move to settings input_file = 'condensed_users_and_repos.pkl' similiarity_file = 'similiarity.pkl' tar...
""" Generic OCR helper functions and wrapper around various OCRopus and Tesseract tools. """ import os import re from datetime import datetime import subprocess as sp import uuid from PIL import Image from django.utils import simplejson from django.conf import settings from HTMLParser import HTMLParser class Hocr...
from collections import namedtuple from unittest.mock import MagicMock, patch from django.test import TestCase from jarbas.core.models import Reimbursement from jarbas.dashboard.admin import ( ReceiptUrlWidget, ReimbursementModelAdmin, SubquotaWidget, SubquotaListFilter, SuspiciousWidget, ) Requ...
""" Basic OCR functions. Submit OCR tasks and retrieve the result. """ import re import os import traceback from celery import result as celeryresult from django.contrib.auth.decorators import login_required from django.db import transaction from django.contrib import messages from django.http import HttpResponse, Ht...
#!/usr/bin/env python import os import re import sys sys.path.append('.') sys.path.append('./lib/') import alchemy from argconfig_parse import ArgHandler from ConfigParser import ConfigParser from datetime import datetime #<2013/01/15 from lib.handlers.grant_handler_v42 import PatentGrant as PatentGrant1 # 2013/01/1...
# -*- coding: utf-8 -*- from flask import Blueprint, render_template, request, redirect, flash, url_for from flask.ext.login import login_required, current_user from sqlalchemy import or_ from octopus.case.forms import NewCaseForm from octopus.case.utils import create_query from octopus.extensions import nav, db from ...
"""Common test utilities""" import os import struct import sys import tempfile import traceback import unittest import zlib from functools import wraps from os.path import dirname from threading import Thread from time import sleep from PyQt4 import QtCore from mock import Mock from nxdrive import __version__ from nx...
""" Some generic utility routines for number handling and calculating (specific) variances """ import itertools import logging import numpy from sourcefinder import extract from sourcefinder import stats from sourcefinder import utils from sourcefinder.utility import containers from sourcefinder.utility.memoize impo...
""" Top-level run script for IPCluster parallel Queue implementation Run as: python runQueue.py --qFPath '/Full path/queuefile.json' (optional but strongly suggested) --outpath '/dirToCreateAllOutputFolders/' (optional) --ScriptsPath '/Full path to directory...
""" Handle view-logic for the djangoapp """ from lti_consumer.models import LtiConfiguration from opaque_keys.edx.keys import CourseKey from opaque_keys import InvalidKeyError from rest_framework import serializers from rest_framework.response import Response from rest_framework.views import APIView from openedx.core....
""" Handle view-logic for the djangoapp """ from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser from lti_consumer.models import LtiConfiguration from opaque_keys.edx.keys import C...
# Copyright 2014, 2015 The ODL development group # # This file is part of ODL. # # ODL 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. ...
import os DB_NAME = os.getenv('DB_NAME') DB_HOST = os.getenv('DB_HOST') DB_USER = os.getenv('DB_USER') DB_PASS = os.getenv('DB_PASS') DB_PORT = os.getenv('DB_PORT', 5432) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': DB_NAME, 'HOST': DB_HOST, ...
import os ########## DATABASE CONFIGURATION DB_NAME = os.getenv('DB_NAME') HOST = os.getenv('DB_HOST') USER = os.getenv('DB_USER') PASS = os.getenv('DB_PASS') PORT = os.getenv('DB_PORT', 5432) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': DB_NAME, '...
from beam import Beam from models import (Command, User, session, CommandCommand, QuoteCommand, CubeCommand, SocialCommand, UptimeCommand, PointsCommand, TemmieCommand, FriendCommand, SpamProtCommand, ProCommand, SubCommand, RepeatCommand) from re import find...
from getconfig import get_config_value import sys cmdchar = get_config_value('misc.cmdchar') admins = get_config_value('misc.admins').split('/') def public(c, e, bot): if e.arguments[0][:len(cmdchar)] != cmdchar: return print('proceeding with command %s.' % e.arguments[0][len(cmdchar):]) cmd = e.ar...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 P. Christeas, Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP SA. (http://www.openerp.com) # # This program is free so...
from __future__ import division from __future__ import absolute_import from builtins import str from builtins import range from past.utils import old_div from builtins import object from .test_helpers import (raises_with_message_like, data_filename, CalvinistDynamics, make_1d_traj, ...
from binascii import hexlify from base64 import b64decode, b64encode from collections import OrderedDict from hashlib import md5 import re from struct import unpack from six import byte2int def iter_prefixed(data): while data: # get next prefix l = unpack('!I', data[:4])[0] packet, data =...
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.utils.encoding import smart_str import csv import os from units.models import Unit class Command(BaseCommand): help = 'Sync accreds to DIT server' def handle(self, *args, ...
version_base = (4, 3, 0) version_suffix = 'beta1' if version_suffix is None: __version_info__ = version_base else: __version_info__ = version_base + (version_suffix,) __version__ = '{}.{}'.format(*version_base) if version_base[2] != 0: __version__ += '.{}'.format(version_base[2]) if version_suffix is not...
# Copyright (c) 2010-2017 Samuel Abels # # 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, d...
""" Methods for creating experiment function call summaries. Main method is writeSummary() """ import sys from os import path from inspect import getdoc from warnings import warn __author__ = 'Marc Schulder' def writeSummary(func, outputDir, *args): """ Write a summary of a given function. The function...
#!/usr/bin/env python # # Copyright 2016 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...
# -*- coding: iso-8859-1 -*- # # Copyright (C) 2005 Edgewall Software # Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac....
#! /usr/bin/env python3 import sqlite3 import subprocess import os import bcrypt import hashlib from Crypto.Cipher import AES import codecs import json import cherrypy import time pwdatabase = 'passwords.db' # pwdatabase = ':memory:' authKeys = dict() login_attempts = [] login_attempt_window = 60 * 5 login_attempts...
# -*- coding: utf-8 -*- # # Copyright (C) 2004-2006 Edgewall Software # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de> # Copyright (C) 2006 Christian Boos <cboos@neuf.fr> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this dis...
## # Copyright (c) 2011-2014 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
#!/usr/bin/env python # Copyright (c) 2017 Thomas J. Garcia # # 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, modi...
# -*- coding: utf-8 -*- # # Copyright (C) 2003-2006 Edgewall Software # Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com> # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de> # Copyright (C) 2005-2006 Christian Boos <cboos@neuf.fr> # All rights reserved. # # This software is licensed as described in th...
# -*- test-case-name: txdav.carddav.datastore.test -*- ## # Copyright (c) 2010-2012 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/l...
# Copyright (C) 2013 Andrew Okin # 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, distribu...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A level designer for the game Star Pusher by Al Sweigart from his book 'Making Games with Python & Pygame' http://inventwithpython.com/pygame/chapters/ """ import pygame, sys, os, copy from pygame.locals import * FPS = 30 # frames per second to update the screen WINDOW...
# -*- coding: utf-8 -*- import time import hashlib import pickle from threading import RLock cache = {} def is_obsolete(entry, duration): return time.time() - entry['time'] > duration def compute_key(function, args, kwargs): key = pickle.dumps((function.func_name, args, kwargs)) return hashlib.sha1(ke...
# -*- coding: utf-8 -*- import re pre_patterns = [ ( r'(\d{16}-[-\w]*\b)', r'REQUEST_ID_SUBSTITUTE', ), ( # r'([\dA-F]){8}-[\dA-F]{4}-4[\dA-F]{3}-[89AB][\dA-F]{3}-[\dA-F]{12}', r'([0-9A-F]){8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}', # r'[0-9A-F-]{36}', ...
import copy, pickle, re, os, time, subprocess, datetime, itertools, hashlib class cluster_management(object): def __init__(self): return @staticmethod def get_server_and_user(): server = subprocess.check_output(['uname', '-n']).strip() user = subprocess.check_output('echo $HOME', s...
# -*- coding: utf-8 -*- """ traceview.resources This module contains the objects associated with API resources. """ import logging import requests log = logging.getLogger(__name__) class Resource(object): """ The :class:`Resource <Resource>` object. """ AUTHORITY = "https://api.tv.appneta.com" ...
from paver.easy import * import paver.virtual import os base = path(os.path.abspath(os.path.dirname(__file__))) easy_install = base + '/bin/easy_install' libraries = [ ('django', ''), ('http://bitbucket.org/ubernostrum/django-registration/get/tip.zip', '-Z'), ] options( virtualenv=Bunch( script_na...
#!/usr/bin/env python #-- Content-Encoding: UTF-8 -- """ Created on 29 févr. 2012 :author: Thomas Calmant """ # ------------------------------------------------------------------------------ import logging import threading _logger = logging.getLogger(__name__) # ----------------------------------------------------...
import re import logging from datetime import datetime from django.utils import timezone from tracking.models import Visitor, Pageview from tracking.utils import get_ip_address from tracking.settings import (TRACK_AJAX_REQUESTS, TRACK_ANONYMOUS_USERS, TRACK_PAGEVIEWS, TRACK_IGNORE_URLS, TRACK_IGNORE_STATUS_CODES, T...
""" This paver file is intented to help with the release process as much as possible. It relies on virtualenv to generate 'bootstrap' environments as independent from the user system as possible (e.g. to make sure the sphinx doc is built against the built scipy, not an installed one). Building a simple (no-superpack) ...
from __future__ import print_function import os from optparse import make_option import urlparse from jinja2 import BaseLoader, Environment, TemplateNotFound import paramiko from paver.easy import * import yaml @task @cmdopts([("host=", None, "The host for which to build")], share_with=['generate_image']) def upgra...
import datetime import inspect import numpy.testing as npt import os.path import pandas as pd import pandas.util.testing as pdt import sys from tabulate import tabulate import unittest #find parent directory and import model parentddir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) sys.path...
#!/usr/bin/env python # MatrixExpert.py # Copyright (C) 2006 CCLRC, Graeme Winter # # This code is distributed under the BSD license, a copy of which is # included in the root directory of this package. # # 24th July 2007 # # A small expert to handle orientation matrix calculations. # import os import sys im...
from bottle import Bottle, run, response, abort from ..utils import connect_to_redis from ..plug.metadata import Metadata host = 'localhost' port = 3862 app = Bottle() redis = connect_to_redis() session = redis.session @app.hook('after_request') def enable_cors(): response.headers['Access-Control-Allow-Origin...
from datetime import datetime from django.contrib.auth.models import User from django.db.models import F from brabeion import badges from brabeion.models import BadgeAward from piston.handler import BaseHandler from piston.utils import require_extended from accounts.models import UserProfile from api.forms import (Vali...
# coding: utf8 from __future__ import unicode_literals import plac import requests import os import subprocess import sys from ._messages import Messages from .link import link from ..util import prints, get_package_path from .. import about @plac.annotations( model=("model to download, shortcut or name)", "pos...
__version__ = "1.4.1" """ :mod:`spaghetti` --- Spatial Graphs: Networks, Topology, & Inference ==================================================================== """ from .network import Network, PointPattern, SimulatedPointPattern from .network import element_as_gdf, regular_lattice
import numpy as np class NetworkBase(object): """Base object for performing network analysis on a ``spaghetti.Network`` object. Parameters ---------- ntw : spaghetti.Network spaghetti Network object. pointpattern : spaghetti.network.PointPattern A spaghetti point...
#SPDX-License-Identifier: MIT __name__ = "Augur" __slug__ = "augur" __url__ = "https://github.com/chaoss/augur" __short_description__ = "Python 3 package for free/libre and open-source software community metrics & data collection" __version__ = "0.15.2" __release__ = "v0.15.2" __license__ = "MIT" __copyright__ = "CH...
name = 'tinymce4-lite' authors = 'Joost Cassee, Aljosa Mohorovic Roman Mirochnychenko' version = '1.0.2' release = version
# -*- coding: utf-8 -*- # # Copyright (c) 2008, Stephen Hansen # Copyright (c) 2009-2010, Robert Corsaro # Copyright (c) 2010, Steffen Hoffmann # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: ...
import os import argparse import shutil import re import glob comment_ends = dict(h="*/", cpp="*/", lua="]]--") class DocumentationBlock: def __init__(self, type, name, description, more): self.type = type self.name = name self.description = description self.more = more def j...
#!/usr/bin/env python # encoding: utf-8 """ vcf_parser.py Parse a file with variant info in vcf format. Creates batches and put them into a queue object. The batches are dictionary objects with overlapping features where the feature id:s are keys and the values are dictionarys with variants. Batch = {feature_1_id:{...
from django.test import TestCase from django.test.client import Client from users.models import User from django.core.exceptions import ObjectDoesNotExist from users.views import SignUp class SignUpPageTest(TestCase): def setUp(self): self.client = Client() self.valid_email = "test@example.com" ...
from io import BytesIO import logging import uuid import pickle import os from bitpay.client import Client from django.conf import settings from django.contrib.auth import get_user_model from django.core.cache import cache from django.core.files.storage import FileSystemStorage from django.http import JsonResponse, Ht...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Author: Shiva Manne <manneshiva@gmail.com> # Copyright (C) 2018 RaRe Technologies s.r.o. # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """Learn paragraph and document embeddings via the distributed memory and distributed bag of words models...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Deep learning via the distributed memory and distributed bag of words models from [1]_, using either hierarchical softmax or negative ...
import json import re import os import shutil from django.db import models from django.dispatch import receiver from geokey.projects.models import Project from geokey.contributions.models import Observation from .manager import SapelliProjectManager from .helper.sapelli_exceptions import SapelliCSVException from ....
from geopar.triangulated_figure import TriangulatedFigure from geopar.triangle import Triangle from geopar.angle import Angle from collections import Counter __author__ = 'satbek' class TFPreprocessor(object): """ TFPreprocessor - Triangulated Figure Preprocessor encapsulates functions that deal with pre...
# Author: KTH dESA Last modified by Andreas Sahlberg # Date: 05 June 2019 # Python version: 3.5 import os import logging import pandas as pd from math import ceil, pi, exp, log, sqrt, radians, cos, sin, asin # from pyproj import Proj import numpy as np from collections import defaultdict # from IPython.display import...
# -*- coding: utf-8 -*- import datetime from nose.tools import assert_less from numpy.testing import assert_array_almost_equal from openfisca_core import periods from openfisca_france.tests import base def test_dossier_de_presse_1(): # Célibataire sans enfants1 part : revenu mensuel net = 1593 IR2015 = 1138 IR...
# -*- coding: utf-8 -*- from django.core.management.base import LabelCommand, CommandError from django.core.exceptions import ImproperlyConfigured from django.db.models import get_app, get_model, get_models from cacheops import invalidate_model, invalidate_obj from cacheops.conf import redis_conn class Command(Label...