src
stringlengths
721
1.04M
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # Xcode supports build variable substitutions and CPP; sadly, that doesn't work # because: # # 1. Xcode wants to do the Info.pli...
#!/usr/bin/env python config = { "exes": { # Get around the https warnings "hg": ['/usr/local/bin/hg', "--config", "web.cacerts=/etc/pki/tls/certs/ca-bundle.crt"], "hgtool.py": ["/usr/local/bin/hgtool.py"], "gittool.py": ["/usr/local/bin/gittool.py"], }, 'gecko_pull_url': 'ht...
from SBaaS_base.postgresql_orm_base import * class data_stage01_resequencing_coverage(Base): __tablename__ = 'data_stage01_resequencing_coverage' id = Column(Integer, Sequence('data_stage01_resequencing_coverage_id_seq'), primary_key=True) #analysis_id = Column(String(500)) experiment_id = Column(...
#!/usr/bin/env python # -*- coding: UTF-8 -*- ############################################################################### # chirribackup/chunk.py # # Represents a chunk (in disk and database) # # ----------------------------------------------------------------------------- # Chirri Backup - Cheap and ugly backup ...
"""Module for working with HTTP Form POSTs iteratively. .. warning:: This is an early version of this module. It has no tests, limited documentation, and is subject to major changes. Provides tools for parsing an HTTP Form POST without reading the whole thing into memory first. Many thanks to Michael Barton ...
import hashlib from unittest import TestCase import uuid from falcon import request from stoplight import validate from stoplight.exceptions import ValidationFailed from deuce.transport import validation as v from deuce.transport.wsgi import errors class MockRequest(object): pass class InvalidSeparatorError(E...
# -*- coding: utf-8 -*- # flake8: noqa from datetime import timedelta from coaster import LabeledEnum from coaster.db import db from coaster.sqlalchemy import (BaseMixin, BaseNameMixin, TimestampMixin, BaseScopedIdMixin, BaseScopedNameMixin, CoordinatesMixin, make_timestamp_columns) from .. import app agelimit = ...
#------------------------------------------------------------------------------# # # # Run-time error handler for Rapyd projects # # ...
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 im...
# -*- 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...
# -*- coding: utf-8 -*- import logging import os from kaio import Options from functools import partial logger = logging.getLogger(__name__) opts = Options() get = partial(opts.get, section='Email') class EmailMixin(object): """Settings para enviar emails""" # Django settings: https://docs.djangoproject.c...
# -*- coding: utf-8 -*- ''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis on Heroku ''' from __future__ import absolute_import, unicode_literals from boto.s3.connection import OrdinaryCallingFormat from django.utils...
#!/usr/bin/env python2.6 # # Software License Agreement (GPLv2 License) # # Copyright (c) 2012 TheCorpora SL # # 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...
# -*- coding: iso-8859-1 -*- # # Author: $AUTHOR <$EMAIL> # Date: $DATE # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Library General Public License as # published by the Free Software Foundation; either version 2, or # (at your option) any later version. # # T...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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.or...
# # 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 # ...
# Copyright (c) 2013 VMware, 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...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: smt2011.py # Purpose: Demonstrations for the SMT 2011 demo # # Authors: Christopher Ariza # Michael Scott Cuthbert # # Copyright: Copyright © 2011 Michael Scott Cuthbert an...
#!/usr/bin/env python3 import pyclamster import numpy as np import logging import pickle logging.basicConfig(level=logging.DEBUG) imgshape = (1920,1920) ################################################### ### Read times and sun positions from filenames ### ################################################### sun_rea...
# Copyright 2020 kubeflow.org # # 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...
# Copyright Bors LTD # This file is part of django-gitstorage. # # Django-gitstorage 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...
#-- GAUDI jobOptions generated on Fri Jul 24 17:08:37 2015 #-- Contains event types : #-- 12103450 - 52 files - 1001933 events - 308.74 GBytes #-- Extra information about the data processing phases: #-- Processing Pass Step-127420 #-- StepId : 127420 #-- StepName : Reco14c for MC - 2012 #-- ApplicationN...
##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire # # Copyright (C) 2006 Sami Kyöstilä ...
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # License: BSD from collections import Sequence import warnings import numbers import numpy as np imp...
''' Setup configuration ''' from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path from pip.req import parse_requirements from pip.download import PipSession # parse_requirements() returns generator of pip.req.InstallRequirement objects install_reqs = p...
# encoding: utf-8 """ compare.py -- Functions for comparing double-rotation session responses Exoported namespace: mismatch_response_tally, mismatch_rotation, cluster_mismatch_rotation, population_spatial_correlation, correlation_matrix, correlation_diagonals, common_units Created by Joe Monaco on 2010-02-1...
import numpy as np import matplotlib.pyplot as plt from scipy.stats import linregress from scipy.optimize import curve_fit oberwelle3, amplitude3 = np.genfromtxt('Rohdaten/dreieckspannung.txt',unpack=True) plt.plot(oberwelle3, amplitude3,'k.',label="Messdaten") #plt.legend(loc='best') plt.grid() #plt.xlim(0,1.5) plt.x...
# This file is part of Viper - https://github.com/botherder/viper # See the file 'LICENSE' for copying permission. import os import time import getopt import fnmatch import tempfile import shutil from zipfile import ZipFile from viper.common.out import * from viper.common.objects import File from viper.common.network...
#!usr/bin/python # (C) Legoktm 2008-2011, MIT License import time, datetime """ Not to be run as a file Contains lists and dictionaries to help with dates Only for English Language, however translations are welcome. """ MonthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'Septemb...
# -*- coding: utf-8 -*- # """ TODO. """ from __future__ import print_function import sys import copy import numpy as np from ..lib import extensions from ..lib.utils.timing import decallmethods, timings __all__ = ["Bodies"] class NbodyMethods(object): """This class holds common methods for particles in n-bod...
#!/usr/bin/python # -*- coding: UTF-8 -*- from kivy.core.window import Window from kivy.animation import Animation import copy from kivy.uix.widget import Widget from kivy.properties import ( ListProperty, NumericProperty, BooleanProperty, ObjectProperty) class DragNDropWidget(Widget): # let kivy take care of...
import sys, os, time, shutil from Yowsup.connectionmanager import YowsupConnectionManager from Yowsup.Common.debugger import Debugger USERNAME = '972583340860' PASSWORD = 'jag6FSF6MicZmp9M8lrsSqoXYo8='.decode('base64') phase = None cm = None signals_interface = None methods_interface = None # Utils def phone_number...
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # # sandesh_stats.py # from pysandesh.sandesh_base import Sandesh from pysandesh.gen_py.sandesh_uve.ttypes import SandeshMessageStats from pysandesh.gen_py.sandesh.ttypes import SandeshTxDropReason, \ SandeshRxDropReason class SandeshMessageSta...
import os import sys import time from itertools import chain import numpy as np import pandas as pd import tensorflow as tf import numpy as np from sklearn.cluster import KMeans from sklearn.metrics import normalized_mutual_info_score from sscd import SSCD import pdb class DegreeCorrectedSSCD(SSCD): def prepare_...
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- # # Copyright (C) 2005-2009 University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, ...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2013 ecdsa@github # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
import json import os import random import cv2 from django.shortcuts import render, HttpResponseRedirect from django.core.urlresolvers import reverse from django.views.decorators.csrf import csrf_exempt from toytask.settings import MEDIA_ROOT from . import modules from .forms import UploadImageForm def imagepath(im...
"""util.py: A collection of utility functions for source and/or client.""" import base64 import hashlib class Hashes(object): """Compute hash digests for ResourceSync. These are all base64 encoded according to the rules of http://www.ietf.org/rfc/rfc4648.txt MD5 ResourceSync defined to be the s...
# ====================================================================== # Atomistica - Interatomic potential library and molecular dynamics code # https://github.com/Atomistica/atomistica # # Copyright (2005-2020) Lars Pastewka <lars.pastewka@imtek.uni-freiburg.de> # and others. See the AUTHORS file in the top-level A...
''' Created on Jan 12, 2014 @author: Paulson McIntyre (GpMidi) <paul@gpmidi.net> ''' # Built-in import time import logging import socket import collections import re try: # Python 3.x? import json # @UnresolvedImport except: # Python 2.7 import simplejson as json # @UnresolvedImport @Reimport # Oth...
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime as dt import logging import time import tweepy from tweet_builder import * from credentials import * # Housekeeping: do not edit logging.basicConfig(filename='tweet_test.log', level=logging.DEBUG) auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRE...
import re from urllib.request import urlopen import json serverConfig = "https://www.myfreecams.com/_js/serverconfig.js" url = "https://www.myfreecams.com/_js/mfccore.js" # Maybe it's wrong to merge in the w. stuff? Is that all just for the UI? constantRe = re.compile(r'(\s|;?|,)(FCS|w)\.([A-Z0-9]+)_([A-Z0-9_]+)\s+?=\...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2011 Benoît HERVIER <khertan@khertan.net> # Licenced under GPLv3 ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published ## by the Free Software Foundation; version 3 only. #...
# Copyright 2016 Susan Bennett, David Mitchell, Jim Nicholls # # This file is part of AutoHolds. # # AutoHolds 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...
# dj/main/urls.py from django.conf.urls import patterns, url # from django.views.generic import list_detail from views import * # client_list={"queryset": Client.objects.all(), } # "template_object_name": "client_list" } urlpatterns = patterns( 'main.views', url(r'^$', main, name='main'), url(r'star...
# Copyright 2014 IBM Corp. # Copyright 2012 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/LIC...
# -*- coding: utf-8 -*- import functools import inspect import uuid import marshmallow as ma import sqlalchemy as sa from marshmallow import fields, validate from sqlalchemy.dialects import mssql, mysql, postgresql from .exceptions import ModelConversionError from .fields import Related def _is_field(value): re...
#@+leo-ver=5-thin #@+node:lee.20141224110313.61: * @file example2.py #@@language python #@@tabwidth -4 import cherrypy import random from std.asciisymbol import asciiImage #@+others #@+node:lee.20141223114246.41: ** class Application class Application(object): #@+others #@+node:lee.20141223114246.42: *3* def i...
# -*- coding:utf-8 -*- from __future__ import unicode_literals from baidu.api.base import BaseAPI class IPLocationAPI(BaseAPI): scope = 'location' version = '' def get_location_info(self, ip='', coor=''): """ 获取 IP 对应的位置信息 1.获取指定IP的位置信息:指定IP值,返回该IP对应的位置信息; 2.获取当前设备IP的地址信息...
import argparse from plithos.simulations.random_mover import RandomMover from plithos.simulations.dqn_single_drone import DQNSingleDroneExperiment from plithos.simulations.hand_controlled import HandControlled from plithos.simulations.manual_ai import ManualAIExperiment if __name__ == '__main__': simulations = {...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
# # Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in th...
#coding:utf-8 import os base_dir = os.path.dirname(os.path.realpath(__file__)) DEBUG = True SECRET_KEY = os.environ.get('SECRET_KEY') or 'nobody knows the password' PER_PAGE = 10 SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_RECORD_QUERIES = True IMAGE_UPLOAD_DIR = 'static...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
import re from collections import defaultdict, namedtuple from collections.abc import Iterable from functools import lru_cache from sanic.exceptions import NotFound, InvalidUsage from sanic.views import CompositionView Route = namedtuple( 'Route', ['handler', 'methods', 'pattern', 'parameters', 'name', 'uri']...
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod from lamvery.config import Config from lamvery.log import get_logger from lamvery.clients import ( LambdaClient, KmsClient, EventsClient, LogsClient, ApiGatewayClient ) class BaseAction: __metaclass__ = ABCMeta _logger = No...
# !/usr/bin/env python # # (C) Copyright 2014 Alan Cabrera # # 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...
import base64 import hashlib import hmac import imghdr from wsgiref.util import FileWrapper from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.http import HttpResponse, HttpResponsePermanentRedirect, StreamingHttpResponse from django.shortcuts import ...
""" MIT License Copyright (c) 2016 Zeke Barge 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, di...
#!/usr/bin/python #-*- coding:utf8 -*- # import os import sys import time import json import traceback import jenkinsapi from functools import partial from jenkinsapi.jenkins import Jenkins from jenkinsapi.custom_exceptions import WillNotBuild from conf.config import * # job_dict,jenkins_dic from conf.game_config ...
from StringIO import StringIO from mimetypes import guess_all_extensions, guess_type import uuid import zipfile import logging import os from django.contrib.auth.decorators import login_required import json import itertools from django.conf import settings from django.core.urlresolvers import reverse from django.utils....
""" Data objects in group "Zone HVAC Radiative" """ from collections import OrderedDict import logging from pyidf.helper import DataObject logger = logging.getLogger("pyidf") logger.addHandler(logging.NullHandler()) class ZoneHvacBaseboardRadiantConvectiveWater(DataObject): """ Corresponds to IDD object `Zone...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
# -*- coding: utf-8 -*- # © 2017 Esther Martín - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import fields, models from openerp import tools class PurchaseReport(models.Model): _inherit = 'purchase.report' purchase_categ_id = fields.Many2one( comodel_name=...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation...
import io from threading import Thread import picamera from PIL import Image import zbar class BarcodeScanner(Thread): def __init__(self, resolutionX=800, resolutionY=600, callback=None): self.callback = callback self.scanner = zbar.ImageScanner() self.scanner.parse_config("enable") self.stream = io.BytesIO()...
# # 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...
from django.core.management.base import BaseCommand from metrics.etl.tools import related_posts_extract, fx_extract, log_extract, pd_transform, main_extract, moztech_extract, mozblog_extract, newsletter_extract, moztech_load, browser_survey_extract from metrics.settings import LOG_PATH class Command(BaseCommand): ...
# -*- coding: utf-8 -*- import json import os import tempfile from datetime import datetime from datetime import timedelta import hglib import requests from cli_common.log import get_logger from cli_common.taskcluster import get_service from cli_common.utils import ThreadPoolExecutorResult from code_coverage_bot imp...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Above the run-comment and file encoding comment. # Comments. # TODO FIXME XXX # Keywords. with break continue del return pass raise global assert lambda yield for while if elif else import as try except finally self cls mcs from test import var as name raise Excep...
import unittest import functools import xml.etree.cElementTree as ET from DDEXUI.ddex.file_metadata import AudioFileMetadata, ImageFileMetadata from DDEXUI.ddex.resource import SoundRecording, Image import os class SoundRecordingTests(unittest.TestCase): def setUp(self): self.resource_reference ...
# Copyright (C) 2017 Greenweaves Software Pty Ltd # This is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This software is distribut...
#!/user/bin/env python # -*- coding:utf-8 -*- import random import re import json import traceback import sys import time import calendar import datetime from datetime import date # 这段代码是用于解决中文报错的问题 from dateutil.relativedelta import relativedelta reload(sys) sys.setdefaultencoding("utf8") if __name_...
#!/usr/bin/python import sqlite3 class Database: def __init__(self): self.connect() def connect(self): self.conn = sqlite3.connect('lifebot.db') def get_cursor(self): # A bit weird for now but trying to figure out SQLite try: return self.conn.cursor() ...
from setuptools import setup, find_packages CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', ...
import competition_utilities as cu import csv import datetime import time import features import numpy as np import pandas as pd import re import sys from sets import Set import nltk import math from sklearn.feature_extraction.text import * from nltk.stem.wordnet import WordNetLemmatizer import string from n_gram_graph...
import sys import requests import json import base64 import cStringIO content = { "content": { }, "meta": { "audio": { "type": False, "data": False } } } content_type = 'data:image/%s;base64,' headers = { 'Content-Type' : 'application/js...
# coding=utf-8 # Copyright (C) Duncan Macleod (2014) # # This file is part of GWVeto. # # GWVeto 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...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cstr, flt import json, copy from six import string_types class ItemVariantExistsError(frap...
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # plugin.py - Plugin interface # ----------------------------------------------------------------------------- # $Id$ # # This file defines some special plugins known to Freevo. # # -----------------------------...
__author__ = 'AT' from DerApproximator import get_d1 from numpy import concatenate from texttable import Texttable class GradChecker: """ A class for checking gradients. """ def __init__(self): pass @staticmethod def check(f, f_grad, x0, name, verbose=False): """ Checks wheth...
'''Aggregates individual trips to get trip-counts from A-to-B. Makes csv for web. ''' import numpy as np import csv import sys import json import os from itertools import izip # data_dir = "data/Divvy_Stations_Trips_2013" data_dir = "data/divvy_data_challenge_2014" web_dir = "web/data" def read_stations(): stat...
# -*- coding: utf-8 -*- from django.shortcuts import render from django.utils.encoding import smart_unicode import sys, os, locale from datetime import datetime, timedelta from main.forms import StagiaireForms # Create your views here. def home(request): # CISCO # Ajouter au path _path = os.path.dirname(os.path...
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2016 <Jamie McGowan> <jamiemcgowan.dev@gmail.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # ...
# -*- coding: utf-8 -*- """ Created on Fri Jun 19 22:31:53 2015 @author: Ilya """ # %% prepare import pandas as pd from datetime import datetime import calendar import re import numpy as np dtt = lambda datetime_str: datetime.strptime(datetime_str, '%Y-%m-%d %H:%M:%S') df_train = pd.read_csv('../data/train.csv') # ...
import json import logging from functools import partial from collections import OrderedDict from .io import (VrepIO, close_all_connections, VrepIOError, VrepConnectionError) from .controller import VrepController, VrepObjectTracker from .controller import VrepCollisionTracker, VrepCollisionDetector...
# -*- coding: utf-8 -*- # # Copyright (C) 2008 John Paulett (john -at- 7oars.com) # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Python library for serializing any arbitrary object graph into JSON >>> i...
from abc import ABCMeta, abstractmethod from utils.exceptions import ResponseError, InconsistentItemError, EntryNotToBeIndexed class AbstractApiResponse(metaclass=ABCMeta): """ Response got after a query to a `Provider`. Parameters: response -- a `requests.models.Response` instance. """ def...
import yaml from api import DeviceConfig from gpio import PinManager from rabbit import AsyncConsumer class IOService(object): def __init__(self, config_file): with open(config_file) as file: self.config = yaml.safe_load(file) self.load_device_config() self.initialize_pin_man...
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # http://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals class EleprojectSpiderMiddleware(object): # Not all methods need to be defined. If a method is not defined, # scrap...
# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, absolute_import import sys import os import subprocess import json import click import hashlib import cProfile import StringIO import pstats import frappe import frappe.utils ...
""" Deuce Rackspace Authentication API """ import logging import deuceclient.auth import deuceclient.auth.openstackauth def get_identity_apihost(datacenter): if datacenter in ('us', 'uk', 'lon', 'iad', 'dfw', 'ord'): return 'https://identity.api.rackspacecloud.com/v2.0' elif datacenter in ('hkg', 'sy...
#!/usr/bin/python # -*- coding: utf-8 -*- # """ setup.py Copyright 2017 CodeRatchet 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...
from scrapy import Spider from scrapy.http import Request from firmware.items import FirmwareImage from firmware.loader import FirmwareLoader import urllib.request, urllib.parse, urllib.error # http://home.centurytel.net/ihd/ class CenturyLinkSpider(Spider): name = "centurylink" allowed_domains = ["century...
from decimal import getcontext, Decimal from decmath import _pi, _to_Decimal, sign # Trigonometric functions def acos(x): """Return the arc cosine (measured in radians) of x.""" x = _to_Decimal(x) if x.is_nan(): return Decimal("NaN") elif abs(x) > 1: raise ValueError("Domain error: a...
# Copyright (c) 2012 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...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...