src
stringlengths
721
1.04M
# coding=utf-8 from __future__ import division from __future__ import absolute_import import pyqtgraph_karl as pg import numpy as np from math import cos, sin, pi import cv2 from qtpy import QtCore from .PseudoSquareROI import PseudoSquareROI from dataArtist.items.QPainterPath import QPainterPath class GridROI(pg....
#!/usr/bin/env python import sys import rospy import time import numpy as np from std_msgs.msg import * from math import * from dynamixel_msgs.msg import JointState from biped.msg import * from biped.srv import * #for details on motor ids see Data_Server.py start_pos = [0, 0 ,0 , 0, 0, 0]; motorid_LL = [19,20,21,22,23...
# -*- coding: utf-8 -*- # Copyright (c) 2009-2015 by xt <xt@bash.no> # (this script requires WeeChat 0.4.2 or newer) # # History: # 2019-01-26, nils_2@freenode # version 0.9: make script python3 compatible # : remove option "message_color" and "separator_color" # 2016-05-07, Sebastien Helleu <flashcode@f...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import math import unittest from collections import namedtuple from gi.repository import GLib from gi.repository import Hkl from numpy import (array, cross, dot, empty, hstack, reshape, vstack) from numpy.linalg import inv, norm ######### # Types # ######### D...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
import sys import MySQLdb import MySQLdb.cursors import json import nflgame import os import config as c db = MySQLdb.connect(host=c.dbhost, user=c.dbuser, passwd=c.dbpass, db=c.dbname, cursorclass=MySQLdb.cursors.DictCursor) # File to save a lookup table to be used for nflgame -> cbs player id lookup lookupfile = o...
# __init__.py - storage (sql database) for XRay data # # Original author: Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> # Modified by: Copyright (C) 2009 Guilherme Versiani <guibv@comunip.com.br> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2, in...
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function from itertools import product import pytest f...
import numpy as np from math import sin, cos import random as rand from pyglet.gl import * import sys AMOUNT_TO_SHRINK = rand.uniform(0.50, 0.75) # Becareful of setting this too high as it will take longer to create the tree the higher you put it. # At values higher than 15(2^15 branches) is where you will notice this...
#!/usr/bin/env python # coding=utf-8 """ Copyright (C) 2010-2013, Ryan Fan <ryan.fan@oracle.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 Foundation; either version 2 of the License, or (at y...
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2016 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
# attributes.py - manages object attributes # Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import operator, weakref from itertools import chain import UserDic...
"""A class for reading Amiga executables and object files in Hunk format""" import os import struct import io from types import * from .Hunk import * class HunkReader: """Load Amiga executable Hunk structures""" def __init__(self): self.hunks = [] self.error_string = None self.type = None self.he...
# Lint as: python3 # Copyright 2018 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 ...
# # Copyright (C) 2013 Christian A. Reiter # # This file is part of MedUX. # # MedUX 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 numpy as np import pandas as pd import glob varcat = pd.read_table('varcat.txt', comment='#', header=0, skip_blank_lines=True, usecols=[0,1,2], dtype={'ID': np.str, 'Campaign': np.str}) all_bad = varcat[(varcat.Class != 'Noise ') & (varcat.Class != 'OTHPER')].ID.values print 'No. of variables & EBs:', len(all_b...
# magneticod - Autonomous BitTorrent DHT crawler and metadata fetcher. # Copyright (C) 2017 Mert Bora ALPER <bora@boramalper.org> # Dedicated to Cemile Binay, in whose hands I thrived. # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License...
# This file is part of browser, and contains the BrowserTab class for a tab # that does not use dbus. # # Copyright (C) 2009-2010 Josiah Gordon <josiahg@gmail.com> # # browser 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 Soft...
from django.contrib.auth.models import Group from django.conf import settings from datetime import timedelta, datetime from .middleware.request import get_request __EPOCH = datetime(day=5,month=1,year=1970) def __date_to_datetime(date): return datetime(date.year, date.month, date.day) def weeks_since_epoch(dat...
from api.util import settings from datetime import datetime, timedelta import redis import json import ast class RedisStatsProvider(object): """A Redis based persistance to store and fetch stats""" def __init__(self): # redis server to use to store stats stats_server = settings.get_redis_stat...
"""Advent of Code 2017, Day 17: Spinlock""" import unittest def get_num_after_zero(no_steps: int, last_number: int) -> int: """Quickly iterate as the spinlock and return the number right of zero. Args: no_steps(int): The number of steps of the pinlock after each insert. last_number(int): The ...
import serial import serial.tools.list_ports from tkinter import * from tkinter.ttk import * from tkinter.ttk import Progressbar from tkinter import messagebox import time import json import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import datetime intento_error = 0 window = Tk() window.titl...
from gge_proxy_manager.models import Castle, Player from gge_proxy_manager.models.log import AttackLog from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from .methods import notify_new_village, notify_ruin_village, notify_attack @receiver(pre_save, sender=Player) def catch_...
# Copyright 2008-2015 Canonical # Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros) # # 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, either version 3 of the # Licens...
#!/usr/bin/python # 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 # "...
import json import shapefile as shp import matplotlib.pyplot as plt import random def mean(numbers): return float(sum(numbers)) / max(len(numbers), 1) numbersX = [] numbersY = [] TaskPoints = {} shpFilePath = r"D:\TaxiCab\mycode\Plots\ShapefileAndTrajectory\taxi_zones\taxi_zones" sf = shp.Reader(shpFil...
import unittest import os import random import munch import basecrm def rand(): return str(random.randint(1, 1000000000)) def lazyproperty(function): attribute = '__lazy__' + function.__name__ @property def __lazyproperty(self): if not hasattr(self.__class__, attribute): setattr(s...
#! /usr/bin/python _description = ''' This script take in a SQL file with INSERTS and CREATES and transforms it into a SQLite contract in Java. Meant to be used with a phpmyadmin exported sql file. Defaults assume the FRC 836 file structure. ''' _defaultRun = ''' python SQLITEContractGen.py --packagename=org.frc...
import pandas as pd import numpy as np import os,sys,pdb from collections import Counter import argparse class CVT_CATEG: def __init__(self,df,datadir): self._df = df self._datadir = datadir self._categ2idx = {} try: os.makedirs(datadir) except Excepti...
#!/usr/bin/python # ex:set fileencoding=utf-8: from __future__ import unicode_literals from django.core.paginator import Paginator from django.core.paginator import InvalidPage from django.template import Context from django.template import loader from django.utils import six from django.utils.translation import uget...
import unittest from TestUtilities import * class DocumentTests(unittest.TestCase): def setUp(self): test_setup(self) def tearDown(self): test_teardown(self) def test_filter_by_id(self): documents = self.threatconnect.documents() filter = documents.add_filter() f...
from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ class ProductPriceOffer(models.Model): STATUS_NOT_REVIEWED = 'not_reviewed' STATUS_PROCESSING = 'processing' STATUS_CANCELED = 'canceled' STATUS_COMPLETED = 'completed' STATUS_C...
worker_2 = ''' R = scan(chushumo:worker_2:twitter_1m); -- query(x,y,z,p):-R(x,y),S(y,z),T(z,x) query = [from R, R as S, R as T where R.$1 = S.$0 and S.$1 = T.$0 and T.$1 = R.$0 emit R.$0 as x, S.$0 as y, S.$1 as z]; store(query,chushumo:worker_2:triangle); ''' worker_4 = ''' R =...
# # Copyright (C) 2010 Cardapio Team (tvst@hotmail.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 Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
# Copyright (c) 2015 Orange. # 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 a...
#!/usr/bin/env python2 import tornado.ioloop import tornado.options import tornado.web import settings from handlers.RootHandler import * from handlers.ComicPageHandler import * from handlers.AdminRefreshHandler import * from handlers.AdminInfoHandler import * from handlers.common import * from tornado.options impo...
import flask import config import yelp_handler import json import requests slack_posturl = "https://slack.com/api/chat.postMessage" slack_reacturl = "https://slack.com/api/reactions.add" app = flask.Flask(__name__) class InvalidTokenException(Exception): pass @app.errorhandler(InvalidTokenException) def handle_...
from django.conf import settings from django.db import models from django.db.models.signals import pre_save from model_utils.models import TimeStampedModel from model_utils import Choices from labs.models import Lab _PICKVAL = 100 # TODO: Get minimum_groups from settings # TODO: Get maximum groups from settings cl...
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
__author__ = 'tommipor' from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Text, DateTime Base = declarative_base() class RehabilitationSetClass(Base): __tablename__ = 'RehabilitationSet' rehabilitationSetID = Column(String(255), primary_key=True) ...
import hashlib import os import logging from celery import shared_task from .models import File, Directory logger = logging.getLogger() @shared_task def scan_directory(root, type): """Walk through a directory and add files matching a certain pattern to the database.""" for path, dirs, files in os.walk(root)...
from gettext import gettext as _ import logging import sys from pymongo.errors import DuplicateKeyError from pulp.plugins.model import Unit, PublishReport from pulp.plugins.types import database as types_db from pulp.server.async.tasks import get_current_task_id from pulp.server.db.model.dispatch import TaskStatus fr...
# -*- encoding: utf-8 -*- # # Copyright © 2014-2015 eNovance # # Authors: Julien Danjou <julien@danjou.info> # # 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/lic...
############################################################################## # 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...
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.utils.timezone import now from django.conf import settings from django.core import validators from django.core.exceptions import ValidationError from django.db import connection from django.db.models import Q from dja...
#! /usr/bin/env python # Copyright 2020 John Hanley. # # 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, me...
__author__ = 'tinyms' #coding=UTF8 from sqlalchemy import Column, Integer, String, Text, LargeBinary, DateTime from tinyms.core.orm import Simplify, Entity, many_to_one, many_to_many #通知引擎处理节点 @many_to_one("BPMProcessInstance") class BPMWorkflow(Entity, Simplify): node_id = Column(Integer(), nullable=False) #行...
# Simplified BSD License, Copyright 2011 Al Sweigart import sys import os sys.path.append(os.path.abspath('..')) import pygcurse, pygame from pygame.locals import * win = pygcurse.PygcurseWindow(40, 25) win.autoblit = False xoffset = 1 yoffset = 1 mousex = mousey = 0 while True: for event in pygame.event.get(): #...
#!/usr/bin/python # coding: utf-8 import sqlite3 import json from horario import Horario # Handle hours and date from datetime import datetime, timedelta,date from datetime import time as tm from pytz import timezone import pytz import locale from time import time,localtime,strftime # This should be tied to a configura...
import sys import os import warnings import shutil import glob import logging from PyQt5.QtGui import (QIcon, QFont, QStandardItemModel, QPixmap) from PyQt5.QtCore import (QDate, QDateTime, QRegExp, QSortFilterProxyModel, Qt, QTime, QEvent, QSize) from PyQt5.QtWidgets import (qApp, QApplication, QCheckBox, Q...
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import torch import pyro import pyro.distributions as dist from pyro.contrib.gp.likelihoods.likelihood import Likelihood class Binary(Likelihood): """ Implementation of Binary likelihood, which is used for binary classi...
import unittest from pycoin.key.BIP32Node import BIP32Node from pycoin.serialize import h2b class Bip0032TestCase(unittest.TestCase): def test_vector_1(self): master = BIP32Node.from_master_secret(h2b("000102030405060708090a0b0c0d0e0f")) self.assertEqual( master.wallet_key(as_private=...
# -*- coding: utf-8 -*- """Scrapy Item Classes.""" # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy from conf.settings import MISSION_MESSAGE class SpinelleItem(scrapy.Item): """Class SpinelleItem start.""" # define ...
from django.core.management import BaseCommand from legalaid.models import ContactResearchMethod, PersonalDetails import uuid from cla_common.constants import RESEARCH_CONTACT_VIA class Command(BaseCommand): help = "Creates the contact for research methods default entities AND migrates data from contact_for_resea...
from django import forms from django.http import HttpResponse from django.views.decorators.http import require_POST from ajax_validation.utils import LazyEncoder def validate(request, *args, **kwargs): form_class = kwargs.pop('form_class') extra_args_func = kwargs.pop('callback', lambda request, *args, **kwar...
#TSTOP # #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 option) any later version. # #This program is distributed in the hope that it will be useful, ...
import tweepy import json from pymongo import Connection from bson import json_util from tweepy.utils import import_simplejson json = import_simplejson() mongocon = Connection() db = mongocon.twiter_data col = db.tweets_stream consumer_key = 'AYh6x5HIt5ubprSXeEGVqmLnT' consumer_secret = 'wx4wC2ttf3hS34iGPMeL6VAifwIZ...
from __future__ import print_function import time import logging import pprint import math import os import re import cPickle as pickle import sys import yaml import copy from collections import OrderedDict import numpy from lvsr.algorithms import BurnIn from blocks_extras.extensions.embed_ipython import EmbedIPython ...
#!/usr/bin/python -B # -*- coding: utf-8 -*- from __future__ import print_function import timeit import numpy as np from numpy_groupies.utils import aliasing from numpy_groupies import aggregate_py, aggregate_np, aggregate_ufunc from numpy_groupies.aggregate_pandas import aggregate as aggregate_pd def aggregate_gr...
#!/usr/bin/env/ python #Created: 10/14/2015 #Location: Notre Dame, Indiana import random import time rock = 1 paper = 2 scissors = 3 names = { rock: "Rock", paper: "Paper", scissors: "Scissors" } rules = { rock: scissors, paper: rock, scissors: paper } player_score = 0 computer_score = 0 def start(): global human...
# Copyright 2021 The Magenta 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 or agreed to in ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'uis/basic_sweep.ui' # # Created: Thu Nov 7 12:01:29 2013 # by: PyQt4 UI code generator 4.8.5 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except...
from distutils.core import Command from distutils.errors import DistutilsOptionError from coalib.misc.Constants import Constants class BuildDbusService(Command): """ Add a `build_dbus` command to your setup.py. To use this Command class add a command to call this class:: # For setuptools ...
from setuptools import setup, find_packages setup(name='valid_model', version='0.4.0', description="Generic data modeling and validation", long_description="""\ """, classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'P...
""" The Example is from http://darksky.slac.stanford.edu/scivis2015/examples.html """ from sdfpy import load_sdf from thingking import loadtxt prefix = "../data/" # Load N-body particles from a = 1.0 dataset. Particles have positions with # units of proper kpc, and velocities with units of km/s. particles = load_sdf...
"""Timezone helper functions. This module uses pytz when it's available and fallbacks when it isn't. """ from datetime import datetime, timedelta, tzinfo from threading import local import time as _time try: import pytz except ImportError: pytz = None from django.conf import settings __all__ = [ 'utc',...
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-12 08:39 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations...
# coding: utf-8 from cybosPlus.cpRqRp import StockChart.StockChart __author__ = 'lhw' if __name__ == '__main__': instance = StockChart() inputTypes = [StockChart.InputType.StockCode, StockChart.InputType.Gubun, StockChart.InputType.Number, ...
# -*- coding: utf-8 -*- ''' Saltify Module ============== The Saltify module is designed to install Salt on a remote machine, virtual or bare metal, using SSH. This module is useful for provisioning machines which are already installed, but not Salted. Use of this module requires some configuration in cloud profile a...
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
from django.conf.urls import url from django.views.generic import RedirectView from cl.simple_pages.sitemap import sitemap_maker from cl.simple_pages.views import ( tools_page, validate_for_google, validate_for_google2, validate_for_wot, validate_for_bing, robots, advanced_search, contact_thanks, contact, feed...
from nbconvert.preprocessors import ExecutePreprocessor, Preprocessor import numpy as np def jekyllurl(path): """ Take the filepath of an image output by the ExportOutputProcessor and convert it into a URL we can use with Jekyll """ return path.replace("../..", "") def svg_filter(svg_xml): "...
from os import makedirs from os.path import join, dirname import uuid class OutputManager: """Responsible for managing """ def __init__(self, output_settings, input_filename): self.__data_dir = output_settings.data_directory(input_filename) self.__data_dir_url = output_settings.data_dir_url(i...
# -*- coding: utf-8 -*- """ Asset management plugin for Pelican =================================== This plugin allows you to use the `webassets`_ module to manage assets such as CSS and JS files. The ASSET_URL is set to a relative url to honor Pelican's RELATIVE_URLS setting. This requires the use of SITEUR...
import os from template.test import TestCase, main class DirectoryTest(TestCase): def testDirectory(self): vars = { 'cwd': os.getcwd(), 'dir': 'test/dir', 'dot': '../..' } self.Expect(DATA, None, vars) # The final test is commented out, due to lack of VIEW support. DATA = r""" -...
""" 3-D variables: -------------- Instantaneous: ['U', 'V', 'OMEGA', 'T', 'QV', 'H'] Time-average: ['DUDTANA'] 2-D variables: -------------- Time-average surface fluxes: ['PRECTOT', 'EVAP', 'EFLUX', 'HFLUX', 'QLML', 'TLML'] Time-average vertically integrated fluxes: ['UFLXQV', 'VFLXQV', 'VFLXCPT', 'VFLXPHI'] Instan...
# coding: utf-8 import sqlite3 import datetime import requests from bs4 import BeautifulSoup def price(): r = requests.get("http://www.opinet.co.kr/user/main/mainLineChartAjax.do?DIV_CD=M&SIDO_CD=01&KNOC_PD_CD=B027") gas_today = r.json()['result']['chartData'][-1] r = requests.get("http://www.opinet.co....
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json from frappe import _dict import frappe.share from frappe.utils import cint from frappe.boot import get_allowed_reports from frappe.permissions import get_role...
import ddext from ddext import SD def init(): ddext.input('doc_id', 'text') ddext.input('sent_id_1', 'int') ddext.input('mention_id_1', 'text') ddext.input('wordidxs_1', 'int[]') ddext.input('words_1', 'text[]') ddext.input('entity_1', 'text') ddext.input('type_1', 'text') ddext.input('correct_1', 'bo...
# URL Filter for Log Monitor import urllib.parse import config import dbo import messaging import utils cacheable_params = None host_ignore_list = None url_ignore_pattern = None agent_ignore_pattern = None def load_cacheable_param(): global cacheable_params cacheable_params = dbo.load_string_list('cacheable...
__author__ = 'juliusskye' import os, sys sys.path.append('..') from py.Rectangle import Rectangle from py.CompareRectangles import CompareRectangles # things = [0,1,2,3,4,5] # for thing in things: # # if thing>2: # print(str(thing) + ' is greater than two') # break # else: 'no things greater t...
from __future__ import unicode_literals from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from .signals import message_sent from .utils import cached_attribute @py...
""" WSGI config for simpularity project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATIO...
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from typing import Any import pytest from datadog_checks.base.stubs.aggregator import AggregatorStub from .common import CHECK_CONFIG from .metrics import ALWAYS_PRESENT_METRICS, NOT_ALWAYS_PRESENT_METR...
# -*- coding: utf-8 -*- # Copyright 2014-2017 Nick Boultbee # # 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 # (at your option) any later version. import os...
## From http://svn.red-bean.com/restedit/trunk/source/process.py # process - Subprocesses with accessible I/O streams # # Copyright (c) 2003-2004 by Peter Astrand <astrand@lysator.liu.se> # # By obtaining, using, and/or copying this software and/or its # associated documentation, you agree that you have read, understo...
# 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/LICENSE-2.0 # # Unless requ...
''' This file is part of GEAR. GEAR is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distrib...
#!/usr/bin/env python from __future__ import print_function import logging import os import subprocess import textwrap import warnings from datetime import datetime import argparse from builtins import input from collections import namedtuple from dateutil.parser import parse as parsedate import json import airflow f...
import copy import numpy as np import numpy.random as rng import scipy.special from utils import randh from numba import jit # How many parameters are there? num_params = 4 # Some data data = np.loadtxt("road.txt") N = data.shape[0] # Number of data points # Plot the data import matplotlib.pyplot as plt plt.plot(dat...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4; encoding:utf-8 -*- # # Copyright 2014 Håvard Gulldahl # # in part based on dpbxbackend.py: # Copyright 2013 jno <jno@pisem.net> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU ...
# #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the...
import bpy import sys, os, configparser import math, time, json, pprint # Because this is being run inside blender, # the current folder is not in include path. sys.path.append(os.path.dirname(os.path.realpath(__file__))) from render_functions import * global ob global settings settings = {} model_id = sys.argv[-1] ...
# -*- coding: utf-8 -*- # Copyright (c) 2010-2017 Tuukka Turto # # 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,...
#!/usr/bin/env python # Copyright (c) 2007-8 Qtrac Ltd. All rights reserved. # This program or module 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 # version 3 of the Lice...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) class TaskError(Exc...
# -*- coding: utf-8 -*- """ Created on Mon May 16 19:07:30 2016 @author: root """ import cv2 import time from thread import start_new_thread class myVideoWriter: height = -1 width = -1 video = None camera = None capture_flag = False def init(self,cam_dev,filename): if len(fi...
import httplib import base64 import string class RESTResource(object): def __init__(self): self.status = None self.reason = None self.raw_data = None class RESTClient(object): """ Simple interface to the REST web services. Supports 'GET', 'PUT', 'POST' and 'DELETE' methods. T...
import logging import time import raven from celery import Celery from celery.utils.log import get_task_logger from raven.conf import setup_logging from raven.contrib.celery import register_signal, register_logger_signal from raven.handlers.logging import SentryHandler from isserviceup import managers from isserviceu...
# Copyright (c) 2010-2014, GEM Foundation. # # NRML 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 your option) any later version. # # NRML is distributed in t...