src
stringlengths
721
1.04M
import pymongo as Mongo DB_NAME = 'localhost' DB_PORT = 27017 TEST_JSON = {'url':'http://hello.com','content':'Lemon Tree'} class DB(): def __init__(self,db,port): self.client = Mongo.MongoClient(db,port) self.db = self.client.test self.collect = self.db.test_collect def insert(sel...
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
# -*- coding: utf-8 -*- # code for console Encoding difference. Dont' mind on it import sys import imp imp.reload(sys) try: sys.setdefaultencoding('UTF8') except Exception as E: pass import testValue from popbill import TaxinvoiceService, PopbillException taxinvoiceService = TaxinvoiceService(testValue.LinkID, testV...
from __future__ import print_function from __future__ import division from __future__ import absolute_import import tensorflow as tf import csv def catClassification_loader(path): cat_names = ['Abyssinian','Bengal','Birman','Bombay','British_Shorthair', 'Egyptian_Mau','Maine_Coon','P...
# q_git_delegate.py # Copyright (C) 2010 Julien Miotte <miotte.julien@gmail.com> # # This module is part of gitbuster and is released under the GPLv3 # License: http://www.gnu.org/licenses/gpl-3.0.txt # from PyQt4.QtCore import QDateTime, QVariant, Qt, SIGNAL, QRect from PyQt4.QtGui import QDateTimeEdit, QItemDelegate...
from django.utils.six import text_type as str from django.core.urlresolvers import reverse from django.conf.urls import patterns from django.utils.translation import pgettext from django.shortcuts import redirect from .models import FoiRequest urlpatterns = patterns("froide.foirequest.views", (r'^%s/$' % pgette...
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, path_list=[ [TestAction.create_vm, 'vm1', ], [TestAction.create_volume, 'volume1', 'flag=scsi'], [TestAction.attach_volume, 'vm1', 'volume1'], ...
"""Load and generate world mesh data from files.""" # Copyright ยฉ 2014 Mikko Ronkainen <firstname@mikkoronkainen.com> # License: MIT, see the LICENSE file. from pymazing import color, mesh # http://en.wikipedia.org/wiki/Truevision_TGA def generate_blocks_from_tga(file_name): """ Generate block data...
from pyspark import SparkContext, SparkConf, StorageLevel from pyspark.mllib.linalg import Vectors import numpy as np import json from numpy.linalg import svd from elasticsearch_interface \ import get_es_rdd, save_es_rdd, get_currency_pair_dict from utils import parse_range, parse_dates, modify_record def create_p...
import vlc import time import pafy import urllib.parse from threading import Thread from quality_lib import get_audio_url, get_video_url class VideoPlayer(Thread): """ This class will create a thread in which the sound and the video will be played """ def __init__(self, video = None, quality = '',...
from tools.load import LoadMatrix from numpy import double lm=LoadMatrix() traindat = double(lm.load_numbers('../data/fm_train_real.dat')) testdat = double(lm.load_numbers('../data/fm_test_real.dat')) traindna = lm.load_dna('../data/fm_train_dna.dat') testdna = lm.load_dna('../data/fm_test_dna.dat') parameter_list =...
# -*- coding: utf-8 -*- # This file is part of AYAB. # # AYAB 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. # # AYAB i...
import utool as ut from ibeis.algo.graph import demo from ibeis.algo.graph.state import (POSTV, NEGTV, INCMP, UNREV) def test_incomp_inference(): infr = demo.demodata_infr(num_pccs=0) # Make 2 consistent and 2 inconsistent CCs infr.add_feedback(( 1, 2), POSTV) infr.add_feedback(( 2, 3), POSTV) i...
from __future__ import absolute_import import os from gi.repository import Gtk, Gdk, Pango, GObject from threading import Thread, Event class Column: ICON = 0 NAME = 1 DIRECTORY = 2 class FindFiles(GObject.GObject): """Find files tool""" __gtype_name__ = 'Sunflower_FindFiles' __gsignals__ = { 'notify-s...
from __future__ import absolute_import, print_function, division from flask import Flask, g from base.data_set import create_dataset from base.trait import GeneralTrait from dbFunction import webqtlDatabaseFunction class GSearch(object): def __init__(self, kw): self.type = kw['type'] self.terms = kw['terms'] ...
# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016 """Image data base class for kitti""" import cv2 import os import numpy as np import subprocess from dataset.imdb import imdb from utils.util import bbox_transform_inv, batch_iou class kitti(imdb): def __init__(self, image_set, data_path, mc): imdb.__init_...
# -*- coding: utf-8 -*- from openerp import models, fields, api from openerp.osv import osv class Promotion(models.Model): #_inherit = "account.analytic.account" _name = "pos.promotion" _description = "Promotional Rule" _inherit = "mail.thread" name = fields.Char("Promotion Name", required=True) ...
# This module validates inequations along with their solutions # Author: Joseandro Luiz def isValid(cnf, res): """ This function validates a CNF @rtype: bool """ # Turn all variables from CNF positive (we have to compare them later) andBoolClause = None for i in cnf : orBoolClaus...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Author: Andrey Skopenko <andrey@scopenco.net> '''A tool create ip route rules that blackhole networks by country code (ex: RU CN etc.) For the correct execution of script need to download geip database and country codes.''' import csv import sys import optparse import os...
# Copyright (c) 2014, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of condit...
import scipy import scipy.optimize import warnings # Some short-hands: from dna.states import state from dna.iterate import IterateParamHelper from dna.component import Component from dna.vendor import refprop as rp class ConvergenceError(Exception): def __init__(self, value): self.value = value def _...
import time import synapse.cortex as s_cortex import synapse.daemon as s_daemon import synapse.telepath as s_telepath import synapse.lib.service as s_service import synapse.lib.userauth as s_userauth import synapse.swarm.runtime as s_runtime from synapse.tests.common import * class SwarmRunBase(SynTest): def g...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.views.generic import DetailView, ListView, RedirectView, UpdateView from django.contrib.auth.mixins import LoginRequiredMixin from .models import User class UserDetailView(Login...
#!/usr/bin/env python from bs4 import BeautifulSoup import glob import json ############################################# # Convert Hearthstone card data XML to JSON # ############################################# __author__ = "Taylor Caldwell - http://github.com/rithms" __copyright__ = "Copyright 2015, Taylor Caldw...
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 SF Isle of Man Limited # # PYBOSSA is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
""" Copyright (c) 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import os import shutil import tempfile import koji import tarfile import yaml from atomic_reactor.constants import PLUGIN_FETCH_SOURCES_KEY...
# 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 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 Daniel Estevez <daniel@destevez.net> # # This file is part of gr-satellites # # SPDX-License-Identifier: GPL-3.0-or-later # # This contains code taken from # https://github.com/PW-Sat2/SimpleUploader-radio.pw-sat.pl # That code is licenced under the foll...
# -*- Mode: Python; test-case-name: flumotion.test.test_icalbouncer -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Pu...
class BinaryOperator: def __init__(self, left, right): self.left = left self.right = right def __str__(self): return '%s(%s, %s)' % (self.__class__.__name__, self.left, self.right) def toCalchas(self, op): return '(%s%s%s)' % (self.left.toCalchas(), op, self.right.toCalchas...
#!/usr/bin/python # 1. Iterate through all the image pairs and triangulate the match points. # 2. Set the 3d location of features to triangulated position (possibly # averaged if the feature is included in multiple matches # 3. Compute new camera poses with solvePnP() using triangulated point locations # 4. Repeat ...
from sympy.core import symbols from sympy.core.compatibility import range from sympy.crypto.crypto import (cycle_list, encipher_shift, encipher_affine, encipher_substitution, check_and_join, encipher_vigenere, decipher_vigenere, encipher_hill, decipher_hill, encipher_bifid5, encipher_bifid6, bif...
# This file is part of rinohtype, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. import re from collections import OrderedDict from cont...
from cStringIO import StringIO import unittest import cyacd class BootloaderRowTest(unittest.TestCase): def testParseRow(self): rowdata = ":000018008000100020110C0000E92D0000E92D000008B5024B83F3088802F0E8F800100020F8B572B6002406236343704D0134EE187279707831793778B3781202F67800020A4338431904084337063843002103F09FF8...
""" bar3_optimization.py - Top level assembly for the example problem. """ # Optimize the bar3 design using the CONMIN optimizer. # pylint: disable-msg=E0611,F0401 from openmdao.lib.drivers.api import CONMINdriver from openmdao.main.api import Assembly from openmdao.main.datatypes.api import Float # from openmda...
#!/usr/bin/env python3 import curator import elasticsearch import os import ssl import sys TIMEOUT=120 def main(): if len(sys.argv) != 3: print('USAGE: [INDEX_PREFIX=(default "")] [ARCHIVE=(default false)] ... {} NUM_OF_DAYS http://HOSTNAME[:PORT]'.format(sys.argv[0])) print('NUM_OF_DAYS ... dele...
from apetools.commands.ifconfig import IfconfigCommand from apetools.commands.iwconfig import Iwconfig from apetools.commons.enumerations import OperatingSystem from apetools.devices.basedevice import BaseDevice class LinuxDevice(BaseDevice): """ A class to configure and query linux devices """ def _...
# -*- coding: utf-8 -*- """User models.""" import datetime as dt from flask_login import UserMixin from haha.database import Column, Model, SurrogatePK, db, reference_col, relationship from haha.extensions import bcrypt from flask import current_app as app import jwt class Role(SurrogatePK, Model): """A role fo...
from umlfri2.application.events.solution import CloseSolutionEvent from .events.model import DiagramDeletedEvent from .events.tabs import OpenTabEvent, ChangedCurrentTabEvent, ClosedTabEvent from .tab import Tab class TabList: def __init__(self, application): self.__tabs = [] self.__application = ...
# Copyright 2019 Peppy Player peppy.player@gmail.com # # This file is part of Peppy Player. # # Peppy Player 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 opt...
# -*- coding: utf-8 -*- ########################################################################## # Copyright 2013-2021 Aerospike, 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 # # ...
from decimal import Decimal from django.db import models, transaction from django.contrib.postgres.fields import HStoreField from .settings import CCH_PRECISION from .prices import ShippingChargeComponent class OrderTaxation(models.Model): """ Persist top-level taxation data related to an Order. """ ...
# -*- coding: utf-8 -*- """ Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import socket import os from .base import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool...
# -*- coding: utf-8 -*- ''' Initial django functions @author: Laurent GAY @organization: sd-libre.fr @contact: info@sd-libre.fr @copyright: 2017 sd-libre.fr @license: This file is part of Lucterios. Lucterios is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License ...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read().replace('.. :changelog:', ...
""" Management command to verify VEM pact. """ import logging from django.conf import settings from django.core.management.base import BaseCommand from pact import Verifier log = logging.getLogger(__name__) class Command(BaseCommand): """ Management command to verify VAL provider pacts. Example Usage...
from django.db import models STATE_CHOICES = ( ('pa', 'Pennsylvania'), ('nj', 'New Jersey'), ) ITEM_CHOICES = ( ('event','Event'), ('food','Food'), ('goods','Goods'), ('service','Service'), ('other','Other'), ) PAYMENT_CHOICES = ( ('none','None'), ('cash','Cash'), ('check','Ch...
# coding: utf-8 """ Qc API Qc API # noqa: E501 The version of the OpenAPI document: 3.0.0 Contact: cloudsupport@telestream.net Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from telestream_cloud_qc.configuration import Configuration class...
# Copyright 2012-2013 Eric Ptak - trouch.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 l...
import os import subprocess import tqdm import numpy as np from keras.preprocessing.image import load_img from dotenv import load_dotenv, find_dotenv load_dotenv(find_dotenv()) img_width = int(os.environ.get("IMG_DIM")) img_height = int(os.environ.get("IMG_DIM")) def imgdir_to_arr(data_dir, arr_dir): print(...
## # Copyright 2009-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
""" Customizable serialization. """ from django.db import models from django.db.models.query import QuerySet from django.db.models.fields.related import RelatedField from django.utils.encoding import smart_unicode, is_protected_type, smart_str import decimal import inspect import types # We register serializer class...
import math def go_until_repeat_remainder(nom, den, cur_max=1000): remainders = [] cycles = 0 while True: if nom < den: nom*=10 cycles += 1 if nom == den: break if nom > den: remainder = nom%den if remainder in remainders: ...
from flask_debugtoolbar.panels import DebugPanel import jinja2 from . import operation_tracker from . import jinja_filters class MongoDebugPanel(DebugPanel): """Panel that shows information about MongoDB operations. """ name = 'Mongo' has_content = True def __init__(self, *args, **kwargs): ...
""" owtf.models.test_group ~~~~~~~~~~~~~~~~~~~~~~ """ from sqlalchemy import Column, Integer, String from sqlalchemy.orm import relationship from owtf.db.model_base import Model class TestGroup(Model): __tablename__ = "test_groups" code = Column(String, primary_key=True) group = Column(String) # web, ...
""" Calculus on XPadDataItem objects """ from .pyxpad_utils import XPadDataItem from numpy import zeros, cumsum def integrate(item): """ Integrate the given trace Inputs ------ item - an XPadDataItem object (or equivalent) Returns ------- an XPadDataItem object """ if ...
from copy import deepcopy, copy from django.contrib import admin from django.contrib.admin.views.main import ChangeList from django.contrib.contenttypes.admin import GenericTabularInline, GenericStackedInline from django.forms import ModelForm, NumberInput from django.db import models class SortableModelAdminBase(obj...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class EcpVizSdk(BundlePackage): """ECP Viz & Analysis SDK""" homepage = "https://github.com...
# -*- coding: utf-8 -*- import torch def point_form(boxes): """ Convert prior_boxes to (xmin, ymin, xmax, ymax) representation for comparison to point form ground truth data. Args: boxes: (tensor) center-size default boxes from priorbox layers. Return: boxes: (tensor) Converted xmin, y...
from flask import url_for, redirect, request, session, flash, Blueprint import conf import requests from xml.dom.minidom import parseString from models import User import datetime from database import db bp = Blueprint('cas', __name__, url_prefix='/cas/') @bp.route('login') def login(): """ Loggue un utilisateur...
#!/usr/bin/env python ################################################################################ # This file is part of IMTAphy # _____________________________________________________________________________ # # Copyright (C) 2012 # Institute of Communication Networks (LKN) # Department of Electrical Engineering ...
๏ปฟfrom __future__ import print_function from genXplatEventing import * from genXplatLttng import * import os import xml.dom.minidom as DOM stdprolog = """// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in th...
#!/usr/bin/env python3 from os import open, O_RDWR, makedirs, devnull from os.path import abspath, exists, isfile, isdir, dirname from subprocess import check_call, check_output, STDOUT from re import compile as compile_re, M from sys import argv, stderr # Standard headers as of POSIX.1-2008 (Base Specifications, Is...
from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen from Components.config import config, configfile, getConfigListEntry from Components.Sources.StaticText import StaticText from Components.SystemInfo import SystemInfo from Tools.Directories import fileExists from os import path if path...
import json from edx_data_research.parsing.parse import Parse class CourseStructure(Parse): def __init__(self, args): super(CourseStructure, self).__init__(args) self.collections = ['course_structure'] self.course_structure_file = args.course_structure_file self.drop = a...
import os import h5py import imageio import tifffile import struct import numpy as np from PIL import Image from ibex.data_structures import meta_data, skeleton_points from ibex.utilities.constants import * def GetWorldBBox(prefix): # return the bounding box for this segment return meta_data.MetaData(prefix...
#!/usr/bin/env python # # VMAccess extension # # Copyright 2014 Microsoft Corporation # # 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 # # Un...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Rocamgo is recogniter of the go games by processing digital images with opencv. # Copyright (C) 2012 Vรญctor Ramirez de la Corte <virako.9 at gmail dot com> # Copyright (C) 2012 David Medina Velasco <cuidadoconeltecho at gmail dot com> # # This program is free software: you ...
""" Support for Sensors using public Netatmo data. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.netatmo_public/. """ from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SC...
#!/usr/bin/python3 import logging from operator import itemgetter from multiprocessing import Process, Manager, Pool, cpu_count from functools import partial from math import floor from timeit import default_timer as timer import rdflib from .abstract_instruction_set import AbstractInstructionSet from readers import r...
# Find the least common ancestor between two nodes on a binary search tree. The least common ancestor is the farthest node from the root that is an ancestor of both nodes. For example, the root is a common ancestor of all nodes on the tree, but if both nodes are descendents of the root's left child, then that left chil...
#!/usr/bin/env python """ This file is part of open-ihm. open-ihm 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. open-ihm is di...
# 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 u...
# -*- coding: utf-8 -*- # # Copyright ยฉ 2012 - 2016 Michal ฤŒihaล™ <michal@cihar.com> # # This file is part of Weblate <https://weblate.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, eith...
""" 2.2.2: If `onFulfilled` is a function https://github.com/promises-aplus/promises-tests/blob/2.1.1/lib/tests/2.2.2.js """ import threading from sleekxmpp.test import SleekTest class Promise_2_2_2_1_TestCase(SleekTest): """ 2.2.2.1: it must be called after `promise` is fulfilled, with `promise`'s fulfillme...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # 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...
import unittest2 import tuned.profiles import collections class MockProfile(tuned.profiles.profile.Profile): def _create_unit(self, name, config): return (name, config) class ProfileTestCase(unittest2.TestCase): def test_init(self): MockProfile("test", {}) def test_create_units(self): profile = MockProfile...
# -*- coding: utf-8 -*- # # 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 ...
#!/usr/bin/env python3 # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (...
from functools import lru_cache from lxml import html import requests from slugify import slugify __all__ = ('get_meetups',) WIKI_URL = ('https://cs.wikipedia.org/wiki/' 'Seznam_m%C4%9Bst_v_%C4%8Cesku_podle_po%C4%8Dtu_obyvatel') @lru_cache() def get_meetups(lang='cs'): return sort_by_city_size(scr...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import superd...
#!/usr/bin/env python # Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
from discord.ext import commands from clembot.core.logs import init_loggers from clembot.exts.utils.utilities import Utilities from clembot.core import checks from clembot.exts.config.channelconfigmanager import ChannelConfigCache class CityManager(commands.Cog): def __init__(self, bot): self.bot = bot ...
# -*- coding: utf-8 -*- """ Generic failing steps. Often needed in examples. EXAMPLES: Given a step fails When another step fails Then a step fails Given ... When ... Then it should fail because "the person is unknown". """ from beehive import step, then # -----------------------------...
#!/usr/bin/env python # coding: utf-8 import os import unittest import systran_nlp_api import systran_nlp_api.configuration class NerApiTests(unittest.TestCase): def setUp(self): api_key_file = os.path.join(os.path.dirname(__file__), "../", "api_key.txt") systran_nlp_api.configuration.load_api_ke...
import json import logging import os import re import socket import traceback import warnings from copy import copy from datetime import datetime from tempfile import NamedTemporaryFile from time import sleep, time from urlparse import ParseResult, urlparse import attr import dateutil.parser from debtcollector import...
#!/usr/bin/env python """ dynamixel_joint_state_publisher.py - Version 1.0 2010-12-28 Publish the dynamixel_controller joint states on the /joint_states topic Created for the Pi Robot Project: http://www.pirobot.org Copyright (c) 2010 Patrick Goebel. All rights reserved. This program is...
# -*- coding: UTF-8 -*- ## Copyright 2002-2013 Luc Saffre ## This file is part of the Lino project. ## Lino 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 op...
# Copyright 2010-2011 OpenStack Foundation # Copyright 2012-2013 IBM Corp. # 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/li...
#!/usr/bin/env python #-*- coding: utf-8 -*- """ @author: actlea @file: apprentice.py @time: 16-3-19 ไธ‹ๅˆ2:28 @description: """ from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.http import Request from TopicalCrawl.items import ResponseI...
# Copyright (c) 2017 Dell Inc. or its subsidiaries. # 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 # # ...
# third-party imports import mock import responses def test_no_args(runner): result = runner(['apps', 'deploy']) assert result.exit_code == 2 assert 'Usage:' in result.output def test_help(runner): result = runner(['apps', 'deploy', '--help']) assert result.exit_code == 0 assert 'Usage:' i...
import numpy as np import pandas as pd import os import functools import config from utils import np_utils, table_utils # Base class for measuring correlation/similarity/distance # between the search query and page information class BaseEstimator(object): def __init__(self, obs_corpus, target_corpus, aggregation...
# This file is part of the Fluggo Media Library for high-quality # video and audio processing. # # Copyright 2012 Brian J. Crowell <brian@fluggo.com> # # 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 Founda...
### extends 'class_empty.py' ### block ClassImports # NOTICE: Do not edit anything here, it is generated code from . import gxapi_cy from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref ### endblock ClassImports ### block Header # NOTICE: The code generator will not replace the code in this block ### end...
""" Example code from python doc: https://docs.python.org/3.3/library/cmd.html The Cmd class provides a simple framework for writing line-oriented command interpreters. These are often useful for test harnesses, administrative tools, and prototypes that will later be wrapped in a more sophisticated interface. """ imp...
""" OVERVIEW: Python module for quality control of datasets prior to preprocessing. """ from __future__ import print_function import os import util import numpy as np import matplotlib import sys matplotlib.use('Agg') import matplotlib.pyplot as plt import Formatting as frmt def check_length_stats(fastq_in): #...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright (c) 2013, gamesun # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the a...
""" Django settings for mainsite project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...