src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 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... |
from __future__ import (absolute_import, division, print_function)
import glob
import io
import os
import sys
from setuptools.dist import Distribution
if sys.version_info < (2, 6):
raise SystemExit("""matplotlib and the basemap toolkit require Python 2.6 or later.""")
# Do not require numpy for just querying the... |
# 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 ... |
# -*- coding: utf-8 -*-
"""
scn.plugins.middleware.interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL3, see LICENSE for more details.
"""
import json
from pox.core import core
from pox.lib.addr... |
from js9 import j
JSBASE = j.application.jsbase_get_class()
class CodeDirs(JSBASE):
def __init__(self):
JSBASE.__init__(self)
self.path = j.dirs.CODEDIR
self.load()
def load(self):
data = j.core.state.stateGetFromDict("develop", "codedirs", "")
self.tree = j.data.tre... |
# -*- coding: utf-8 -*-
from mesa_pd.accessor import create_access
from mesa_pd.utility import generate_file
def create_property(name, type, defValue=""):
"""
Parameters
----------
name : str
name of the property
type : str
type of the property
defValue : str
default valu... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import os.path
import tarfile
from pre_commit import five
from pre_commit import output
from pre_commit.util import cmd_output
from pre_commit.util import cwd
from pre_commit.util import rmtree
from pr... |
#
# Copyright (c) 2005 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Description: TODO
"""
__user__ = "Ariel Gerardo Rios (ariel.gerardo.rios@gmail.com)"
from django.db.models import Q
from django.contrib.auth import get_user_model
from django.conf import settings
from django.views.generic import TemplateView
from django.views.generic... |
import os
from builder.btools import RegisterCustomTest
from builder.btools import AddConfigKey
from builder.btools import runCommand
from builder.bconfig import getAutoconfPrefix
def CheckSDL(ctx, write_config_h=False, add_to_compiler_env=False):
ctx.Message('Checking for SDL... ')
confprefix = getAutoconfPre... |
import subprocess
from pelican import signals
from pelican.readers import BaseReader
from pelican.utils import pelican_open
class MmdReader(BaseReader):
enabled = True
file_extensions = ['md', 'markdown', 'mkd', 'mdown']
def read(self, filename):
with pelican_open(filename) as fp:
text... |
from nose import with_setup
from nose.tools import assert_equal
import pandas as pd
from catdtree import BaseDecisionTree
class MockDecisionTree(BaseDecisionTree):
def __init__(self):
BaseDecisionTree.__init__(self)
def _choose_best_split(self, X_part, y_part):
if len(set(X_part['Sex'])) > 1... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-modelqueryform
------------
Tests for `django-modelqueryform` forms module.
"""
from collections import OrderedDict
from django.core.exceptions import ImproperlyConfigured
from django.db.models.query_utils import Q
from django.forms.fields import Multiple... |
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework_jwt import utils
from posts.models import Post
from posts.tests.factory import create_post
class TestPost(APITestCase):
unpu... |
"""
Define various message strings generated in the code.
As far as possible, user display strings referenced directly by
source code are isolated here to facilitate editing and translation.
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ =... |
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2015 FactorLibre (http://www.factorlibre.com)
# Hugo Santos <hugo.santos@factorlibre.com>
#
# This program is free software: you can redistribute it and/o... |
from app import verify_password, validate_token, User
import json
from base64 import b64encode
def auth_headers(username, password):
username_password = "%s:%s" % (username, password)
headers = {
'Authorization': 'Basic %s' % b64encode(username_password.encode()).decode("ascii")
}
return heade... |
#!/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... |
#!/usr/bin/env python
u"""
notation3.py - Standalone Notation3 Parser
Derived from CWM, the Closed World Machine
Authors of the original suite:
* Dan Connolly <@@>
* Tim Berners-Lee <@@>
* Yosi Scharf <@@>
* Joseph M. Reagle Jr. <reagle@w3.org>
* Rich Salz <rsalz@zolera.com>
http://www.w3.org/2000/10/swap/notation3.... |
from requester import Requester
import json
req = Requester()
localTest = False
print('Loading function')
def respond(err, res=None):
return {
'statusCode': '400' if err else '200',
'body': err.message if err else json.dumps(res),
'headers': {
'Content-Type': 'application/json... |
#!/usr/bin/env python3
################################################################################
# Abstract:
# A wrapper for oauth2_proxy
#
# Description:
#
#
# Copyright (c) 2015 Dragon Law
# Project: Dragon Law Data Manager
# Creation: Lingxiao Xia
# Creation Date: 18/05/2015
##################################... |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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/LICE... |
from pyutil.mongo.engine.strategy import Strategy, strategies, configuration
from pyutil.mongo.engine.symbol import Symbol, Group
from pyutil.performance.drawdown import drawdown
from pyutil.performance.month import monthlytable
from pyutil.performance.return_series import from_nav
from pyutil.portfolio.portfolio impor... |
#
# ParameterWeaver: a code generator to handle command line parameters
# and configuration files for C/C++/Fortran/R/Octave
# Copyright (C) 2013 Geert Jan Bex <geertjan.bex@uhasselt.be>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... |
'''This module contains methods for creating, reading, and manipulating
simple configuration files in JSON format.
Any of the basic data types (strings, numbers, lists, tuples, dictionaries)
can be used with one caveat - dictionary keys must be strings. If a dict
with non-string keys is supplied, json.dumps will au... |
#!/usr/bin/env python
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to synchronise the naclports mirror of upstream archives.
This script verifies that the URL for every package is mi... |
import numpy as np
from . import accel, beep, compass, countspikes, gyro, motor
try:
import nengo_spinnaker
import nengo_spinnaker.builder
import pacman103.front.common
generic_robot_keyspace = nengo_spinnaker.utils.keyspaces.create_keyspace(
'OutboundRobotProtocol', [('x', 1), ('o', 19), ('... |
# Copyright 2017 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 agreed to in wri... |
'''
This is a port from SimpleTemplates to be a standalone Template Engine.
Simple Template is a very fast Template Engine for Python.
Now SimpleTemplate can be used on other projects :-)
All credit to the Bottle Project Creator (https://github.com/bottlepy/bottle).
'''
import functools
import os, re
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from urllib.parse import urljoin
from pyquery import PyQuery
from novel import serial, utils
BASE_URL = 'http://www.tianna.la/tnw{}/'
class Tianna(serial.SerialNovel):
def __init__(self, tid):
super().__init__(utils.base_to_url(BASE_URL, tid), '#content',... |
# 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.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... |
from django.apps import apps as django_apps
from django.core.exceptions import MultipleObjectsReturned
from django.test import TestCase, tag
from django.test.utils import override_settings
from ..constants import INSERT, UPDATE
from ..models import OutgoingTransaction
from ..site_sync_models import site_sync_models
fr... |
import numpy as np
import pandas as pd
from statsmodels import regression
import statsmodels.api as sm
import matplotlib.pyplot as plt
import math
import pandas_datareader.data as web
from datetime import datetime
def Starter_Lec7():
start = datetime(2014, 1, 1)
end = datetime(2015, 1, 1)
asset = web.Da... |
"""Audience mailing message models"""
from emma import exceptions as ex
from emma.model import BaseApiModel
class Message(BaseApiModel):
"""
Encapsulates operations for a :class:`Message`
:param mailing: The Mailing which owns this Message
:type mailing: :class:`Mailing`
:param member_id: The Me... |
import os
import time
import signal
import subprocess
from datetime import datetime
from select import select
camera = dict()
command = dict()
currentVideo = dict()
commandTimeout = 5
def startVideo(camera, resolution="width=1280,height=720"):
directory = "camera/" + str(camera) + "/" + datetime.now().strftime("... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s
Worker ("slave") process used in computing distributed LSI. Run this script \
on every node in your cluster.... |
from __future__ import annotations
from typing import TYPE_CHECKING, List, Dict, Iterable, Optional
from staticsite import Page
from staticsite.feature import Feature
from staticsite.metadata import Metadata
from collections import defaultdict
import heapq
import functools
import os
import logging
if TYPE_CHECKING:
... |
import uuid
from os.path import relpath
from coala_utils.decorators import (
enforce_signature, generate_ordering, generate_repr, get_public_members)
from coalib.bearlib.aspects import aspectbase
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.results.SourceRange import SourceRange
# Omit ... |
#!/usr/bin/python3
import MySQLdb
import os
import re
db = MySQLdb.connect("etos39.cn.ao.ericsson.se","automation","automation","gerrit_data_new")
# db = MySQLdb.connect("localhost","root","root","work" )
cursor = db.cursor()
cursor.execute('SELECT reviewer_username FROM comments GROUP BY reviewer_username')
users... |
# Copyright 2012 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/LICENSE-2.0
#
# Unless required b... |
import math
import __builtin__
from pandac.PandaModules import Vec3, GeomVertexData, GeomVertexFormat
from pandac.PandaModules import Geom, GeomVertexWriter, GeomVertexRewriter
from pandac.PandaModules import GeomVertexReader, GeomTristrips, CullFaceAttrib
from pandac.PandaModules import GeomNode, NodePath, Mat4, Vec4... |
from amitools.vamos.log import log_exec
from amitools.vamos.error import *
from .Puddle import Puddle
class Pool:
def __init__(self, mem, alloc, flags, size, thresh, poolid):
self.alloc = alloc
self.mem = mem
self.minsize = size
self.flags = flags
self.thresh = thresh
self.name =... |
from tempfile import mkdtemp
from shutil import rmtree
try:
from unittest.mock import Mock
except ImportError:
from unittest.mock import Mock
from sphinx.application import Sphinx
from sphinx_issues import (
issue_role,
user_role,
pr_role,
cve_role,
commit_role,
setup as issues_setup,
... |
# ===============================================================================
# Copyright 2011 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... |
# encoding:utf-8
"""
DwLoadServer - A DWLOAD server written in Python
================================================
:created: 2014 by Jens Diemer - www.jensdiemer.de
:copyleft: 2014 by the DwLoadServer team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more detai... |
__author__ = 'n3k'
from abc import ABCMeta, abstractmethod
class Operation(object):
__metaclass__ = ABCMeta
def __init__(self, units=0):
self.units = units
@abstractmethod
def execute_change_state(self,process):
pass
@abstractmethod
def add_operation(self, operation):
... |
#!/usr/bin/env pypy
from commons import isRealistic
import math
import random
if not isRealistic():
random.seed(0)
from operator import attrgetter
from node import Node
from job import Job
from schedulerpolicy import SchedulerPolicy
from history import History
from history import HistoryViewer
import sys
from date... |
"""
Surrogate conftest.py contents loaded by the conftest.py file.
"""
import logging
import os
from pathlib import Path
import pytest
from dcos_e2e.backends import Docker
@pytest.fixture(scope='session', autouse=True)
def configure_logging() -> None:
"""
Surpress INFO, DEBUG and NOTSET log messages from li... |
import numpy as np
import pickle
import jsonpickle
def match_topics_across_dictionaries(lda1 = None,lda2 = None,file1 = None,file2 = None,
same_corpus = True,copy_annotations = False,copy_threshold = 0.5,summary_file = None,
new_file2 = None,mass_tol = 5.0):
# finds the closest topic matches from lda2 to lda1
if l... |
# -*- coding: utf-8 -*-
#
# Get the user data from the https://github.com/smilix/moinAuthProvider action.
# Author: HolgerCremer@gmail.com
import requests
from requests.packages.urllib3 import PoolManager
class MoinMoinAuthByProvider():
def __init__(self, logger, provider_url, psk, ssl_fingerprint, ca_certs, dis... |
# Copyright 2011 Ryan P. Kelly <rpkelly@cpan.org>
#
# This code was inspired by this thread on stackoverflow:
# http://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application
#
# This code is BSD licensed, please see LICENSE for the full text.
import sys
import signal
import traceback
... |
import logging
import argparse
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO) # To make sure that it is just pushing modism debug into the log
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
from telegram.ext import Updater
from pymongo ... |
from django.shortcuts import render, get_object_or_404
from .models import Category, Product
from .forms import EmailContactForm
from cart.forms import CartAddProductForm
from django.core.mail import send_mail
from django.views import View
from django.views.generic import DetailView, ListView
class ProductListView(Lis... |
""" Basic functions for manipulating 2d arrays
"""
from __future__ import division, absolute_import, print_function
import functools
from numpy.core.numeric import (
absolute, asanyarray, arange, zeros, greater_equal, multiply, ones,
asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal,
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Mathmaker creates automatically maths exercises sheets
# with their answers
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker.
# Mathmaker is free software; you can redistribute it and/or modify
# it under the terms of the GNU... |
#
# Copyright (C) 2004-2007 Autodesk, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser
# General Public License as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WI... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014 Holger Peters <email@holger-peters.de>
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2015 Dmitry Pribysh <dmand@yandex.ru>
# Copyright (c... |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Runs small tests.
"""
import imp
import os
import sys
import unittest
import TestGyp
test = TestGyp.TestGyp()
#... |
import re
import io, os, sys
def iterDic(dic):
"""
Return a python 2/3 compatible iterable
:param dic:
:param pythonTwo:
:return:
"""
if sys.version_info.major == 2:
return dic.viewitems()
else:
return dic.items()
class Patch:
"""
Create an object that contains ... |
#!/usr/bin/env python
# Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
# See the file 'doc/COPYING' for copying permission
import codecs
import inspect
import os
import re
import smtplib
import subprocess
import sys
import time
import traceback
from email.mime.multipart import MIMEMultipart
from emai... |
#!/usr/bin/python2
'''
Created on Aug 19, 2015
@author: periwinklepreacher
program name: rtrpc
description: Python module for interacting with rtorrent's XML-RPC interface.
examples: import rtrpc
proxy = SCGIServerProxy( 'scgi://localhost:5000' )
downloads = proxy.d.mul... |
from gi.repository import Gtk, GObject
firstRun = True
def run(widgets):
global firstRun
if firstRun:
initialize(widgets)
firstRun = False
widgets["player_info"].show_all()
def initialize(widgets):
def addColumns(treeview, *columns):
model = Gtk.ListStore(*((str, ) * len(co... |
from django.shortcuts import render
from django.http import HttpResponse
from django.db import IntegrityError
from urllib.request import urlopen
from hashlib import sha256
from os import environ
from register.models import *
from register.forms import *
from register.data impo... |
# Copyright (c) 2012-2018, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
from .validators import boolean
class AcceptedPortfolioShare(AWSObject):
resource_type = "AWS::ServiceCatalog::AcceptedPortfolioShare"
props = {
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated by generateDS.py.
#
import sys
import getopt
import re as re_
import base64
import datetime as datetime_
etree_ = None
Verbose_import_ = False
(
XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_impor... |
import sys
# from importlib import reload
if('pbnt/combined' not in sys.path):
sys.path.append('pbnt/combined')
from exampleinference import inferenceExample
from random import randint
import numpy as np
from Node import BayesNode
from Graph import BayesNet
from numpy import zeros, float32
import Distribution
fro... |
# 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 ... |
# lint-amnesty, pylint: disable=missing-module-docstring
import copy
from opaque_keys.edx.locator import DefinitionLocator
class DefinitionLazyLoader(object):
"""
A placeholder to put into an xblock in place of its definition which
when accessed knows how to get its content. Only useful if the containin... |
# -*- coding: utf-8 -*-
import httplib as http
from nose.tools import * # flake8: noqa
from tests.base import ApiTestCase, DbTestCase
from tests import factories
from tests.utils import make_drf_request
from api.base.settings.defaults import API_BASE
from api.base.serializers import JSONAPISerializer
from api.nodes... |
from __future__ import unicode_literals
import datetime
import django
from django.utils.timezone import now
from django.test import TransactionTestCase
from job.messages.uncancel_jobs import UncancelJobs
from job.models import Job
from job.test import utils as job_test_utils
from recipe.test import utils as recipe_t... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# wicked documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 10 16:10:24 2015.
#
# 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
# aut... |
"""
Contribution - Griatch 2011
[Note - with the advent of MULTISESSION_MODE=2, this is not really
as necessary anymore - the ooclook and @charcreate commands in that
mode replaces this module with better functionality.]
This is a simple character creation commandset. A suggestion is to
test this together with menu_... |
#!/usr/bin/env python
# 2014-07-11 DHT22.py
import time
import atexit
import sys
import pigpio
class sensor:
"""
A class to read relative humidity and temperature from the
DHT22 sensor. The sensor is also known as the AM2302.
The sensor can be powered from the Pi 3V3 or the Pi 5V rail.
Powering fr... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list where
# al... |
import os
import sys
import logging
from bson import ObjectId
logging.basicConfig(level=logging.INFO)
slideatlaspath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path.append(slideatlaspath)
from slideatlas import models
from slideatlas.models import Image
from slideatlas.models import Imag... |
import unittest
import numpy
import scipy.linalg
from features.PrimalCCA import PrimalCCA
from features.KernelCCA import KernelCCA
from kernel.LinearKernel import LinearKernel
import logging
class PrimalCCATest(unittest.TestCase):
def setUp(self):
numpy.seterr(all='ignore')
pass
def test... |
# Generated by Django 2.2.5 on 2020-08-03 10:37
import django.core.files.storage
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
dependencies = [
('jobs', '0002_dataprovider_attribute_class'),
... |
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 09 10:39:38 2015
@author: 108630
"""
import os
from datetime import datetime, timedelta
import numpy as np
dir_path = os.path.dirname(__file__)
# Setup
x = np.linspace(0.,1000.,20.)
y = np.linspace(0.,300.,20.)
nx = len(x)
ny = len(y)
# Bathymetry?
X, Y = np.meshgr... |
from graph_input import read_graph
def choose_node(reachable, explored):
for node in reachable:
if node not in explored:
return node
def find_path(start_node, goal_node, graph):
reachable = [start_node]
explored = set()
previous = {start_node: None}
while len(reachable) > 0:
... |
# Copyright 2020 Makani Technologies 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... |
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of REDHAWK core.
#
# REDHAWK core 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
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-19 13:23
from __future__ import unicode_literals
from django.db import migrations, models
SECTOR_MAPPING = {
'Agriculture': 'Agriculture',
'Energy': 'Energy',
'Water (global)': 'WaterGlobal',
'Water (regional)': 'WaterRegional',
'Bio... |
import time
import logging
from autobahn.asyncio.websocket import WebSocketClientProtocol
log = logging.getLogger(__name__)
class STFRecordProtocol(WebSocketClientProtocol):
img_directory = None
address = None
resolution = None
def __init__(self):
super().__init__()
self.first_msg_ti... |
from __future__ import division, print_function
import imp
import os
import sys
import shutil
import pickle
import copy
import warnings
import re
from os.path import join
from numpy.distutils import log
from distutils.dep_util import newer
from distutils.sysconfig import get_config_var
from setup_common import *
# S... |
#!/usr/bin/env python
import setuptools
# Hack to prevent stupid TypeError: 'NoneType' object is not callable error on
# exit of python setup.py test # in multiprocessing/util.py _exit_function when
# running python setup.py test (see
# http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
try:
i... |
# -*- coding: utf-8 -*-
"""
Common type definitions and constants for edx-dl
The classes in this module represent the structure of courses in edX. The
structure is:
* A Course contains Sections
* Each Section contains Subsections
* Each Subsection contains Units
Notice that we don't represent the full tree structu... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyLockfile(PythonPackage):
"""The lockfile package exports a LockFile class which provides... |
from pprint import pprint
import pytest
import datetime
def assert_keys_in(json_obj, *keys):
for key in keys:
assert key in json_obj
def test_categorization(inv):
keys = ['status', 'content_categories', 'security_categories']
# Test get with a single domain
domain = 'www.amazon.com'
resp_... |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2018 Paul Culley
#
# 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)... |
#!/usr/bin/env python3
import collections
import curses
import logging
try:
from .base_io import BaseIO
except SystemError:
from base_io import BaseIO
class TextIO(BaseIO):
''' An interface with the user via a terminal '''
def __init__(self):
super().__init__()
self.stdscr = curses.i... |
import socket
import sys
import getopt
import DataGenerator
import time
import thread
tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
usage = sys.argv[0] +' -h <host> -p <port> [-l <length>] [-c <command>]'
def main(argv):
try:
opts, args = getopt.getopt(sys.argv[1:],"h:p:l:")
e... |
import os
import stat
from .errors import NoneCurrentProblem, UnsavedModifiedProblem
from .models import FolderTreeElement, Problem, NumberedProblem
class MainViewModel:
def __init__(self):
self._path = None
self._pathtree = None
self._is_modified = False
self._problem = None
... |
# 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 ... |
import sys
from cffi import FFI
if sys.hexversion > 0x03000000:
unicode = str
ffi = FFI()
ffi.cdef('''
typedef enum {
SNAPPY_OK = 0,
SNAPPY_INVALID_INPUT = 1,
SNAPPY_BUFFER_TOO_SMALL = 2
} snappy_status;
typedef uint32_t crc_t;
int snappy_compress(const char* input,
size_t input_leng... |
# -*- coding: utf-8 -*-
#
# subcomponent documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 17 21:26:47 2017.
#
# 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.
... |
#!/usr/bin/env python3
import argparse
import collections
import string
def make_punctuation_translation_table():
# It is safer to replace punctuation by spaces as it prevents merging incorrectly separated words together.
return str.maketrans(string.punctuation, ' ' * len(string.punctuation))
def count_wor... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation
# The main logic behind running autotests in parallel
from __future__ import print_function
import StringIO
import csv
from multiprocessing import Pool, Queue
import pexpect
import re
import subprocess
import sys
import time
import glo... |
import threading
import time
from sqlalchemy import pool, select, event
import sqlalchemy as tsa
from sqlalchemy import testing
from sqlalchemy.testing.util import gc_collect, lazy_gc
from sqlalchemy.testing import eq_, assert_raises, is_not_
from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.testing... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Will Brennan'
# Built-in Module
import os
import time
import logging
import warnings
import cPickle as pickle
from datetime import datetime
# Standard Modules
import numpy
import sklearn
import theano
import theano.tensor as T
# Custom Modules
import Scripts... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.