gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import numpy as np
import csv, itertools
# This was copied from my water_correction project to the AccAssess plugin
# project on 23 January 2013. Knowing that may be useful later on. ...but
# probably not.
#### TEST DATA ####------------------------------------------------------------------------
def congalton_table... | |
from django.urls import path
from extras.views import ObjectChangeLogView, ImageAttachmentEditView
from ipam.views import ServiceCreateView
from secrets.views import secret_add
from . import views
from .models import (
Cable, ConsolePort, ConsoleServerPort, Device, DeviceRole, DeviceType, FrontPort, Interface, Man... | |
import ast
from ast import *
from collections.abc import Iterable
from .astalyzer import FreeVarFinder
from ..base import LanguageNode, ComplexNode, BaseGenerator
from ...helpers import StringWithLocation
from ...runtime.debug import TemplateSyntaxError
import sys
try: # pragma: no cover
import sysconfig
... | |
# -*- coding: utf-8 -*-
"""
Dialogs and classes for editting element properties.
@author: Chris Scott
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import logging
from PySide2 import QtGui, QtCore, QtWidgets
import numpy as np
from ...system.atoms import elements
f... | |
# 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 applicable law or agreed to in... | |
# Building parsed corpora for discourse analysis
# Author: Daniel McDonald
def dictmaker(path,
dictname,
query = 'any',
dictpath = 'data/dictionaries',
lemmatise = False,
just_content_words = False,
use_dependencies = False):
... | |
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | |
#!/usr/bin/python
from vm import VM
from vmhost import VMhost
import testcases
def case_simple_swap():
testcases.utils.create_vmhosts(2, 'x86_64', 4096)
vm1 = VM('vm1', 'x86_64', 256)
vm2 = VM('vm2', 'x86_64', 256)
stateA = {
'host1' : [ vm1 ],
'host2' : [ vm2 ],
}
stateB =... | |
# Copyright 2008-2011 WebDriver committers
# Copyright 2008-2011 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 requ... | |
# Copyright 2014 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... | |
import xml.etree.ElementTree as ET
import xml.dom.minidom as MD
from .testSuite import TestSuite
from .testCase import TestCase
from .utils import forceUnicode, cleanIllegalXmlChars
class TestReport(object):
class XmlDecodingFailure(Exception):
pass
class MergeFailure(Exception):
pass
... | |
#!/usr/bin/env python
#
# 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.
"""Runs all types of tests from one unified interface."""
import argparse
import collections
import logging
import os
import shutil
... | |
"""
Models for actual Polling Stations and Polling Districts!
"""
from itertools import groupby
import re
import urllib.parse
from django.contrib.gis.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
from councils.models import Council
class P... | |
# python-automata, the Python DFA library
# License: New BSD License
# Author: Andrew Badr
# Version: July 17, 2008
# Contact: andrewbadr@gmail.com
# Code contributions are welcome.
from copy import copy
from .UnionFind import UnionFind
# TODO: general code cleanup
# TODO: write tests
class DFA:
"""This class re... | |
# -*- coding: utf-8 -*-
"""
Python Markdown
A Python implementation of John Gruber's Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few yea... | |
import math
import pygame
import os
#### Goal Statement ####
## This program is intended to test a very simple model of gravitic attraction.
## The way it works is as follows:
## Every update, each object with gravity would tell each other update with gravity to adjust their velocities by a tiny amount in the direct... | |
"""
Utilities to handle projects' structure
"""
import os
import re
from pathlib import Path
from typing import List, Optional
from controller import (
BACKUP_DIR,
DATA_DIR,
LOGS_FOLDER,
PROJECT_DIR,
SUBMODULES_DIR,
log,
print_and_exit,
)
from controller.utilities import git
NO_AUTHENTICAT... | |
#!/usr/bin/env python3
# Copyright (c) 2016-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.
"""Test the dumpwallet RPC."""
import datetime
import os
import time
from test_framework.test_framework i... | |
import re
import itertools
from pprint import pprint
import maya.cmds as cmds
import pymel.util as util
import pymel.util.trees as trees
import pymel.api as api
import pymel.internal.cmdcache as cmdcache
import pymel.internal.apicache as apicache
import pymel.internal.factories as factories
#=========================... | |
"""
Example of JSON body validation in POST with various kinds of specs and views.
"""
try:
from http import HTTPStatus
except ImportError:
import httplib as HTTPStatus
from flask import Blueprint
from flask import Flask
from flask import jsonify
from flask import request
from flasgger import Schema
from flasgg... | |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase, RequestFactory
try:
# Django >= 1.7
from django.test import override_settings
except ImportError... | |
# TNC Python interface
# @(#) $Jeannot: tnc.py,v 1.11 2005/01/28 18:27:31 js Exp $
# Copyright (c) 2004-2005, Jean-Sebastien Roy (js@jeannot.org)
# 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 Soft... | |
# Copyright (c) 2009-2015 Denis Bilenko. See LICENSE for details.
"""
Event-loop hub.
"""
from __future__ import absolute_import
# XXX: FIXME: Refactor to make this smaller
# pylint:disable=too-many-lines
from functools import partial as _functools_partial
import os
import sys
import traceback
from greenlet import gre... | |
#!/usr/bin/python2.7
# Compresses the core Blockly files into a single JavaScript file.
#
# Copyright 2012 Google Inc.
# https://developers.google.com/blockly/
#
# 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 o... | |
# 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.
'''Base types for nodes in a GRIT resource tree.
'''
from __future__ import print_function
import ast
import os
import struct
import sys
from xml.sax i... | |
from __future__ import unicode_literals
import json
import re
import socket
from .common import InfoExtractor
from ..compat import (
compat_etree_fromstring,
compat_http_client,
compat_urllib_error,
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
)
from ..utils import (
error_to... | |
#!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | |
"""Module-level functions"""
import os
import re
from tempfile import mkdtemp
from typing import Optional
import pyfaidx
from appdirs import user_config_dir
from genomepy.annotation import Annotation
from genomepy.config import config
from genomepy.exceptions import GenomeDownloadError
from genomepy.files import (
... | |
# ===============================================================================
# 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... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9824")
else:
access = Ser... | |
import itertools
import heapq
import collections
import operator
from functools import partial
from toolz.compatibility import (map, filter, filterfalse, zip, zip_longest,
iteritems)
__all__ = ('remove', 'accumulate', 'groupby', 'merge_sorted', 'interleave',
'unique', 'isit... | |
"""
Noise processing
Jacob Dein 2016
nacoustik
Author: Jacob Dein
License: MIT
"""
import numpy as np
import pandas as pd
from numba import guvectorize, float64, int64
from scipy.ndimage import label, find_objects
from scipy.ndimage.morphology import generate_binary_structure
# implemented as a universal function ... | |
import binascii
import json
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
import pem
from twisted.internet.defer import Deferred
from twisted.logger import Logger
from txacme.interfaces import ICertificateStore
from zope.int... | |
# coding: utf-8
# Distributed under the terms of the MIT License.
import pdb
import sys
import os.path
from ababe.stru.scaffold import SitesGrid, CStru, GeneralCell
from ababe.stru.element import GhostSpecie, Specie
from itertools import combinations, zip_longest
from progressbar import ProgressBar
import numpy as n... | |
#
# 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... | |
"""
Unit tests for the frontend code.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import logging
import ga4gh.datamodel as datamodel
import ga4gh.frontend as frontend
import ga4gh.protocol as protocol
class TestFrontend(unittest.T... | |
#=======================================================================
# queues.py
#=======================================================================
'''A collection of queue model implementations.'''
from pymtl import *
from pclib.ifcs import InValRdyBundle, OutValRdyBundle
from pclib.rtl import RegEn, ... | |
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 res... | |
import time, logging
from .exceptions import TimeoutError, ElementNotFoundError
__all__ = ['PageObject', 'get_page_object', 'cacheable']
_logger = logging.getLogger(__name__)
_page_singletons = {} # cache
def get_page_object(page_class, context):
fqcn = '%s.%s' % (page_class.__module__, page_class.__name__)
... | |
"""
Collection class which keeps itself sorted.
Taken from http://code.activestate.com/recipes/577197-sortedcollection/,
with some changes.
"""
from bisect import bisect_left, bisect_right
class SortedCollection(object):
'''Sequence sorted by a key function.
SortedCollection() is much easier to work with th... | |
#! /usr/bin/python
import asyncore
import pdb
import select
import sys
import multiprocessing
from websocket import create_connection, WebSocketException
import json
from PIL import Image
import base64
import numpy as np
import io, StringIO
import MyUtils
import threading
import time
import os
import logging
from Ne... | |
# -*- 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):
# Adding model 'Branch'
db.create_table('layerindex_branch', (
('id', self.gf('django.db.models.... | |
################################################################################
# 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... | |
#
# 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
# ... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | |
"""Logging utilities for Certbot.
The best way to use this module is through `pre_arg_parse_setup` and
`post_arg_parse_setup`. `pre_arg_parse_setup` configures a minimal
terminal logger and ensures a detailed log is written to a secure
temporary file if Certbot exits before `post_arg_parse_setup` is called.
`post_arg_... | |
# Copyright 2013 Nicira, 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 by a... | |
#
# Licensed under the BSD license. See full license in LICENSE file.
# http://www.lightshowpi.com/
#
# Author: Todd Giles (todd@lightshowpi.com)
# Author: Tom Enos (tomslick.ca@gmail.com)
"""FFT methods for computing / analyzing frequency response of audio.
This is simply a wrapper around FFT support in numpy.
Ini... | |
import logging
# Get an instance of a logger
logger = logging.getLogger(__name__)
from django.test import RequestFactory
from tastypie.resources import ALL_WITH_RELATIONS, ALL
from tastypie.resources import ModelResource
from tastypie.exceptions import BadRequest
from django.conf import settings
from django.conf.url... | |
import operator
from functools import partial, wraps
from itertools import chain, count
from collections import Iterator
from toolz import merge, unique, curry
from .optimize import cull, fuse
from .utils import concrete
from . import base
from .compatibility import apply
from . import threaded
__all__ = ['compute',... | |
import sys
from ship import *
from pygame.locals import *
class Game:
def __init__(self):
# initialize game window, etc
pg.init()
pg.font.init()
pg.mixer.init()
self.screen = pg.display.set_mode((width, height), pg.FULLSCREEN)
pg.display.set_caption(Title)
... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import configparser
import hmac
import platform
from urllib.parse import urlparse, urlunparse, quote
import requests
import time
MAFREEBOX_API_URL = 'http://mafreebox.freebox.fr/api/v3/'
CONFIG_FILE = '.fbxconfig'
APP_ID = 't411-tracker-update'
APP_VERSION = '0.0.1'
OLD_T... | |
# -*- coding: utf-8 -*-
"""
This module contains the definition of Stream class.
"""
###############################################################################
from __future__ import division
from collections import Iterable, Sized, deque
from heapq import nlargest, nsmallest, heappush, heappop
from itertools... | |
import datetime
import logging
import pdb
import signals
from django import forms
from django.db.models import Q
from django.forms.extras.widgets import SelectDateWidget
from django.utils.translation import ugettext_lazy as _, ugettext
from l10n.models import Country
from livesettings import config_value
from satchmo_... | |
"""Terminal management for exposing terminals to a web interface using Tornado.
"""
# Copyright (c) Jupyter Development Team
# Copyright (c) 2014, Ramalingam Saravanan <sarava@sarava.net>
# Distributed under the terms of the Simplified BSD License.
from __future__ import absolute_import, print_function
import sys
if ... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
#!/usr/bin/env python
import unittest
import random
import time
import pickle
import warnings
from math import log, exp, pi, fsum, sin
from functools import reduce
from test import test_support
class TestBasicOps(unittest.TestCase):
# Superclass with tests common to all generators.
# Subclasses must arrange f... | |
"""Test the sonos config flow."""
from __future__ import annotations
from unittest.mock import MagicMock, patch
from homeassistant import config_entries, core
from homeassistant.components import ssdp, zeroconf
from homeassistant.components.media_player import DOMAIN as MP_DOMAIN
from homeassistant.components.sonos.c... | |
import re
class BooleanExpression:
# A simple evaluator of boolean expressions.
#
# Grammar:
# expr :: or_expr
# or_expr :: and_expr ('||' and_expr)*
# and_expr :: not_expr ('&&' not_expr)*
# not_expr :: '!' not_expr
# '(' or_expr ')'
# ... | |
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
import errno
import logging
import os
from ceph_deploy import conf
from ceph_deploy import exc
from ceph_deploy import hosts
from ceph_deploy.util import system
from ceph_deploy.lib import remoto
from ceph_deploy.cliutil import pri... | |
# coding: utf-8
"""
Vericred API
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.
## Getting Started
Visit our [Developer Portal](https://developers.vericred.com) to
create an account.
Once you have created an account, you can create one Application for
Production and an... | |
# The MIT License (MIT)
# Copyright (c) 2021 Microsoft Corporation
# 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... | |
from django_fsm_log.admin import StateLogInline
from fsm_admin.mixins import FSMTransitionMixin
from django_object_actions import DjangoObjectActions
# Django
from django.contrib import admin
from reversion.admin import VersionAdmin
# Local
from .models import Award
from .models import Person
from .models import G... | |
#!/usr/bin/env python
'''
MOSSE tracking sample
This sample implements correlation-based tracking approach, described in [1].
Usage:
mosse.py [--pause] [<video source>]
--pause - Start with playback paused at the first video frame.
Useful for tracking target selection.
--picam - Use this fla... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# ... | |
"""
Julia code printer
The `JuliaCodePrinter` converts SymPy expressions into Julia expressions.
A complete code generator, which uses `julia_code` extensively, can be found
in `sympy.utilities.codegen`. The `codegen` module can be used to generate
complete source code files.
"""
from __future__ import print_funct... | |
# Copyright 2016 Alethea Katherine Flowers
#
# 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... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 24 12:25:17 2017
@author: dongyu
"""
import os
import utm
import glob
import shutil
import time
import lib
import lib.SUNTANS
import hydro_wrapper
import oilspill_wrapper
from DownloadTool import downloadROMS
from FileTool import increaseT2
from WindTool import NCEP_wind,... | |
from flask import request, url_for, redirect, flash
from jinja2 import contextfunction
from flask.ext.admin.babel import gettext
from flask.ext.admin.base import BaseView, expose
from flask.ext.admin.tools import rec_getattr, ObsoleteAttr
from flask.ext.admin.model import filters, typefmt
from flask.ext.admin.action... | |
# -*- coding: utf-8 -*-
import unittest
import datetime
from dateutil.relativedelta import relativedelta
from trytond.tests.test_tryton import DB_NAME, USER, CONTEXT, POOL
import trytond.tests.test_tryton
from trytond.transaction import Transaction
from trytond.exceptions import UserError
class TestTransaction(unitt... | |
# 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... | |
# coding: utf-8
# Copyright (c) Materials Virtual Lab
# Distributed under the terms of the BSD License.
from __future__ import division, print_function, unicode_literals, \
absolute_import
import re
import os
import yaml
import random
import logging
import subprocess
import xml.etree.ElementTree as ET
from collec... | |
from mathFunctions import *
__all__ = [
"_expandGuideline",
"_compressGuideline",
"_pairGuidelines",
"_processMathOneGuidelines",
"_processMathTwoGuidelines"
]
def _expandGuideline(guideline):
"""
>>> guideline = dict(x=100, y=None, angle=None)
>>> _expandGuideline(guideline)
{'y':... | |
"""Test event helpers."""
# pylint: disable=protected-access
import asyncio
import unittest
from datetime import datetime, timedelta
from astral import Astral
from homeassistant.bootstrap import setup_component
import homeassistant.core as ha
from homeassistant.const import MATCH_ALL
from homeassistant.helpers.event ... | |
# Lint as: python3
# Copyright 2021 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
#!/usr/bin/env python
# standard library imports
import os
import sys
import logging
import re
import hashlib
# 3rd party imports
import simplejson
# KBase imports
import biokbase.Transform.script_utils as script_utils
# transformation method that can be called if this module is imported
# Note the logger has diff... | |
## 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
"""
General utility functions.
"""
from __future__ import with_statement
import os,sys,socket,types
import random,time
i... | |
"""
SoftLayer Cloud Module
======================
The SoftLayer cloud module is used to control access to the SoftLayer VPS
system.
Use of this module only requires the ``apikey`` parameter. Set up the cloud
configuration at:
``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/softlayer.conf``:
.. code-b... | |
import sys
import time
import os
import serial
import random
import RPi.GPIO as GPIO
import Adafruit_MPR121.MPR121 as MPR121
import threading
from threading import Thread
flag1 = 0
flag2 = 0
randomInt = 0
ser = serial.Serial('/dev/ttyACM0', 9600)
#Defining audio files
#darkSide
def bidding():
global flag1
os.syste... | |
# Alan Richardson (Ausar Geophysical)
# 2017/01/31
import numpy as np
import scipy.signal
import pandas as pd
from sklearn import preprocessing, metrics
from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
from sklearn.base import clone
from matplotlib import pyplot as plt
import scipy.optimize
from... | |
# vim: set et ai ts=4 sts=4 sw=4:
"""JKS/JCEKS file format decoder. Use in conjunction with PyOpenSSL
to translate to PEM, or load private key and certs directly into
openssl structs and wrap sockets.
Notes on Python2/3 compatibility:
Whereever possible, we rely on the 'natural' byte string
representation of each Pyt... | |
# need documentation
import sys
if sys.version_info <= (3, 0):
print ("Sorry, this program requires Python 3.x, not Python 2.x\n")
sys.exit(1)
import numpy as np
"""
Problem Statement:
Classify a numeric series in groups.
Use case 1: Classify a natural number series in discrete groups.
calc_groupby(list_l... | |
# Copyright 2014 Huawei Technologies Co. Ltd
#
# 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... | |
"""Spark schemas for both raw corpus data (from various sources) and the model
which aforementioned raw corpus data converges.
Corpus data comes from many sources which each have their own format(s). All of
these raw corpus data models, e.g., :class:`BenningtonDocument`, map to, or
rather compose, a :class:`Document`... | |
#!/usr/bin/env python
"""HTTP API logic that ties API call handlers with HTTP routes."""
import itertools
import json
import time
import traceback
import urllib2
from werkzeug import exceptions as werkzeug_exceptions
from werkzeug import routing
from werkzeug import wrappers as werkzeug_wrappers
from google.proto... | |
# Copyright 2015 DataStax, 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 or agreed to in writing, s... | |
# ===============================================================================
# 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... | |
#
# 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... | |
# 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 ... | |
# main.py
# main loop to be run on a beaglebone for use with other smart relay components
# Author: Brandon Mayfield
import gspread # allows access to Google spreadsheets
import Adafruit_BBIO.ADC as ADC # ADC control
import Adafruit_BBIO.GPIO as GPIO # GPIO control
from time impo... | |
"""
Run many trilegal simulations and cull scaled LF functions to compare with data
"""
import argparse
import logging
import numpy as np
import os
import sys
import time
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pylab as plt
import ResolvedStellarPops as rsp
from IPython import parallel
from ..pop_sy... | |
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_c... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Service providing handler
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.5.8
:status: Beta
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you... | |
'''
Entry point module (keep at root):
Used to run with tests with unittest/pytest/nose.
'''
import os
try:
xrange
except:
xrange = range
def main():
import sys
# Separate the nose params and the pydev params.
pydev_params = []
other_test_framework_params = []
found_other_test_framework... | |
# Copyright 2019 Google LLC. 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 applicable law or a... | |
#!/usr/bin/env python
# Copyright 2016 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 or... | |
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis,... | |
# Copyright 2013 IBM Corp.
# 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/LIC... | |
from . import gng2
from pygraph.classes.graph import graph
from pygraph.algorithms.minmax import cut_tree
from pygraph.algorithms.accessibility import connected_components
from .utils import __dict_reverse as dict_reverse
import itertools
import time
from numpy import array,sum,sqrt
class data_block:
"""This is th... | |
# -*- coding: utf-8 -*-
"""Choices for input_choice."""
#
# (C) Pywikibot team, 2015-2016
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
import pywikibot
class Option(object):
"""
A basic option for input_choice.
The following methods need... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.