src
stringlengths
721
1.04M
# Copyright 2016 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. import argparse import json import os import sys # This is the list of tests to run. It is a dictionary with the following # fields: # # name (required): Th...
from common_fixtures import * # NOQA import subprocess from subprocess import Popen from os import path import os import sys import pytest import cattle import ConfigParser PROJECTS = [] CERT = '''-----BEGIN CERTIFICATE----- MIIDJjCCAg4CCQDLCSjwGXM72TANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJB VTETMBEGA1UECBMKU29tZS1T...
""" NCP time data example. Connects to a node and requests a single time capture to be performed. Prints the result to stdout. """ import asyncio import ncplib # The node to connect to. Can be a DNS name or an IP address. NODE_HOST = "127.0.0.1" # Frequency. FREQ_HZ = 2400.12e6 # 2400.12 MHz # Realtime bandwidth....
import os import json from flask import request from fair.utility import text_to_html class CaseStorage(object): def get_case(self, view, method): raise NotImplementedError def save_case(self, api_path, method, param_mode, params, code): raise NotImplementedError def save_config(self, a...
# -*- coding: utf-8 -*- # # Copyright (C) 2012 Tommy Winther # http://tommy.winther.nu # # Modified for FTV Guide (09/2014 onwards) # by Thomas Geppert [bluezed] - bluezed.apps@gmail.com # # Modified for Stargate Guide (2016) # by wardoctor - wardoctor@tardisbuilds.com # # This Program is...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2014, Nigel Small # # 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...
# FYP2017 # Program to establish ZigBee communication between raspberry Pi and arduino # Complete control of HVAC elements based on commands sent from the Pi # Author: Kunal Jagadeesh # License: Public Domain import time import serial from ubidots import ApiClient one = 1 zero = 0 f = open('Ubidots_APIkey.txt', 'r')...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Copyright (c) 2016 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # MVF-Core """ Exercise the signature change (replay protectio...
#!/usr/bin/env python from optparse import OptionParser import collections import functools import os import pdb import sys import numpy as np import pandas as pd import h5py from google.cloud import bigquery import dash import dash_table as dt import dash.dependencies as dd import dash_core_components as dcc import...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import pytest import requests import tests.paths import lnk.bitly.command import lnk.config import lnk.errors VERSION = 3 API = 'https://api-ssl.bitly.com' with open(os.path.join(tests.paths.TEST_PATH, 'bitly', 'token')) as source: ACCESS_TOKEN = source.read(...
#!/usr/bin/env python # -*- coding: utf-8 -*- # External imports import numpy as np from sympy import sin from sympy import exp as e # Package imports from symodesys import SimpleFirstOrderODESystem from symodesys.convenience import numeric_vs_analytic """ Product of early morning flight, not a single one is workin...
""" Copyright (C) 2018 SunSpec Alliance 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, merg...
# -*- coding: utf-8 -*- """ Created on Wed Feb 24 12:30:06 2016 @author: xf05id1 """ from bluesky.callbacks import CallbackBase,LivePlot #import os #import time as ttime #from databroker import DataBroker as db, get_events #from databroker.databroker import fill_event import filestore.api as fsapi #from metadatasto...
####################################################################### # This file is part of JMdictDB. # Copyright (c) 2006-2012 Stuart McGraw # # JMdictDB 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...
""" Implementations of various common operations, like `show()` for displaying an array or with matplotlib, and `stats()` for computing min/max/avg. Most can handle a numpy array or `rasterio.Band()`. Primarily supports `$ rio insp`. """ from __future__ import absolute_import import code import collections import ...
import sys import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from pylab import * base = '../' sys.path.append(base+"utils/Correlation") sys.path.append(base+"utils/GLOBALutils") sys.path.append(base+"utils/OptExtract") sys.path.append(base+"...
import unittest import os import logging import re import shutil import datetime import oeqa.utils.ftools as ftools from oeqa.selftest.base import oeSelfTest from oeqa.utils.commands import runCmd, bitbake, get_bb_var class BitbakePrTests(oeSelfTest): def get_pr_version(self, package_name): pkgdata_dir =...
#!/usr/bin/env python """ ElectreTriClassAssignments - computes assignments according to the Electre TRI method. It generates separate outputs for the conjuctive ('pessimistic') and disjunctive ('optimistic') assignments. Usage: ElectreTriClassAssignments.py -i DIR -o DIR Options: -i DIR Specify input di...
#!/usr/bin/python3 # coding: utf-8 """ Register two Markdown extensions which replace <a href=""> and <img src=""> with {{ url_for('') }} and {{ resource('') }} placeholders which can be rewritten to absolute URLs and path to static resources. """ import markdown import markdown.inlinepatterns class UrlForEx...
# -*- coding: utf-8 -*- """Functions for handling geographical coordinate systems and reference ellipsoids. Unless otherwise stated functions are ported from atmlab-2-3-181. """ import numpy as np from typhon import constants __all__ = [ 'ellipsoidmodels', 'ellipsoid_r_geodetic', 'ellipsoid_r_geocentri...
import os from urllib.parse import urlparse from .asset import Asset from .assetbundle import AssetBundle class UnityEnvironment: def __init__(self, base_path=""): self.bundles = {} self.assets = {} self.base_path = base_path self.files = [] def __del__(self): for f in self.files: f.close() def __re...
# -*- coding: UTF-8 -*- # # Copyright 2015, John Mora, johmora12@engineer.com # Original Work by Lukas Lueg (c) 2008-2011. # # This file is part of Pyrit. # # Pyrit 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...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy import tensorflow as tf import tensorflow.contrib.slim as slim import time from tfutil import restore_latest, modified_dynamic_shape, quantizer, dequantizer, crappy_plot, draw_on, \ queue_app...
""" Test for user creation from sites with configuration overrides. """ import json import mock from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.test import TestCase from django.urls import reverse from common.djangoapps.student.models import UserSignupSour...
input = """ 1 1 1 1 63 1 1 1 1 64 1 1 2 0 65 66 1 1 2 0 67 68 1 1 2 0 69 70 1 1 2 0 71 72 1 1 2 0 66 65 1 1 2 0 68 67 1 1 2 0 70 69 1 1 2 0 72 71 1 81 1 1 66 1 82 1 1 65 1 83 1 1 68 1 84 1 1 67 1 85 1 1 70 1 86 1 1 69 1 87 1 1 72 1 88 1 1 71 1 89 1 1 66 1 90 1 1 68 1 91 1 1 67 1 92 1 1 69 1 93 2 1 68 81 1 94 1 0 81 1 9...
from os import environ import logging.config from apscheduler.schedulers.background import BackgroundScheduler from multiprocessing import cpu_count from subprocess import Popen logging.config.fileConfig('logging.conf') bind = "0.0.0.0:5000" workers = int(environ.get('WORKERS', cpu_count() * 8 + 1)) timeout = int(en...
__author__ = "Can Ozbek" import pandas as pd import numpy as np import pylab import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix import ml_aux_functions as ml_aux df = pd.read_csv("/Users/ahmetcanozbek/Desktop/EE660/660Project/Extracted_Data/featureMatrix.bin", header = 0, ...
# Copyright 2018 The Cirq Developers # # 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 ...
""" Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights ...
#!/usr/bin/python # InSpy - A LinkedIn employee enumerator # This script enumerates employees from any organization # using LinkedIn. Please note that this will not harvest all # employees within a given organization. # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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...
# -*- coding: utf-8 -*- """ Created on Wed Jul 03 23:01:44 2013 Author: Josef Perktold """ import numpy as np import matplotlib.pyplot as plt from statsmodels.tsa.arima_process import arma_generate_sample, ArmaProcess from statsmodels.miscmodels.tmodel import TArma from statsmodels.tsa.arima_model import ARMA from ...
import unittest import sys sys.path=['..'] + sys.path from Parser import Parser # code from module you're testing from DependsOn import * from Exceptions import * class SimpleTests(unittest.TestCase): def setUp(self): """Call before every test case.""" self.parser = Parser() self...
from __future__ import absolute_import from cStringIO import StringIO import os from kvkit import NotFoundError import ujson as json from werkzeug.datastructures import FileStorage from projecto.apiv1.files.models import File from .utils import ProjectTestCase, new_file, new_directory test_file = lambda filename: (...
from expipe_plugin_cinpla.imports import * from expipe_plugin_cinpla.tools import action as action_tools from expipe_plugin_cinpla.tools import config from datetime import timedelta def validate_depth(ctx, param, depth): try: out = [] for pos in depth: key, num, z, unit = pos.split(' ...
from unittest import TestCase, mock from day12 import Person, Student class TestDay12(TestCase): def test_student_a_person_subclass(self): self.assertTrue(issubclass(Student, Person)) def test_student_has_att_scores(self): student = Student("Sophia", "Fernandes", 201302, [90, 100, 100, 80]) ...
# -*- coding: utf-8 -*- # # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_DialogOptions(object): def setupUi(self, DialogOptions): DialogOptions.setObjectName("DialogOptions") DialogOptions.resize(696, 653) icon = QtGui.QIcon.fr...
# -*- coding: utf-8 -* # # Test links: # https://drive.google.com/file/d/0B6RNTe4ygItBQm15RnJiTmMyckU/view?pli=1 import re import urlparse from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.utils import html_unescape class GoogledriveCom(SimpleHoster): __name__ = "Goo...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # import unittest import os from ...workbook import Workbook from ..helperfunctions import _compare_xlsx_files class TestCompareXLSXFiles(unittest.TestC...
""" Tests: 1. Galaxies positions are all within the light-cone geometry 2. The number of Galaxies in Catalogue 0 matches the expected number (optional) 3. The galaxy ids are unique across all light-cones (optional) """ import logging from tao_validate import ValidateJob logger = logging.getLogger('detest.'+__name__)...
############################################################################# ## ## ## cpu_i386.py --- Classes for i386 CPUs ## ## see http://www.secdev.org/projects/shellforge/ ## ## ...
from django import forms from django.core.exceptions import ValidationError from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from custompayment.models import Addres...
import django.db.models.deletion import filer.fields.image from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("cms", "0013_urlconfrevision"), ("filer", "0003_thumbnailoption"), ] operations = [ migrations.CreateModel( nam...
#!/usr/bin/env python import pytest import networkx as nx from networkx.testing import assert_nodes_equal, assert_edges_equal, assert_graphs_equal from networkx.convert import (to_networkx_graph, to_dict_of_dicts, from_dict_of_dicts, ...
import os import json from typing import List, Union import numpy as np import appglobals import clr clr.AddReference("lib/ASCOM.DriverAccess") clr.AddReference("lib/ASCOM.Utilities") import ASCOM.DriverAccess import ASCOM.Utilities class Device: def __init__(self, device): self.device = None self...
from __future__ import print_function from builtins import zip import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def svd_1_golden(): print("Importing USArrests.csv data...") arrestsH2O = h2o.upload_file(pyunit_utils.locate("smalldata/pca_test/USArrests.csv")) print("Co...
import sys import os import numpy as np class file_handler: """ Public methods: __init__ file_iteration data_conversion runtime Class to get data from the SIMS output files. The data is collected in groups by the delimiters in the data file, e.g. **** DATA START*** contains all numerical data. Operatio...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import ( absolute_import, unicode_literals, ) import collections from enum import Enum import sys import yaml from ansible import constants as C from ansible.executor.task_queue_manager import TaskQueueManager from ansible.parsing.yaml.dumper imp...
from django import forms from django.utils.translation import ugettext_lazy as _ from django_countries.fields import CountryField from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from customer.models import Customer from bootstrap_modal_forms.forms import BSModalForm, BSModalModelForm...
''' (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2017 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. -----------------------------------...
from example_reader.graph_reader.edge_type_utils import EdgeTypeUtils from example_reader.graph_reader.graph import Graph import numpy as np class GraphConverter: hypergraph_interface = None edge_type_utils = None def __init__(self, hypergraph_interface): self.hypergraph_interface = hypergraph_in...
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
# coding: utf-8 from flask.ext.security import UserMixin, RoleMixin from config import BABEL_DEFAULT_LOCALE, BABEL_DEFAULT_TIMEZONE from david.core.mapper import add_kind from david.core.db import db, UidMixin from david.lib.mixins.props import PropsMixin, PropsItem from flask.ext.security import SQLAlchemyUserDatast...
#!/usr/bin/env python # Copyright 2014 Gaurav Kumar. Apache 2.0 # Extracts one best output for a set of files # The list of files in the conversations for which 1 best output has to be extracted # words.txt import os import sys def findTranscription(timeDetail): file1 = open('exp/tri5a/decode_callhome_dev/scori...
from django.db import models from django.contrib.auth.models import User from django.forms.models import model_to_dict from django.db.models.signals import post_save, pre_save import random import string from django.conf import settings import requests import json import logging log= logging.getLogger(__name__) class...
#!/usr/bin/python #------------------------------------------------------------------------------ # # Copyright 2011-2016 Andrew Lamoureux # # This file is a part of autils. # # autils is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fr...
# Part of Odoo. See LICENSE file for full copyright and licensing details. import ast from odoo import api, fields, models, _ class Job(models.Model): _name = "hr.job" _inherit = ["mail.alias.mixin", "hr.job"] _order = "state desc, name asc" @api.model def _default_address_id(self): ret...
import functools import inspect import random import re import string import pytest class CodeCollector: """Dedicated decorator to use functions as Py.Test function parameters.""" seen = set() def __init__(self, *names): self.names = names or ("code",) self.collected = [] def param...
import pkg_resources from tiget.cmds import Cmd from tiget.plugins import load_plugin, unload_plugin, reload_plugin, plugins __all__ = ['Load', 'Reload', 'Unload'] class Load(Cmd): description = 'load plugin' def setup(self): self.parser.add_argument('plugin_name', nargs='?') def do(self, arg...
from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.utils.decorators import method_decorator from django.views.generic import View from django.template import RequestContext, loader from models import Institution, Judge, Team, Venue from django.views.decorator...
# ###################################################################### # Developed at the NSLS-II, Brookhaven National Laboratory # # Developed by Sameera K. Abeykoon, February 2014 # # # # Copyright (c) 2014, Brookh...
from collections import namedtuple from functools import singledispatch import ctypes import enum import numpy as np from numba.core import types, utils, errors from numba.np import numpy_support # terminal color markup _termcolor = errors.termcolor() class Purpose(enum.Enum): # Value being typed is used as an ...
""" Tests for Discussion API internal interface """ from datetime import datetime, timedelta import itertools from urlparse import parse_qs, urlparse, urlunparse from urllib import urlencode import ddt import httpretty import mock from pytz import UTC from django.core.exceptions import ValidationError from django.htt...
from __future__ import print_function, division import os import numpy as np from astropy.io import fits from .exceptions import TableException from .helpers import smart_dtype, smart_mask from .decorators import auto_download_to_file, auto_fileobj_to_file standard_keys = ['XTENSION', 'NAXIS', 'NAXIS1', 'NAXIS2', ...
# Copyright 2012 OpenStack Foundation # Copyright 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/licenses/LIC...
from .keyboard import Keyboard from json import loads, dumps class Message: # Message클래스를 생성할 때 기본적인 틀만 구현하고 # 값들은 던져주면 알아서 메시지를 리턴한다 baseKeyboard = { "type": "buttons", "buttons": Keyboard.buttons, } baseMessage = { "message": { "text": "", }, ...
# Generated by YCM Generator at 2015-10-24 21:20:34.483150 # This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publis...
from django.test import TestCase from uri import generate_uri from statements import Annotation from annotation import add_resource_uri, SemanticAnnotationValidator, pre_process_annotation from exceptions import InvalidAnnotationError, InvalidResourceTypeError from vocab import neonion, OpenAnnotation from cms import C...
from cvxopt import matrix, blas, lapack from chompack.symbolic import cspmatrix from chompack.misc import frontal_add_update def llt(L): """ Supernodal multifrontal Cholesky product: .. math:: X = LL^T where :math:`L` is lower-triangular. On exit, the argument `L` contains the product :m...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Callable, Optional import torch import torch.nn as nn from fairseq import utils from fairseq.modules import LayerNorm, Mul...
#!/usr/bin/env python2 # Copyright (c) 2014 The Testcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indirectly) coi...
from __future__ import unicode_literals from . import __version__ as app_version app_name = "frappe" app_title = "Frappe Framework" app_publisher = "Frappe Technologies" app_description = "Full stack web framework with Python, Javascript, MariaDB, Redis, Node" app_icon = "octicon octicon-circuit-board" app_color = "o...
import os, sys import imp from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * constants = imp.load_source('modulename', 'constants.py') def get_customer_shipping_address(customerProfileId, customerAddressId): # Give merchant details merchantAuth = apicontractsv1.merchantAuthentic...
from Player import Player import numpy class Connect4_Human(Player): def __init__(self,value): self.value = value #end def init() ''' ''' def value(self): return self.value #end def value() ''' ''' def DetermineMove(self, board): ##### ...
"""Provides method for efficiently counting events in a region. """ # System imports from uuid import uuid4 # owls-cache imports from owls_cache.persistent import cached as persistently_cached # owls-parallel imports from owls_parallel import parallelized # owls-hep imports from owls_hep.calculation import Calculat...
from django.shortcuts import render, redirect from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.forms.models import model_to_dict from userprofile.models import UserProfile from userprofile.forms import EditUserForm, EditUserProfileForm @login_required ...
#!/usr/bin/env python # -*- coding:utf-8 -*- ######################################################## # ITE command start with: #// # ITE command keywords:quit,exit,byebye,bye, begin, end, # verbose, concise, dump_project, dump_make_file, dump_cpp, # dump_fragment,load_fragment, compile, run, edit # ##################...
# This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. from ..model import ModelView, ModelSQL, fields, EvalEnvironment, Check from ..transaction import Transaction from ..cache import Cache from ..pool import Pool from .. import b...
# 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 use ...
# 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) import shutil import...
from core.himesis import Himesis import uuid class HMapPartition(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule MapPartition. """ # Flag this instance as compiled now self.is_compiled = True super(HMapPa...
# 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 ...
# audacious now playing for weechat # nashgul <m.alcocer1978@gmail.com> # version 0.1 # white => "00", black => "01", darkblue => "02", darkgreen => "03", lightred => "04", darkred => "05", magenta => "06", orange => "07", yellow => "08", lightgreen => "09", cyan => "10", lightcyan => "11", lightblue => "12", lightmag...
# -*- coding: utf-8 -*- ##Copyright (C) [2005] [Jürgen Hamel, D-32584 Löhne] ##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 versi...
# Copyright (c) 2013 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. from measurements import page_cycler from telemetry import test class PageCyclerBloat(test.Test): test = page_cycler.PageCycler page_set = 'page_se...
from __future__ import unicode_literals import functools import tablib import traceback from copy import deepcopy from diff_match_patch import diff_match_patch from django import VERSION from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.color import ...
from typing import Any from argparse import ArgumentParser from zerver.models import all_realm_filters from zerver.lib.actions import do_add_realm_filter, do_remove_realm_filter from zerver.lib.management import ZulipBaseCommand import sys class Command(ZulipBaseCommand): help = """Create a link filter rule for...
""" Provide sane Matlab-like functions """ # Import NumPy because we're building on some of its functions. import numpy as _np # Function to give length regardless of the damn type. def numel(x): """ Give number of elements in a variable without being ridiculously dependent on the type. Ever wanted to kn...
from fractions import Fraction import sys # this program explores patterns of pythagorean triples # in the stern brocot tree... or more specifically, # the stern diamotic sequence, aka the 'denominators' of the # stern brocot sequence aka, the farey sequence denominators # aka 2*sqrt(radius) of the ford circles # it...
# -*- coding: utf-8 -*- import multiprocessing import os import re import platform from six import print_ import six import string import sys from tomahawk import ( __version__, TimeoutError, ) from tomahawk.color import ( create_coloring_object ) from tomahawk.constants import ( DEFAULT_TIMEOUT, D...
# -*- coding: utf-8 -*- ''' Control of SSH known_hosts entries ================================== Manage the information stored in the known_hosts files. .. code-block:: yaml github.com: ssh_known_hosts: - present - user: root - fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df...
#!/usr/bin/env python # -*- coding: utf-8 -*- #avg 110,429166666667 142,303939393939 39,4660202129861 17,303315566334 358,067727272727 145,667575757576 39,0507475838317 18,0599499387257 607,147575757576 146,828787878788 39,4196129733035 17,4218484639878 854,394393939394 146,564696969697 38,...
# -*- coding: utf-8 -*- import re import urlparse from channels import filtertools from channelselector import get_thumb from core import httptools from core import scrapertoolsV2 from core import servertools from core.item import Item from platformcode import config, logger from channels import autoplay HOST = "h...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models imp...
import rospy from tf2_geometry_msgs import PoseStamped from geometry_msgs.msg import Point from dynamic_stack_decider.abstract_action_element import AbstractActionElement class GoToRolePosition(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(GoToRolePosition, self).__i...
# coding: utf-8 from __future__ import unicode_literals import itertools import re import random import json from .common import InfoExtractor from ..compat import ( compat_kwargs, compat_parse_qs, compat_str, compat_urllib_parse_urlencode, compat_urllib_parse_urlparse, ) from ..utils import ( clean_html, Extr...
from pytest import fixture import os from knittingpattern.InstructionLibrary import InstructionLibrary @fixture def lib(): return InstructionLibrary() def test_load_from_relative_file(lib): relative_path = "test_instructions/test_instruction_1.json" lib.load.relative_file(__file__, relative_path) as...
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2017-10-04 12:30 from __future__ import unicode_literals import json import os from django.db import migrations, models def _get_measure_data(measure_id): fpath = os.path.dirname(__file__) fname = os.path.join( fpath, ("../management/comma...
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-03-16 19:55 # flake8: noqa from __future__ import unicode_literals from django.db import migrations def multiple_to_single(apps, schema_editor): """ Take the first action in a recipe and set it as the single action. """ Recipe = apps.get_model...
# Copyright 2014 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...