text stringlengths 17 737k |
|---|
"""
I/O for FLAC3D format.
"""
import logging
import struct
import time
import numpy
from ..__about__ import __version__ as version
from .._common import _pick_first_int_data
from .._exceptions import ReadError, WriteError
from .._files import open_file
from .._helpers import register
from .._mesh import Mesh
meshio... |
# This file is part of beets.
# Copyright 2013, 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 the rights to use, copy, ... |
import cProfile
import subprocess
import prf as prf
from datetime import datetime
# current git version / commit
label = subprocess.check_output(['git', 'describe', '--always'])
label = str(label)
date = datetime.now()
date_label = (
'-'.join([str(getattr(date, attr))
for attr in ['year', 'month', '... |
# This file is part of beets.
# Copyright 2013, 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 the rights to use, copy, ... |
#!/usr/bin/env python
#----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work... |
"""
predict the estimated arrival time based on the
"""
# import module
import pandas as pd
import os
from datetime import datetime, timedelta
path = '../'
def calculate_arrival_time(stop_dist, prev_dist, next_dist, prev_timestamp, next_timestamp):
"""
Calculate the arrival time according to the given tup... |
"""
The functions in this module are used for comparing two LabColor objects
using various Delta E formulas.
"""
import numpy
from colormath import color_diff_matrix
def _get_lab_color1_vector(color):
"""
Converts an LabColor into a NumPy vector.
:param LabColor color:
:rtype: numpy.... |
"""
Module providing easy API for working with remote files and folders.
"""
from __future__ import with_statement
import tempfile
import re
import os
from fabric.api import *
def exists(path, use_sudo=False, verbose=False):
"""
Return True if given path exists on the current remote host.
If ``use_sud... |
#!/usr/bin/env python
import argparse
import os
import socket
import requests
from typing import Iterable
from typing import Optional
from typing import Mapping
from typing import Tuple
from paasta_tools.utils import atomic_file_write
from paasta_tools.utils import Client
from paasta_tools.utils import get_docker_clie... |
from flask import render_template, Blueprint, request, redirect, url_for, abort, jsonify, g, make_response, send_file
from flask_login import login_user, current_user, login_required, logout_user
from project import db, auth, auth_token, app, images
import uuid
import os
import zipfile
import json
import shutil
from we... |
# TODO:
# - Remake the dictionary to allow selecting key by simple color names (get rid of _multiplier, _tolerance) -- DONE
# - Fix the formula to account for changes done to dictionary. -- DONE
# - Fix the positioning of the widgets inside a window -- PARTLY DONE
# - Fix overwriting of self.band3_var_result when any o... |
# -*- coding: utf-8 -*-
from bokeh.io import output_notebook, show, push_notebook
from bokeh.plotting import figure
from bokeh.layouts import gridplot
import numpy as np
import random
import time
# ! only used to temporarily shutdown bokeh warning !
import warnings
warnings.filterwarnings('ignore')
# TODO: solve warn... |
"""Coupling Measurement from Minimal Tune Separation."""
import time as _time
from threading import Thread as _Thread, Event as _Event
import numpy as _np
import matplotlib.pyplot as _plt
from .base import BaseClass
from ..optimization import SimulAnneal as _SimulAnneal
from siriuspy.devices import PowerSupply, Tune
... |
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import BatteryState
from std_msgs.msg import String
class DummyBattery(object):
"""
Publishes a dummy battery message which charges or discharges based on current topoligcal noe
"""
def __init__(self):
super(DummyBattery, self).__init__(... |
# -*- coding: UTF-8 -*-
""" ClassUtil.py
Provides quick routines for obtaining the class names
of an object and its parent classes.
Copyright (c) 2004 Jason R. Coombs
"""
__author__ = 'Jason R. Coombs <jaraco@jaraco.com>'
__version__ = '$Rev$'[6:-2]
__svnauthor__ = '$Author$'[9:-2]
__date__ = '$Date$... |
import datetime
from six import string_types
from cfn_sphere.template import CloudFormationTemplate
try:
from unittest2 import TestCase
from mock import Mock
except ImportError:
from unittest import TestCase
from mock import Mock
class CloudFormationTemplateTests(TestCase):
def test_get_templat... |
from datetime import datetime
from io import StringIO
from textwrap import dedent
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
option_context,
to_datetime,
)
def test_repr_embedded_ndarray():
arr = np.empty(10, dtype=[("err", object)])
for i in range(len(arr)):
... |
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
"""
This file contains implementation of data model for physical router
configuration manager
"""
from physical_router_config import PhysicalRouterConfig
from physical_router_config import JunosInterface
from physical_router_config import PushConfigS... |
import os
import time
import ujson
import smtplib
import re
from django.conf import settings
from django.test import override_settings
from mock import patch, MagicMock
from typing import Any, Callable, Dict, List, Mapping, Tuple
from zerver.lib.email_mirror import RateLimitedRealmMirror
from zerver.lib.email_mirror_... |
""" Tests from Michael Wester's 1999 paper "Review of CAS mathematical
capabilities".
http://www.math.unm.edu/~wester/cas/book/Wester.pdf
See also http://math.unm.edu/~wester/cas_review.html for detailed output of
each tested system.
"""
import os
from itertools import islice, takewhile
import mpmath
from mpmath impo... |
"""
module for generating C, C++, Fortran77, Fortran90 and Octave/Matlab routines
that evaluate diofant expressions. This module is work in progress. Only the
milestones with a '+' character in the list below have been completed.
--- How is diofant.utilities.codegen different from diofant.printing.ccode? ---
We con... |
from framework import request, push_status_message
from framework.auth import must_have_session_auth
from ..decorators import must_not_be_registration, must_be_valid_project, must_be_contributor
from framework.forms.utils import sanitize
from .node import _view_project
from .. import clean_template_name
import os
im... |
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
import nibabel as nib
import numpy.linalg as npl
from scipy.stats import t as t_dist
from nilearn import image
from nilearn.plotting import plot_stat_map
from scipy.ndimage import gaussian_filter
""" Linear_modeling.py
We are going... |
# -*- coding: utf-8 -*-
"""
========================
Fits Table example
========================
Demonstrates `astropy.utils.data` to download the file, `astropy.io.fits` to open
and view the file, `matplotlib` for making plots.
"""
# Code source: Lia R. Corrales
# License: BSD
import numpy as np
#################... |
from plplot_py_demos import *
# main
#
# Displays Greek letters and mathematically interesting Unicode ranges
Greek = (
"#gA","#gB","#gG","#gD","#gE","#gZ","#gY","#gH","#gI","#gK","#gL","#gM",
"#gN","#gC","#gO","#gP","#gR","#gS","#gT","#gU","#gF","#gX","#gQ","#gW",
"#ga","#gb","#gg","#gd","#ge","#gz","#gy","#gh","#gi... |
#!/usr/bin/python3
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/srv/interact/")
from run import app as application
|
# Copyright (c) 2022, Manfred Moitzi
# License: MIT License
from pathlib import Path
import subprocess
import shlex
import shutil
import sys
PYTHON3 = "python"
POSIX = sys.platform != "win32"
if POSIX:
PYTHON3 = shutil.which("python3")
def main():
filepath = Path(__file__)
for script in filepath.parent... |
'''Process member's mailing list email bounces by logging into the mail server
mailbox which receives the bounces, inspecting the bounced mails,
and unsubcribing the members associated with the bounced mails.
Also deletes over-quota and holiday replies from the mailbox.
invoke with python2 mailoutomatic.py
'''
import o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utility script to create a pypi-like directory structure (localpi)
from a number of Python packages in a directory of the local filesystem.
DIRECTORY STRUCTURE (before):
+-- downloads/
+-- alice-1.0.zip
+-- alice-1.0.tar.gz
+-- ... |
#!usr/bin/python
import os
import numpy as np
import common
from interpret import qcfile, funcfile, analyzefiles
def runAll(args):
print('\n\n\nYou have requested to analyze CNV call data')
print('\tWARNING:')
print('\t\tIF USING ANY REFERENCES OTHER THAN THOSE I PROVIDE I CANNOT GUARANTEE RESULT ACCURACY... |
#!/usr/bin/python
import argparse
import pandas as pd
import json
import sys
#Input
#1. PATRIC (Gene Matrix || Gene List) in csv, tsv, xls, or xlsx formats
#2. (optional) PATRIC (Metadata template) in csv, tsv, xls, or xlsx formats
#3. trasformation metadata in json string with the following:
#{source_id_type:"refs... |
"""
Generalized linear models currently supports estimation using the one-parameter
exponential families
References
----------
Gill, Jeff. 2000. Generalized Linear Models: A Unified Approach.
SAGE QASS Series.
Green, PJ. 1984. "Iteratively reweighted least squares for maximum
likelihood estimation, and some ... |
from __future__ import print_function
from datetime import datetime
import fcntl
import json
import logging
import os
import pwd
import re
import signal
import socket
import struct
import string
import subprocess
import sys
import time
import pymysql
import consul as pyconsul
import manta
logging.basicConfig(format='... |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from bitsharesbase import operations
from .account import Account
from .amount import Amount
from .asset import Asset
from .instance import BlockchainInstance
from .price import FilledOrder, Order, Price
from .utils import assets_from_string, formatTime... |
#!/usr/bin/env python
"""
# waterfall.py
Python class and command line utility for reading and plotting waterfall files.
This provides a class, Waterfall(), which can be used to read a blimpy file (.fil or .h5):
fil = Waterfall("test_psr.fil")
print(fil.header)
print(fil.data.shape)
print(fil.freqs)... |
#
# Copyright (c) 2004-2007 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/perma... |
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from mock import Mock, patch
from projects.models import Project
from challenges.models import Challenge, Submission, ... |
import os
import re
import datetime
import pdb
import logging
import copy
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import Group,User,Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions imp... |
'''
Functions related to creating repodata index files.
The way the icons work is the following:
1. the iconda image is always stored in a file named info/icon.png
inside the conda-package.
2. when the index (repodata.json) is created this file is read, and
instead of encoding the icons content in the re... |
import hashlib
import operator
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.utils import truncate_name
from django.db.models.fields.related import ManyToManyField
from django.db.transaction import atomic
from django.utils.encoding import force_bytes
from django.utils.log import ... |
# coding=utf-8
from __future__ import absolute_import, unicode_literals
from pprint import pprint
from django.conf import settings
from django.contrib.auth.models import UserManager, AbstractBaseUser, PermissionsMixin
from django.core import validators
from django.core.mail import send_mail
from django.db import mode... |
# -*- coding: utf-8 -*-
"""
file: graph_mixin.py
Defines an abstract base class for node and edge tool classes that are used for
dynamic (ORM based) Graph class creation.
Node and Edge tools are used when traversing a graph returns single nodes and
single edges.
"""
import abc
class NodeEdgeToolsBaseClass(object):... |
#!/usr/bin/env python
# To install dependencies, see https://github.com/timrdf/DataFAQs/wiki/Errors
import sys
from rdflib import *
from surf import *
from surf.query import a, select
import rdflib
rdflib.plugin.register('sparql', rdflib.query.Processor, 'rdfextras.sparql.processor', 'Processor')
rdflib.plugin.regi... |
import sys
import logging
import os.path
import shlex
import traceback
import lldb
from . import debugevents
from . import handles
from . import terminal
from . import PY2
log = logging.getLogger('debugsession')
class DebugSession:
def __init__(self, event_loop, send_message):
DebugSession.current = self... |
#!/usr/bin/env python
#
# Copyright (C) 2010-2011 Hideo Hattori
# Copyright (C) 2011-2013 Hideo Hattori, Steven Myint
#
# 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, in... |
#!/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wait... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import textwrap
import numpy as np
import pytest
from astropy.io import fits
from astropy.nddata.nduncertainty import (
StdDevUncertainty, MissingDataAssociationException, VarianceUncertainty,
InverseVariance)
from astropy import units as u
from... |
#!/usr/bin/env python
import sys, os, time, socket
PORT = 1337
SAMPLES = 3
freqs = [ 30, 48, 60, 72, 84, 96, 120, 132, 144, 156, 168, 180, 192, 204,
216, 240, 264, 288, 336, 360, 384, 408, 480, 528, 600, 648, 672, 696,
720, 744, 768, 816, 864, 912, 960, 1008 ]
def server():
print "server"
s = socket.socket(soc... |
#
# 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... |
import sys
import warnings
from collections import defaultdict
from twisted.application import service
from twisted.application.service import Service
from twisted.python import log
from twisted.python.failure import Failure
from twisted.internet import reactor
from twisted.internet.defer import DeferredQueue, Deferre... |
from __future__ import print_function
import sys
import warnings
from collections import defaultdict
from twisted.application import service
from twisted.application.service import Service
from twisted.python import log
from twisted.python.failure import Failure
from twisted.internet.defer import DeferredQueue, Defer... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2017 by Brendt Wohlberg <brendt@ieee.org>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""Dictionary learning based ... |
"""
Injections.py handles injections into various configuration files
throughout files on the file system.
These operations are batched and applied together with the commit
command, or applied separately with the destructive_inject and
destructive_clear..
"""
import logging
import os
import re
class Injections(obje... |
# encoding: utf8
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version... |
"""Test the 20news downloader, if the data is available."""
import numpy as np
from nose.tools import assert_equal
from nose.plugins.skip import SkipTest
from scikits.learn import datasets
def test_20news():
try:
data = datasets.fetch_20newsgroups(subset='all',
download_if_missing=... |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... |
#!/usr/bin/python
"""Script to poll metrics from MySQL Database and push them to Wavefront."""
from __future__ import print_function
import os
import sys
import re
import time
import datetime
import socket
import signal
import itertools
import mysql.connector
from wavefront_sdk.client_factory import WavefrontClientF... |
"""
High-level python bindings for Zarafa
Copyright 2014 Zarafa and contributors, license AGPLv3 (see LICENSE file for details)
Some goals:
- To be fully object-oriented, pythonic, layer above MAPI
- To be usable for many common system administration tasks
- To provide full access to the underlying MAPI layer if nee... |
#!/usr/bin/env python3
# coding=utf-8
import os
import sys
import re
import copy
import zlib
import sched
import queue
import base64
import random
import traceback
import ipaddress
import threading
from fnmatch import fnmatch
from time import time, sleep, process_time
from html import escape as html_escape
from dateti... |
# encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import unicode_literals
from collections import namedtuple
import json
import pytablewriter as ptw
import pytest
from pytablereader import (
TableData,
InvalidDataError,
TableItemModifier
)
try:
import... |
#! /usr/bin/env python
# $Header$
'''Typecodes for dates and times.
'''
from ZSI import _copyright, _floattypes, _inttypes, EvaluateException
from ZSI.TC import TypeCode
import operator, re, time
_niltime = [
0, 0, 0, # year month day
0, 0, 0, # hour minute second
0, 0, 0 # weekday, julian day, ... |
from setuptools import setup, find_packages
import sys, os
version = '4.0.0'
setup(name='zstacklib',
version=version,
description="Python support library for zstack",
long_description="""\
Python support library for zstack""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 12/10/2016 1:01 PM
# @Author : Max
# @File : env_release.py.py
DEBUG = False
WORK_PATH = '/root/flask_proj/webapp/'
|
#
# 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... |
from Urutu import *
import numpy as np
@Urutu("gpu")
def math(a, b, c, d, e, f):
__shared is x , y
x[tx] = a[tx]
y[tx] = b[tx]
c[tx] = x[tx] + y[tx] + 1
d[tx] = 2*x[tx] - y[tx]
f[tx] = 1.0345*x[tx] - 2*y[tx]
return c, d, e, f
a = np.random.randint(10, size = 100)
b = np.random.randint(10, size = 100)
c = np.em... |
import contextlib
import os
import os.path
import re
import shutil
import tempfile
from httpretty import HTTPretty
import mock
def get_test_file_path(file_path):
"""translates a file path to be relative to the test files directory"""
return os.path.join(os.path.dirname(__file__), 'files', file_path)
@conte... |
import random
import sys
def subnet_calc():
try:
print "\n"
#Get IP address and check if valid
while True:
ip_address = raw_input("Enter an IP address: ")
#evaluate each octet
a = ip_address.split('.')
... |
# CamJam EduKit 3 - Robotics
# Worksheet 6 – Measuring Distance
import RPi.GPIO as GPIO # Import the GPIO Library
import time # Import the Time library
# Set the GPIO modes
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# Define GPIO pins to use on the Pi
pinTrigger = 17
pinEcho = 18
print("Ultrasonic Measurement")
#... |
from anki.hooks import addHook
from aqt import mw
from ir.util import addMenuItem, addShortcut, viewingIrText
class ViewManager():
def __init__(self):
self.previousState = None
addHook('afterStateChange', self.resetZoom)
mw.web.page().scrollPositionChanged.connect(self.saveScroll)
de... |
#
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2016
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... |
import priorityQ as pq
import sys
import pytest
class StackTest():
def test_init(self):
queue = pq.Priority()
assert type(queue) == pq.Priority
def test_insert(self):
self.assertEqual(self.append.item)
def test_pop(self):
self.asserEqual(self.pop.item)
self.asser... |
import os
import tempfile
import six
import unittest
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, BASE_DIR)
from app import create_app
from app.models import db, users, Role
from flask_security.utils import encrypt_password
from lxml import etree
with open(BASE_DIR + '... |
import unittest
from mock import patch, MagicMock, Mock
from DatabaseHandler import DatabaseHandler
from DataGeneration.MapLocation import MapLocation
import os
class TestDatabaseHandler(unittest.TestCase):
def tearDown(self):
if os.path.exists('unit_test_db.sqlite3'):
os.remove('unit_test_db... |
import pytest
from src.bst import Bst, Node
from src.trie import Trie
# BST Fixtures
@pytest.fixture
def bst_root_fifty():
test_tree = Bst()
test_tree.insert(50)
test_tree.insert(25)
test_tree.insert(100)
test_tree.insert(12)
test_tree.insert(35)
test_tree.insert(75)
test_tree.insert(15... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import pytest
import betamax
import dataset
from scrapy.http import Request, HtmlResponse
from collectors.base import config, helpers
... |
import os
import pytest
from user_sync.config.user_sync import UserSyncConfigLoader
import shutil
@pytest.fixture
def fixture_dir():
return os.path.abspath(
os.path.join(
os.path.dirname(__file__), 'fixture'))
@pytest.fixture
def cli_args():
def _cli_args(args_in):
"""
... |
import json
import os
from unittest import mock
import pytest
from condor.config import DEFAULT_DB_PATH
from condor.models.base import DeclarativeBase
from sanic.testing import SanicTestClient
from sqlalchemy import create_engine
from sqlalchemy.orm.session import Session
class DecoratedResponse(object):
def __... |
import json
import pytest
from rohrpost.mixins import PushNotificationOnChangeModelMixin
class ReplyChannel:
def __init__(self):
self.data = []
self.closed = False
def send(self, message_dict):
if not self.closed:
self.data.append(json.loads(message_dict.get('text')))
... |
#
# Copyright (c) 2006 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licen... |
import logging
import os.path
from pytest import fixture
from morepath.request import BaseRequest
from webtest import TestApp as Client
from ekklesia_portal.app import make_wsgi_app
from ekklesia_portal.identity_policy import UserIdentity
from ekklesia_portal.request import EkklesiaPortalRequest
from ekklesia_portal.da... |
#!/usr/bin/env python
import socketio
import eventlet
import eventlet.wsgi
import time
from flask import Flask, render_template
from bridge import Bridge
from conf import conf
sio = socketio.Server()
app = Flask(__name__)
bridge = Bridge(conf)
msgs = []
dbw_enable = False
@sio.on('connect')
def connect(sid, enviro... |
from django.forms import forms
from south.modelsinspector import add_introspection_rules
from validatedfile.fields import ValidatedFileField
class RWValidatedFileField(ValidatedFileField):
"""
Same as FileField, but you can specify:
* content_types - list containing allowed content_types.
Exa... |
# coding=utf-8
# Copyright 2018 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 agreed ... |
# encoding: UTF-8
from __future__ import with_statement
from django.db.models import Q, Sum
from django.core.management.base import BaseCommand
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
import codecs
import csv... |
#!/usr/bin/python2
from jira import JIRA
import json
import re
import os
import sys
# Sandbox server
server = 'https://dev-projects.linaro.org'
# Production server, comment out this in case you want to use the real server
#server = 'https://projects.linaro.org'
try:
username = os.environ['JIRA_USERNAME']
pa... |
import logging
import urllib2
from urllib import urlencode
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.test.client import Client
from django.test.testcases import TestCase
from metashare import test_utils
from metashare.accounts.models import EditorGroup, EditorGroupManagers
from metasha... |
"""Train a policy with behavioural cloning."""
import functools
import gzip
import os
import sys
import time
# TODO: replace dill with cloudpickle (that's what SB uses, so I don't have to
# introduce another dep)
import click
import dill
import gym
from imitation.algorithms.bc import BCTrainer
from imitation.util impo... |
"""
This file contains python3.6+ syntax!
Feel free to import and use whatever new package you deem necessary.
"""
import os
import sys
import asyncio
import argparse
import signal
import typing
from mitmproxy.tools import cmdline
from mitmproxy import exceptions, master
from mitmproxy import options
from mitmproxy i... |
import imghdr
import json
import os.path
import posixpath
import string
import uuid
from copy import copy
from datetime import datetime
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.safestring import mark_safe
import bleach
import commonwa... |
__version__ = '0.8.3'
|
from sqlalchemy import Column, Integer, String, DateTime, text, ForeignKey, func, create_engine
from sqlalchemy.ext.declarative import declarative_base
from configparser import ConfigParser
import re
from requests import get, HTTPError
from bs4 import BeautifulSoup
from sqlalchemy.orm import sessionmaker
import os, sys... |
"""Basic collect and runtest protocol implementations."""
import bdb
import os
import sys
import warnings
from typing import Callable
from typing import cast
from typing import Dict
from typing import Generic
from typing import List
from typing import Optional
from typing import Tuple
from typing import Type
from typin... |
# Copyright 2018 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 datetime import time, datetime
from shortcuts import ShortcutTestCase
from courses import models
from courses.tests.factories import (
SemesterFactory, DepartmentFactory, SemesterDepartmentFactory,
CourseFactory, OfferedForFactory, SectionPeriodFactory,
SectionFactory
)
################# API 4 #####... |
from haystack import indexes
from packages.models import Package
class PackageIndex(indexes.RealTimeSearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
name = indexes.CharField(model_attr="name", boost=1.5)
summary = indexes.CharField(null=True)
downloads = inde... |
#!/usr/bin/python
# Copyright 2015 Google 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 app... |
# Copyright 2018 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 __future__ import print_function
import threading
import logging
from multiprocessing.connection import Listener
import select
from DotStar_Emulator.emulator import config, globals
log = logging.getLogger("data")
__all__ = ["TCPReader", ]
class TCPReader(threading.Thread):
def __init__(self):
"""
... |
from pola import logic, logic_ai
from django.http import JsonResponse, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from product.models import Product
from pola.models import Query
from report.models import Report, Attachment
from ai_pics.models import AIPics, AIAttachment
from django.conf... |
'''
The modelmanager settings module contains everything concerning the setup,
management and validation of the project settings defined in the settings
.mm/settings.json file.
'''
import sys
import json
import os.path as osp
from glob import glob
import inspect
import types
import traceback
import re
import functools... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.