gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | |
# coding=utf-8
# device.py
# Author: Meghan Clark
# This file contains a Device object that exposes a high-level API for interacting
# with a LIFX device, and which caches some of the more persistent state attributes
# so that you don't always need to spam the light with packets.
#
# The Device object also provides the... | |
__author__ = 'Georgios Rizos (georgerizos@iti.gr)'
import argparse
import os
import numpy as np
from sklearn.multiclass import OneVsRestClassifier
from sklearn import svm
from reveal_user_classification.common import get_threads_number
from reveal_graph_embedding.datautil.score_rw_util import write_results
from revea... | |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from pandas.compat import range
import pandas as pd
from pandas import CategoricalIndex, Index, MultiIndex
import pandas.util.testing as tm
def assert_matching(actual, expected, check_dtype=False):
# avoid specifying internal representation
# as muc... | |
# coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... | |
#
# Updated: 22-Aug-2018
#
from PIL import Image
import os
import imghdr
from os import listdir
from os.path import isfile, join
import ntpath
import errno
def is_jpg(some_file):
result = False
if imghdr.what(some_file) == 'jpeg':
result = True
return result
def is_png(some_file):
result ... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Brandon Nielsen
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import unittest
import datetime
from aniso8601.time import get_time_resolution, parse_time, parse_datetime, \... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 (the "License"); you may
# not use this file except in compli... | |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from lettuce import *
import importlib
import workflow
import activity
@step('Given I have imported a settings module')
def import_settings_module(step):
imported = None
try:
import settings as settingsLib
world.settingsLib = settingsLib
imported = True
except:
imported = Fa... | |
#############################################################################
# Copyright 2016 Mass KonFuzion Games
#
# 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... | |
"""Test the TextClause and related constructs."""
from sqlalchemy import and_
from sqlalchemy import asc
from sqlalchemy import bindparam
from sqlalchemy import Column
from sqlalchemy import desc
from sqlalchemy import exc
from sqlalchemy import Float
from sqlalchemy import func
from sqlalchemy import Integer
from sql... | |
from __future__ import unicode_literals
import datetime
from operator import attrgetter
import sys
import unittest
from django.core.exceptions import ValidationError
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from django.utils.timezone import get_fixed_timezone
from django.db i... | |
#
# 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 us... | |
# Copyright 2014 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 agreed to in writing, s... | |
# Copyright 2014 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.
"""Android-specific implementation of the core backend interfaces.
See core/backends.py for more docs.
"""
import datetime
import glob
import hashlib
impor... | |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2020 Rapptz
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 u... | |
"""The test for the Ecobee thermostat module."""
import unittest
from unittest import mock
from homeassistant.components.ecobee import climate as ecobee
import homeassistant.const as const
from homeassistant.const import STATE_OFF
class TestEcobee(unittest.TestCase):
"""Tests for Ecobee climate."""
def setU... | |
# -*- coding: utf-8 -*-
"""Package tests."""
#
# (C) Pywikibot team, 2007-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
import os
import sys
import warnings
__all__ = ('requests', '_cache_dir', 'TestRequest',
'patc... | |
from __future__ import absolute_import, unicode_literals
import warnings
from mopidy.mpd import exceptions, protocol, translator
@protocol.commands.add('add')
def add(context, uri):
"""
*musicpd.org, current playlist section:*
``add {URI}``
Adds the file ``URI`` to the playlist (directorie... | |
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from cms.tests.test_menu_page_viewperm import ViewPermissionTests
__all__ = [
'ViewPermissionComplexMenuStaffNodeTests',
]
@override_settings(
CMS_PERMISSION=True,
CMS_PUBLIC_FOR='staff',
)
class ViewPermissio... | |
# Copyright (c) 2014 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
from datetime import timedelta
from django.conf import settings
from django.test import TestCase
from django.utils import timezone
from django.contrib.auth import get_user_model
from caffeine.forms import (
CoffeestatsRegistrationForm,
DUPLICATE_EMAIL_ERROR,
DUPLICATE_USER_ERROR,
EMPTY_TIMEZONE_ERROR,... | |
# -*- coding: utf-8 -*-
#
# Horizon documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 27 11:38:59 2011.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | |
import sys
from django.test import TestCase
from django.core.signals import got_request_exception
from django.http import HttpResponse
class TestException(Exception):
pass
# A middleware base class that tracks which methods have been called
class TestMiddleware(object):
def __init__(self):
self.pro... | |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
import numpy as np
from scipy.constants import mu_0, pi, epsilon_0
from scipy.special import erfc, erf
from SimPEG import Utils
# TODO:
# r = lambda dx, dy, dz: np.sqrt( ... | |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2015--, The WGS-HGT Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------... | |
import time, datetime
import sys
show_possible = False
misses = 0
if(len(sys.argv)<=3):
sys.exit("INVALID ARGUMENTS "+str(sys.argv))
#At minimum we require 4 arguments: 'score_finder.py', SCORE, X_COUNT, and SHOTS
else:
if(len(sys.argv)>4):
#Optional fifth argument shows permutations containin... | |
#! /usr/bin/env python
"""Work with api.yaml files from a BMI description."""
import os
import sys
import yaml
from .utils import cd, check_output
from .errors import (ParseError, MissingKeyError, UnknownKeyError,
MissingFileError)
# from . import build
from .utils import read_first_of
_API_FI... | |
import os
import stat
import inspect
import paramiko
from confiture.schema.containers import Value
from confiture.schema.types import String, Boolean
from marty.remotemethods import DefaultRemoteMethodSchema, RemoteMethod, RemoteOperationError
from marty.datastructures import Tree, Blob
# Monkey-patch Paramiko in o... | |
# package is named tests, not test, so it won't be confused with test in stdlib
from __future__ import print_function
import contextlib
import errno
import functools
import gc
import json
import os
try:
import resource
except ImportError:
resource = None
import signal
try:
import subprocess32 as subprocess... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Makes sure that files include headers from allowed directories.
Checks DEPS files in the source tree for rules, and applies tho... | |
from OCC.GProp import GProp_GProps
from OCC import BRepGProp
from OCC.Bnd import Bnd_Box
from OCC.BRepBndLib import brepbndlib_Add
import OCC.Quantity
from OCC.AIS import AIS_Shape
import OCC.Aspect
from geom import *
from util import Color
from copy import copy
class SliceBoundingBox(object):
def __init__(self, ... | |
# coding=utf-8
"""Decorators for ``cmd2`` commands"""
import argparse
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
List,
Optional,
Sequence,
Tuple,
Union,
)
from . import (
constants,
)
from .argparse_custom import (
Cmd2AttributeWrapper,
)
from .command_definiti... | |
import json
import logging
import requests
from urllib import urlencode
from django.conf import settings
from django.contrib.auth.views import logout as auth_logout
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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 t... | |
"""Support to the Logi Circle cameras."""
from datetime import timedelta
import logging
from homeassistant.components.camera import ATTR_ENTITY_ID, SUPPORT_ON_OFF, Camera
from homeassistant.components.ffmpeg import DATA_FFMPEG
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_BATTERY_CHARGING,
ATTR_... | |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import unittest
import numpy
import pytest
import cupy
import cupy._core._accelerator as _acc
from cupy._core import _cub_reduction
from cupy import testing
@testing.parameterize(*testing.product({
'order': ('C', 'F'),
}))
@testing.gpu
class TestArrayReduction(unittest.TestCase):
@testing.for_all_dtypes()
... | |
# Copyright (c) 2013 OpenStack Foundation
#
# 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 ... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""Builds objects representing a produced factorio item for templating."""
from __future__ import division
import math
from factorio import recipe
from factorio import production
from factorio import names
from appengine import icons
def get_wiki_url(username):
"""Constructs a URL refering to the factorio wik... | |
'''
Data Structures (data_class.py):
-------------------------------------------------------------------------------
Last updated 6/24/2015
This module defines data structures in order to keep track of firm data that
is categorized by NAICS codes.
Dealing with this data is made particularly difficult by the levels of
... | |
# Copyright 2019 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
# Copyright 2012 Josh Durgin
# Copyright 2013 Canonical Ltd.
# 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/LICENS... | |
#!/usr/bin/env python
from __future__ import print_function
import pyrax
import os
import time
import json
import sys
from jinja2 import Template
from docopt import docopt
USAGE = """Create a demo environment
Usage:
create-environment.py APP_NAME ENVIRONMENT
[--bootstrap_type=<t>]
... | |
"""
A simple torrent plugin based on torrentparse by Mohan Raj
This code is copied from:
https://github.com/mohanraj-r/torrentparse/blob/master/torrentparse/torrentparse.py
All terms will be respected when and if applied therefore this plugin
may only be temporary
"""
from yapsy.IPlugin import IPlugin
from StringIO... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python -ttB
"""
This contains valid functional tests for pytan.
These functional tests require a connection to a Tanium server in order to run.
The connection info is pulled from the SERVER_INFO dictionary in test/API_INFO.py.
These tests all use :mod:`ddt`, a package that provides for data driven test... | |
from lxml.builder import E
from jnpr.junos.utils.util import Util
from jnpr.junos.utils.start_shell import StartShell
from jnpr.junos.exception import RpcError
class FS(Util):
"""
Filesystem (FS) utilities:
* :meth:`cat`: show the contents of a file
* :meth:`checksum`: calculate file checksum (md5... | |
"""
Rank and spatial rank mobility measures.
"""
__author__ = "Sergio J. Rey <sjsrey@gmail.com>, Wei Kang <weikang9009@gmail.com>"
__all__ = [
"SpatialTau",
"Tau",
"Theta",
"Tau_Local",
"Tau_Local_Neighbor",
"Tau_Local_Neighborhood",
"Tau_Regional",
]
from scipy.stats.mstats import rankdat... | |
"""
Arguments:
:-p: project
:--copy-config: <target directory path>: copy configuration files to target directory path;
:--sum: <log file directory> create a summary of the results logged in the specified directory.
:-f: <file>: check a single file;
:-d: <directory>: check all the NetCDF files in a directory... | |
#!/usr/bin/env python3
# VagrIRC Virc library
# Written in 2015 by Daniel Oaks <daniel@danieloaks.net>
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warran... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name, pointless-statement
import pickle
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from astropy.utils import minversion
from astropy.modeling.core import Model, ModelDefiniti... | |
################################################################################
# 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... | |
#!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from mock import call
from diamond.collector import Collector
from... | |
# Copyright (c) 2008-2009 ITA Software, Inc.
# See LICENSE.txt for details.
"""Coil Parser"""
import os
import sys
from coil import tokenizer, struct, errors
class StructPrototype(struct.Struct):
"""A temporary struct used for parsing only.
This Struct tracks links and inheritance so they can be processed
... | |
# -*- coding: utf-8 -*-
"""
Control screen layout.
This modules allows you to handle your screens outputs directly from your bar!
- Detect and propose every possible screen combinations
- Switch between combinations using click events and mouse scroll
- Activate the screen or screen combination on a single... | |
# ===============================================================================
# Copyright 2015 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... | |
"""Backing implementation for InstallRequirement's various constructors
The idea here is that these formed a major chunk of InstallRequirement's size
so, moving them and support code dedicated to them outside of that class
helps creates for better understandability for the rest of the code.
These are meant to be used... | |
from tempfile import NamedTemporaryFile
import numpy
import pytest
import theano
from decorator import contextmanager
from lasagne.utils import floatX
from .data import DataSet, cifar, cifar_lee14, mnist, mnist_distractor, \
svhn, svhn_huang16
def identical_dataset(set1, set2, max_bs=500):
lenght = len(set1... | |
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
#
# Copyright (C) 2001,2003 greg Landrum and Rational Discovery LLC
#
""" unit tests for the QuantTree implementation """
from __future__ import print_function
import unittest
import io
from rdkit import RDConfig
from rdkit.ML.DecTree import BuildQuant... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import tempfile
from telemetry.core import exceptions
from telemetry.core import util
from telemetry import decorators
from telemetry.interna... | |
#!/usr/bin/python3
import math
import hashlib
import numpy as np
from typing import Any, Optional
from ..exceptions import StrandError, ChromosomeError, MissingLocusError
from .subloci import SubLoci
from .attrs import LocusAttrs
__all__ = ["Locus"]
class Locus:
def __init__(
self,
chromos... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import os, base64, re, json
import hashlib
import mimetypes
import io
from frappe.utils import get_hook_method, get_files_path, random_string, encode, cstr, call_hoo... | |
"""Provides methods to bootstrap a home assistant instance."""
import logging
import logging.handlers
import os
import shutil
import sys
from collections import defaultdict
from threading import RLock
import homeassistant.components as core_components
import homeassistant.components.group as group
import homeassistan... | |
# Copyright 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.
"""Configuration variable management for the cr tool.
This holds the classes that support the hierarchical variable management used
in the cr tool to provid... | |
import functools
import operator
try:
import simplejson as json
except ImportError:
import json
from flask import Blueprint
from flask import Response
from flask import abort
from flask import g
from flask import redirect
from flask import request
from flask import session
from flask import url_for
from peewee... | |
#!/usr/bin/env python
import os # For working with the file system
import urllib.request # For getting data from web pages
import sqlite3 # for data persistence
import pygame
import pygame.image
import datetime
import gzip
# A dictionary of the server names along with the download URL
# Could be automated for now, bu... | |
"""Support for Xiaomi Mi Flora BLE plant sensor."""
from datetime import timedelta
import logging
import btlewrap
from btlewrap import BluetoothBackendException
from miflora import miflora_poller # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from java.util import Collections, HashMap, HashSet, ArrayList, Arrays, Date
from org.oxauth.persistence.model.configuration import GluuConfiguration
from org.gluu.persist import PersistenceEntryManager
from java.nio.charset import Charset
from org.gluu.service.cdi.... | |
#!/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... | |
# Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O erro... | |
# -*- coding: 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):
# Changing field 'FilerImage.image'
db.alter_column('cmsplugin_filerimage', 'image_id', self.gf('django.db.... | |
#!/usr/bin/env python
"""
pyscanlogger: Simple port scan detector/logger tool, inspired
by scanlogd {http://www.openwall.com/scanlogd}
"""
import sys, os
import dpkt, pcap
import struct
import socket
import time
import threading
import optparse
# UDP - in progress...
SCAN_TIMEOUT = 5
WEIGHT_THRESHOLD = 25
PIDFILE... | |
#!/usr/bin/env python
#
# Copyright 2014 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 __future__ import print_function
import collections
import multiprocessing
import optparse
import os
import platform
import re
... | |
"""Tests for the Spotify config flow."""
from unittest.mock import patch
from spotipy import SpotifyException
from homeassistant import data_entry_flow, setup
from homeassistant.components.spotify.const import DOMAIN
from homeassistant.config_entries import SOURCE_REAUTH, SOURCE_USER, SOURCE_ZEROCONF
from homeassista... | |
__version__ = "1.6.1"
__license__ = "BSD"
__all__ = ['Scrubber', 'SelectiveScriptScrubber', 'ScrubberWarning', 'UnapprovedJavascript', 'urlize']
import re, string
from urlparse import urljoin
from itertools import chain
from BeautifulSoup import BeautifulSoup, Comment
def urlize(text, trim_url_limit=None, nofollow=Fa... | |
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
... | |
"""
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
"""
# Requires GDAL to use.
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.field import (
OFTDate, OFTDateTime, OFTInteger, ... | |
import numpy as np
from numpy import pi
import wave
import scipy
import scipy.io.wavfile
from scipy import signal
import matplotlib.pyplot as plt
import math
import pygame.sndarray
import time
import pyaudio
SAMPLING_RATE = 192000
SAMPLES_PER_MS = int(SAMPLING_RATE / 1000)
CARRIER_FREQ = 5000
CLOCK_MS = 100
NUM_BIT... | |
# Copyright 2010 http://www.collabq.com
# Copyright 2009 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 ... | |
# Copyright 2011 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... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import super
from builtins import range
from future import standard_library
standard_library.install_aliases()
import io
from .field ... | |
import pytest
import itertools
from backend.grid_manager import Cell, GridManager, StoreType
from backend.box import Box
# python -m pytest C:\Users\johny\PycharmProjects\grid-pair-management\tests\test_grid_manager.py
cell_init_data = [(StoreType.matrix, 42),
(StoreType.hashed, 123)]
# TODO: add o... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import datetime
from casexml.apps.case.models import CommCareCaseAction
from corehq.apps.reports.standard.cases.basic import CaseListReport
from corehq.apps.api.es import ReportCaseES
from corehq.apps.reports.generic import GenericTabularReport
from corehq.apps.reports.basic import BasicTabularReport, Column
from coreh... | |
import sys
class Node(object):
def children(self):
""" A sequence of all children that are Nodes
"""
pass
def show(self, buf=sys.stdout, offset=0, _my_node_name=None):
""" Pretty print the Node and all its attributes and
children (recursively) to a buffer.
... | |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Common customizations for all Unix-like operating systems other than Linux
"""
import sys,os,struct,socket,time
from... | |
from hail.typecheck import typecheck_method, sequenceof
from hail.utils import FatalError
class Call(object):
"""
An object that represents an individual's call at a genomic locus.
Parameters
----------
alleles : :obj:`list` of :obj:`int`
List of alleles that compose the call.
phased ... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Templates for constructing various sorts of invalid transactions.
These templates (or an iterator ove... | |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Linux specific functions.
"""
from __future__ import absolute_import
import sys,os,struct,socket,time
from select im... | |
"""
Test simple formatting of reST style docstrings
"""
import sys
import unittest
import pytest
from pydocstring.exc import FailedToGenerateDocstringError
from pydocstring import generate_docstring
class TestreSTFunctionAutocomplete(unittest.TestCase):
def test_params_args_kwargs(self):
method = \
... | |
from construct import OptionalGreedyRange, Sequence, StringAdapter, Peek
from construct import LengthValueAdapter, Struct, Switch, Container, IfThenElse
from construct import PascalString
from construct import MetaField, SBInt8, SBInt32, UBInt8, UBInt16
from construct import UBInt32, UBInt64
from twisted.internet impor... | |
# config.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Module containing module parser implementation able to properly read and write
configuration files"... | |
from __future__ import absolute_import
from collections import defaultdict
from itertools import izip_longest, repeat
import logging
import time
from threading import Lock
from multiprocessing import Process, Queue as MPQueue, Event, Value
from Queue import Empty, Queue
from kafka.common import (
ErrorMapping, Fe... | |
#MenuTitle: Set Kerning Groups (Lat-Grk-Cyr)
# -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
__doc__="""
(GUI) Sets kerning groups. Groups Latin Greek and Cyrillic together. I advise you use Split Cross-Script Kerning script later.
"""
import vanilla
import GlyphsApp
import re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.