src stringlengths 721 1.04M |
|---|
#!/usr/bin/python
from time import sleep
from pyfirmata import Arduino, util
from images2gif import writeGif
from SimpleCV import *
pyrinter_url = "http://localhost:8080/printtext/"
flickr_user = "foo"
flickr_tags = "ingenuitas"
animation_file = "./animation.gif"
c = Camera()
board = Arduino("/dev/ttyUSB0")
it = u... |
"""
Image stabilization code.
"""
import argparse
import cv2
import uscpy.sequence
import uscpy.frame
import uscpy.video
parser = argparse.ArgumentParser(description="Perform image stabalization to a video")
parser.add_argument("input", help="input video path")
parser.add_argument("output", help="output video path")... |
# Xlib.xobject.drawable -- drawable objects (window and pixmap)
#
# Copyright (C) 2000 Peter Liljenberg <petli@ctrl-c.liu.se>
#
# This library 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 v... |
#! /usr/bin/env python
"""
usage:
bam coverage <bam> [options] [--mtchr=<mtchr>]
bam coverage <bam> [options] <chrom:start-end>...
bam coverage <bam> [options] --window=<size>
bam coverage <bam> [options] --regions=<gff/bed>
options:
-h --help Show this screen.
--version ... |
from insights.combiners.virt_who_conf import AllVirtWhoConf
from insights.parsers.virt_who_conf import VirtWhoConf
from insights.parsers.sysconfig import VirtWhoSysconfig
from insights.tests import context_wrap
VWHO_D_CONF_ESX = """
## This is a template for virt-who configuration files. Please see
## virt-who-config(... |
# Copyright 2013 - Mirantis, Inc.
# Copyright 2015 - StackStorm, Inc.
# Copyright 2015 Huawei Technologies Co., Ltd.
# Copyright 2016 - Brocade Communications Systems, Inc.
# Copyright 2018 - Extreme Networks, Inc.
# Copyright 2019 - NetCracker Technology Corp.
#
# Licensed under the Apache License, Version 2.0 (the... |
import pygame
import random
from configuraciones import *
from bloque import *
if __name__ =='__main__':
pygame.init()
pantalla=pygame.display.set_mode([ANCHO, ALTO])
pygame.display.flip()
reloj = pygame.time.Clock()
fin = False
general = pygame.sprite.Group()
bloques = pygame.spri... |
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 0.5, s, t 1, s, t 1.5, s, t 2.1, s, q"
tags = "FadeBLTransition"
import cocos
from cocos.director import director
from cocos.act... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Elepe Servicios (http://www.elepeservicios.com.ar)
# All Rights Reserved
#
# Author : Dario Kevin De Giacomo (Elepe Servicios)
#
# This program is free software: you can redistribute it ... |
JSON_UPDATE_NODES_SQL = """
SELECT json_agg(
json_build_object(
'_type', CASE
WHEN N.type = 'osf.registration'
THEN 'registration'
WHEN PREPRINT.URL IS NOT NULL
THEN 'preprint'
WHEN PARENT_GUID._id IS NULL
... |
import os
import unittest
from vsg.rules import generate
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_001_test_input.vhd'))
dIndentMap = utils.read_indent_file()
lExpected = []
lExpected.append('')... |
"""
A simple program that sends/listens broadcast packets through UDP socket
Used to test the system if it is able to send/receive packets
"""
import time, math, sys, socket, threading, select, uuid
from collections import namedtuple
import cPickle as pickle
from params import Params
MAX_STAY = 5 #seconds until entry... |
#!/bin/env python
from __future__ import print_function
import sys
import os
import datetime
import string
import ctypes
from .. import toggles
from .. import mbusTime
from ... import mbus
MAX_ARRAY_SIZE = 32
MBUS_LOW_TOO_LONG_CODE = 16
MBUS_TIMEOUT_CODE = 17
MBUS_END_MSG_CODE = 18
def nibbleSeq2Str(nibbleSeq):
... |
# 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 flt, cint
from erpnext.accounts.report.financial_statements import (get_period_list, get_col... |
# Copyright (C) 1999--2002 Joel Rosdahl
#
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This library is ... |
#!/usr/bin/env python
# encoding: utf-8
# Copyright Garmin International or its subsidiaries, 2012-2013
'''
Off-load dependency scanning from Python code to MSVC compiler
This tool is safe to load in any environment; it will only activate the
MSVC exploits when it finds that a particular taskgen uses MSVC to
compile.... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 12 14:41:27 2016
@author: Perk
"""
import requests
import json
from progressbar import ProgressBar
pbar = ProgressBar()
with open('sunlight API.txt','r') as api_file:
api_key = api_file.read()
dem_word_lst = []
rep_word_lst = []
phrase_url='http://capito... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 The HyperSpyUI developers
#
# This file is part of HyperSpyUI.
#
# HyperSpyUI 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
#... |
# -*- coding: utf-8 -*-
import os, sys, csv
def get_order_list(order_file: str) -> [] :
order_list = []
with open(order_file, "r") as csv_input:
reader = csv.reader(csv_input)
for row in reader:
order_list.append(row[0])
return order_list
def save_report(data: [], order_id: s... |
# Copyright 2011 OpenStack, 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 agreed... |
import logging
from django.conf import settings
from django.db import connection, transaction
from django.utils import timezone
from pontoon.administration.vcs import CommitToRepositoryException
from pontoon.base.models import ChangedEntityLocale, Project, Repository
from pontoon.base.tasks import PontoonTask
from po... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Sebastian Wiesner <lunaryorn@googlemail.com>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above... |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... |
"""
tests for facets
"""
import unittest
from flask_testing import LiveServerTestCase
import mock
from holmium.core import Page, Element, Locators, Elements, Section, ElementMap
from holmium.core.facets import FacetError, defer, title, cookie, strict
from holmium.core.pageobject import NonexistentElement
from . impor... |
from collections import namedtuple
from enum import Enum
from pathlib import Path
from aqt import mw
from ..utils.constants import USER_FILES_PATH
ConfigEntry = namedtuple("ConfigEntry", ["config_name", "default_value"])
class NoteSortingMethods(Enum):
FIELD1 = "field1"
FIELD2 = "field2"
NO_SORTING = "no... |
import logging
from ..sim_procedure import SimProcedure
l = logging.getLogger("angr.analyses.datagraph_meta")
class DataGraphMeta(object):
def __init__(self):
self._p = None
def _irsb(self, in_state):
"""
We expect a VSA state here.
"""
return self._p.factory.success... |
from unittest import mock
import pytest
from aiohttp import errors, parsers
@pytest.fixture
def stream():
return mock.Mock()
@pytest.fixture
def buf():
return parsers.ParserBuffer()
def test_feed_data(buf):
buf.feed_data(b'')
assert len(buf) == 0
buf.feed_data(b'data')
assert len(buf) =... |
"""hbussd general purpose constants."""
from hbussd.hbus.command import HbusCommand
# HBUS security key size in bytes
# @todo Make this useful
HBUS_PUBKEY_SIZE = 192
# HBUS authentication key size in bytes
#
# This size is 192 but it is followed by another byte, e/f/r (193 bytes)
HBUS_SIGNATURE_SIZE = 192
# @defgrou... |
##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2014, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... |
import subprocess, os, sys
class Proposal(object):
def __init__(self, name="", _type=None):
super(Proposal, self).__init__()
self.name = name
self.type = _type
def __repr__(self):
t_string = self.type if self.type else "NoType"
return t_string+": "+self.name
def _filter_and_to_dict(out_line... |
from copy import deepcopy
import unittest
from tests import common
from romaine.parser.exceptions import (
MalformedTableError,
)
class TestExamplesParser(unittest.TestCase):
"""
Test examples gherkin parser functionality of romaine's core.
"""
def setUp(self):
"""
Prepare... |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 ... |
#!/usr/bin/env python3
# Author: Emmanuel Odeke <odeke@ualberta.ca>
# Case insensitive dictionary implementation
def noop(*args, **kwargs):
raise ValueError('noop for this method')
def is_callable_attr(obj, attr):
retr = getattr(obj, attr, None)
if retr is None:
return False
return hasattr(ret... |
# This file is part of gpycomplete.
# gpycomplete 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.
# gpycomplete is distributed in the... |
# -----------------------------------------------------------------------------
# Module: dpa.user.tests.test_user
# Author: Josh Tomlinson (jtomlin)
# -----------------------------------------------------------------------------
"""Unit tests for dpa users."""
# ------------------------------------------------------... |
"""Representation of Analysis."""
import logging
import requests
from cosmosid.api.files import Runs
from cosmosid.helpers.exceptions import (AuthenticationFailed,
CosmosidException,
NotFoundException)
LOGGER = logging.getLogger(__name_... |
#=======================================================================
__version__ = '''0.1.00'''
__sub_version__ = '''20080920022138'''
__copyright__ = '''(c) Alex A. Naanou 2003-2007'''
#-----------------------------------------------------------------------
__doc__ = '''
this module is to document the ... |
#!/usr/bin/env python
#
# Easy Profiler
# Copyright (C) 2015 Larroque Stephen
#
# Licensed under the MIT License (MIT)
#
# 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, i... |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
import random
import mm
import thing
import biome_land_do
import tp
import game
def biome_build(self, seed=0):
while True:
random.seed(self.biome_seed)
self.biome_seed += 1
self.biome_seed *= self.biome_seed
self.biome = biome_land_do.Biome(chunk=self)
if not self.biome... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
# -*- coding: utf-8 -*-
from pybythec import utils
from pybythec.utils import f
from pybythec.utils import PybythecError
from pybythec.BuildStatus import BuildStatus
from pybythec.BuildElements import BuildElements
import os
import sys
import time
from threading import Thread
log = utils.Logger('pybythec')
__author_... |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
from .bitmovin_object import BitmovinObject
from .rest import BitmovinHttpClient
from .services import InputService, OutputService, FilterService, CodecConfigurationService, EncodingService, \
ManifestService, InfrastructureService, AnalyticsService
class Bitmovin(BitmovinObject):
def __init__(self, api_key, ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
import django.core.validators
import bible.djangoforms
class Migration(migrations.Migration):
dependencies = [
... |
from __future__ import print_function
from sys import argv, exit, stderr
from os import mkdir, makedirs, chdir, system, getcwd
from os.path import getsize
from re import search
from json import loads
from struct import pack
from errno import EEXIST
if len(argv) < 5:
print("Usage: bundle.py <info json> <assembly f... |
# -*- coding: utf-8 -*-
# Copyright (C) 2005 Osmo Salomaa
#
# 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 pr... |
# Copyright 2006-2012 Mark Diekhans
# Copyright sebsauvage.net
"""
Code from:
http://sebsauvage.net/python/snyppets/index.html#dbdict
A dictionnary-like object for LARGE datasets
Python dictionnaries are very efficient objects for fast data access. But when data is too large to fit in memory, you're in trouble.
Here'... |
#
# PySTDF - The Pythonic STDF Parser
# Copyright (C) 2006 Casey Marshall
#
# 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 versi... |
# -*- 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
# May you do good and not evil
# May you find forgiveness for yourself and forgive others
# May you share freely, never taking more than you give. -- SQLite source code
#
# As we enjoy great advantages from the inventions of others, we should be glad
# of an opportunity to serve others by an invention... |
from __future__ import absolute_import
import unittest
from jnius import autoclass, protocol_map
class TestCollections(unittest.TestCase):
def test_hashset(self):
hset = autoclass('java.util.HashSet')()
data = {1,2}
# add is in both Python and Java
for k in data:
hset.... |
import neurolab as nl
import game2
import othello
import ntuplesystematic as nts
import time
import random
class nn:
def __init__(self):
self.x = [[-1,1] for x in range(64)]
self.net = nl.net.newff(self.x,[1])
#self.net.trainf = nl.train.train_gd
self.moveb = 0
self.movew = 0
self.last_vb = 0
self.last... |
from datetime import timedelta
import operator
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs import IncompatibleFrequency
import pandas as pd
from pandas import Categorical, Index, Series, bdate_range, date_range, isna
import pandas._testing as tm
from pandas.core import nanops, ops
def _pe... |
import re
from gourmet import check_encodings
from gourmet.gdebug import debug
from gourmet.i18n import _
from gourmet.importers import importer
class TextImporter (importer.Importer):
ATTR_DICT = {'Recipe By':'source',
'Serving Size':'servings',
'Preparation Time':'preptime',
... |
from django.contrib import admin
from django.urls import include, re_path
from django.utils.translation import gettext_lazy as _
from munigeo.api import all_views as munigeo_views
from rest_framework import routers
from observations.api import views as observations_views
from observations.views import obtain_auth_toke... |
#! /usr/bin/env python
# MailTask Alpha: The Email Manager
# Copyright (C) 2015 Patrick Simmons
# 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 ... |
#!/usr/bin/python
#
# Copyright 2015 John Kendrick
#
# This file is part of PDielec
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied wa... |
# Copyright (C) 2015 Google Inc.
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd is di... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... |
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
fr... |
import unittest
import os
from py_compile import compile
import sys
import random
import tempfile
from filecmp import cmp
import rsa.randnum
from hashlib import md5
import Cryptodome.Cipher.AES as AES
import warnings
from itertools import chain
import hashlib
key = b'\x91^\x86\x91`\xae\xb3n4\xf8\xca\xf1\x90iT\xc2\xb6`... |
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.db.models import aggregates
from django.db.backends.mysql.operations imp... |
import os
from lxml import html as lh
from queue import Queue
from urllib.parse import urlparse
from threading import Thread
import requests
import threading
from requests import get
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning... |
import gocept.testing.assertion
import zeit.cms.testing
import zeit.magazin.testing
class ZMOPortraitboxCRUD(zeit.cms.testing.BrowserTestCase,
gocept.testing.assertion.String):
layer = zeit.magazin.testing.LAYER
def test_zmo_portraitbox_has_longtext_field(self):
b = self.bro... |
import hrl
import pygame as pg
from pygame.locals import *
from OpenGL.GL import *
from patterns import *
from random import shuffle,randint
ntls = 4
wdth = 1024
hght = 766
def circle(y,ptch):
y = np.mod(y,2) - 1
x = np.sin(-np.pi * y)/2 + 0.5
y = np.abs(y)
return np.round((wdth-ptch.wd... |
# -*- coding: utf-8 -*-
# Example init.py for documentation purposes
#
# Use this file as a template/example for creating an
# initialization/configuration script for PyCmd. Scripts are loaded and applied
# based on the following rules:
#
# * If present, an init.py script in PyCmd's installation directory is
# auto... |
from datetime import datetime
import decimal
__author__ = 'drblez'
"""
Field('f1', 'value1').field('f2', 'value2').field('f3', 42).field('f4', ['a', 'b', 'c']).field('f5', [1, 2, 3]).dict
{
'f1': {'S': 'value1'),
'f2': {'S': 'value2'},
'f3': {'N': '42'},
'f4': {'SS': ['a', 'b... |
# 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
import shutil
from pathlib import Path
from quodlibet import ... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... |
import sys
import argparse
import numpy as np
import pandas as pd
import configparser
def compute_splitID(y, split_fields):
"""
Map tuples in columns designated by **split_fields** into integer ID to use for data partitioning.
:param y: ``pandas`` ``DataFrame``; response data.
:param split_fields: ``l... |
"""Visualization helpers."""
from contextlib import contextmanager
import copy
import os.path as op
import numpy as np
from scipy import linalg
from mne import read_proj, read_events, pick_types
from mne.utils import verbose
from mne.viz.utils import tight_layout, plt_show
from ._sss import compute_good_coils
from ... |
# coding=utf-8
"""
Pinyto cloud - A secure cloud database for your personal data
Copyright (C) 2105 Johannes Merkert <jonny@pinyto.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3... |
# -*- coding: utf-8 -*-
"""
Classe for reading data from pCLAMP and AxoScope
files (.abf version 1 and 2), developed by Molecular device/Axon technologies.
- abf = Axon binary file
- atf is a text file based format from axon that could be
read by AsciiIO (but this file is less efficient.)
This code is ... |
from basics import BaseAttachment
class OOCComands(BaseAttachment):
character = False
def __init__(self, character):
self.character = character
self.action_matrix = [
["help", self.do_help,
"Open the help screen, or receive help on a specific command. \
... |
"""
Make requests for tiles at given zoom levels to fill the tilecache.
"""
from django.core.management.base import BaseCommand
from django.conf import settings
from ...models import RasterAggregatedLayer
WGS84_SRID = settings.WGS84_SRID
def request_layer_tiles(layer_url, layer, zoom):
"""
Request tiles for g... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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; either version 2 of the
# License, or (at your option) any later... |
from __future__ import absolute_import
import six
from sentry import tagstore
from sentry.testutils import APITestCase
class GroupEventsTest(APITestCase):
def test_simple(self):
self.login_as(user=self.user)
group = self.create_group()
event_1 = self.create_event('a' * 32, group=group)
... |
from ibis.impala.client import (ImpalaConnection, # noqa: F401
ImpalaClient,
ImpalaDatabase,
ImpalaTable)
from ibis.impala.compiler import dialect # noqa: F401
from ibis.impala.udf import * # noqa: F401,F403
from ibis.con... |
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
'''
:copyright (c) 2014 Xavier Bruhiere.
:license: MIT, see LICENSE for more details.
'''
import os
import abc
import click
class Cli(object):
'''
Convenient wrapper around UI interface boilerplate.
Make the app prettier and more robust.
'''
__metacl... |
# -*- 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 -*-
# Copyright (c) 2020 shmilee
import os
import unittest
import tempfile
import zipfile
ZIPFILE = os.path.join(os.path.dirname(__file__), 'raw.zip')
@unittest.skipUnless(zipfile.is_zipfile(ZIPFILE),
"'%s' is not a tar archive!" % ZIPFILE)
class TestZipRawLoader(unittest.T... |
from mitxmako.shortcuts import render_to_response
import xmltodict
from django.http import HttpResponse
import json
from django.conf import settings
from collections import defaultdict
import os
from OpenSSL import crypto
import re
from path import path
from permissions.decorators import user_has_perms
BASEDIR = setti... |
""" Cisco_IOS_XR_ipv4_acl_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR ipv4\-acl package configuration.
This module contains definitions
for the following management objects\:
ipv4\-acl\-and\-prefix\-list\: IPv4 ACL configuration data
Copyright (c) 2013\-2015 by Cisco Systems, Inc.
... |
# -*- coding: utf-8 -*-
"""
Created by jiaojian at 2018/6/29 16:30
"""
import os
import sys
import termios
from tools.utils.basic_printer import print_with_style, ConsoleColor
HOME = os.environ['HOME']
def get_input():
fd = sys.stdin.fileno()
old_tty_info = termios.tcgetattr(fd)
new_tty_info = old_tty_inf... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing M2M table for field project on 'New'
db.delete_table('news_new_project')
# Adding M2M ... |
import copy
import re
import glob
import numpy as np
from numpy.core import defchararray
from scipy.interpolate import RegularGridInterpolator
from astropy.io import fits
from astropy.table import Table, Column
def stack_files(files, outfile, new_cols=None):
h = fits.open(files[0])
tables = []
for hdu i... |
# * *************************************************************
# *
# * Soft Active Mater on Surfaces (SAMoS)
# *
# * Author: Rastko Sknepnek
# *
# * Division of Physics
# * School of Engineering, Physics and Mathematics
# * University of Dundee
# *
# * (c) 2013, 2014
# *
# * School of Science and Engin... |
#!/usr/bin/env python
import sys, os
from itertools import chain
# d is a pandas.DataFrame
def printTable(d, sep = ' ', outFile = sys.stderr):
cols = d.columns
col_widths = list(max(len(str(elem)) for elem in chain(d[col], [col])) for col in cols)
print >> sys.stderr, ' '.join('{value:>{width}}'.format(... |
'''
Currently contains W3C XML test suite
@author: Michael Eddington
@version: $Id: xmlstuff.py 2576 2011-11-10 01:28:11Z egriko $
'''
#
# Copyright (c) 2006-2008 Michael Eddington
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files ... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
from typing import Optional, Callable
from rx import to_async
from rx.core import Observable
from rx.core.typing import Scheduler
def _start(func: Callable, scheduler: Optional[Scheduler] = None) -> Observable:
"""Invokes the specified function asynchronously on the specified
scheduler, surfacing the result t... |
# 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 2013 Jake Ross
#
# 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... |
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
import re
import os
import tempfile
import unittest
import mock
import flask
from bs4 import BeautifulSoup
try:
import caffe_pb2
except ImportError:
# See issue #32
from caffe.proto import caffe_pb2
from digits.config import config_value... |
from __future__ import absolute_import
from __future__ import print_function
import sys
from copy import copy, deepcopy
import numpy as np
#import matplotlib.pyplot as plt
import pandas as pd
pd.set_option('display.width', 1000)
pd.set_option('display.max_rows', 1000)
from signals import *
def find_all_signals... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Generate an elevation chart from a GPX file."""
import gpxpy
import logging
import sys
from math import sin, cos, sqrt, atan2, radians
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',
level=logging.DEBUG,
stre... |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015,2016 Daniel Rodriguez
#
# Licensed under the GPLv3+ License
#
###############################################################################
from __fu... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
# Copyright (c) 2009 Jendrik Seipp
#
# RedNotebook 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 vers... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.