text stringlengths 475 200k |
|---|
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Employee Directory',
'version': '1.1',
'author': 'OpenERP SA',
'category': 'Human Resources',
'sequence': 21,
'website': 'https://www.odoo.com',
'summary': 'Jobs, Departments, Emplo... |
import miniuadrvr
import unittest
import os
import time
import thread
SCSPROXY1=SCSPROXY2=SCSPROXY3=SCSPROXY4="192.168.10.23"
ALTPROXY=ALTREGISTRAR="192.168.10.31"
USERNAME1="3001"
USERID1=USERID2=USERID3=USERID4="stepmind"
REALM1=REALM2=REALM3=REALM4="stepmind.com"
PROXY1=PROXY2=PROXY3=PROXY4=SCSPROXY1
REGISTRAR1... |
# -*- coding: utf-8 -*-
import threading
import time
import unittest
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from app import create_app, db
from app.models import Category, User
from fixtures import create_item, create_message
class SeleniumTestCas... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="line", parent_name="scatterternary.marker", **kwargs
):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... |
#
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB ([EMAIL]... |
########################################################################
#
# University of Southampton IT Innovation Centre, 2011
#
# Copyright in this library belongs to the University of Southampton
# University Road, Highfield, Southampton, UK, SO17 1BJ
#
# This software may not be used, sold, licensed, transferred,... |
"""
Copyright (c) 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
import os
from atomic_reactor.constants import (
DEFAULT_DOWNLOAD_BLOCK_SIZE,
PLUGIN_PUSH_OPE... |
#!/usr/bin/env python3
# coding: utf-8
from __future__ import unicode_literals
import os
import re
import textwrap
from molbiox.frame import interactive
from molbiox.frame.locate import locate_template
from zombies.educational.compat_ import zrange
class MetaParser(object):
def feed(self, line):
keywor... |
# Copyright (c) 2011-2014 Greg Holt
# Copyright (c) 2012-2013 Peter Portante
# Copyright (c) 2012 Iryoung Jeong
# Copyright (c) 2012 Michael Barton
# Copyright (c) 2013 Alex Gaynor
# Copyright (c) 2013 Chuck Thier
# Copyright (c) 2013 David Goetz
# Copyright (c) 2015 Donagh McCabe
# Copyright (c) 2013 Greg Lange
# Copy... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import math
# Import stuff for working with dates
from datetime import datetime
from matplotlib.dates import date2num, num2date
# Github has a "traffic" page now, but it doesn't seem like you can
# put in an arbitrary date range? When I looked ... |
# Copyright (c) 2007 The Hewlett-Packard Development Company
# Copyright (c) 2015 Advanced Micro Devices, Inc.
#
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to int... |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# 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/
#
# Softwa... |
try:
from builtins import object
except ImportError:
pass
from .utils import Stuff
from .test_graphviz import TestDiagrams, TestDiagramsNested
from transitions.extensions.states import add_state_features, Timeout, Tags
from unittest import skipIf
try:
# Just to skip tests if graphviz not installed
imp... |
"""
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.
"""
import logging
import unittest
from datetime import datetime, timedelta
import pytz
from django.conf import settings
from django.test im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
def traverse_diagonally(a, i, j, m, n):
x = a[i][j]
for i, j in zip(range(i, m), range(j, n)):
if a[i][j] != x:
return False
return True
def is_toeplitz(a):
m = len(a)
n = len(a[0])
for i in range(m):
j = 0
... |
from __future__ import generators
__metaclass__ = type
import logging
_logger = logging.getLogger("rdflib.store._sqlobject")
import re
_literal = re.compile(r'''"(?P<value>[^@&]*)"(?:@(?P<lang>[^&]*))?(?:&<(?P<datatype>.*)>)?''')
from urllib import quote, unquote
from rdflib.store import Store
from rdflib.Literal ... |
#############################################################################
## ##
## This file is part of Owade : www.owade.org ##
## Offline Windows Analyzer and Data Extractor ##
## ... |
# -*- coding: utf-8 -*-
import time
from openerp import api, fields, models, _
from openerp.osv import expression
from openerp.exceptions import RedirectWarning, UserError
from openerp.tools.misc import formatLang
from openerp.tools import float_is_zero
from openerp.tools.safe_eval import safe_eval
#----------------... |
from flask import Flask
from flask import render_template
from flask import request
import json
import datetime
import dateparser
import string
import dbconfig
if dbconfig.test:
from mockdbhelper import MockDBHelper as DBHelper
else:
from dbhelper import DBHelper
app = Flask(__name__)
DB = DBHelper()
catego... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:[EMAIL] on web
# create time: 2017/8/21
import os
import datetime
from flask import render_template, request, flash, abort, jsonify, session
from app.decorate import admin_login, admin_permission
from app.forms.service import DocumentCategoryForm, DocumentForm, FaqC... |
# Principal Component Analysis Code :
from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud
from pylab import *
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy.ndimage as ni
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import ro... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2019 Philipp Wolfer
#
# 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 Licen... |
"""
Contains utils for:
Matching first item in a list that matches some predicate.
Mutex
XML parser/generator that handles unknown entities.
Controlling recursion depth
"""
import errno
import os
import tempfile
import threading
import time
import urlparse
import urllib
from contextlib import contextmanager
from hashl... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... |
from collections import OrderedDict
from datetime import timedelta
import django.utils.timezone
import sal.plugin
class NewMachines(sal.plugin.Widget):
description = 'New machines'
def _get_range(self):
today = django.utils.timezone.now() - timedelta(hours=24)
ranges = OrderedDict(Today=to... |
from fs.multifs import MultiFS
from fs.memoryfs import MemoryFS
import unittest
from six import b
class TestMultiFS(unittest.TestCase):
def test_auto_close(self):
"""Test MultiFS auto close is working"""
multi_fs = MultiFS()
m1 = MemoryFS()
m2 = MemoryFS()
multi... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from hashlib import sha1
from future.utils import PY3
from pants.base.payload_field imp... |
# object_store.py -- Object store for git objects
# Copyright (C) 2008-2009 Jelmer Vernooij <[EMAIL]>
#
# 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
# or (at your option) a l... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""Simple caching functionality using decorated functions.
Cached values are stored in a dicitonary. The keys are generated by a callable
given to the decorator. This can e.g. be used to cache expensive calculations
that depend on an object's state. In that case, the key ge... |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
"""Ubuntu Touch App Autopilot tests."""
import os
import ubuntuuitoolkit
from autopilot import introspection
from autopilot.matchers import Eventually
from testtools.matchers import Equals
from ubuntuuitoolkit import base
PACKAGE_ID = 'pus... |
"""Clustering indexes are covert in this script."""
import numpy as np
import distances as dist
class FormatPoint(object):
"""This class only adapts the given point to a point like DBScan."""
def __init__(self, Coords, ClusterId):
self.Coords = Coords
self.ClusterId = ClusterId
def centro... |
"""Axis binary sensor platform tests."""
from homeassistant.components.axis.const import DOMAIN as AXIS_DOMAIN
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_MOTION,
DOMAIN as BINARY_SENSOR_DOMAIN,
)
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.setup import async_se... |
#!/bin/env python3
#
# Copyright 2017 Red Hat
#
# 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 agre... |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <[EMAIL]>
# Copyright 2007 Kenneth Loafman <[EMAIL]>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the... |
# Write the benchmarking functions here.
# See "Writing benchmarks" in the asv docs for more information.
# sequence based similarity measures
from py_stringmatching.similarity_measure.affine import Affine
from py_stringmatching.similarity_measure.bag_distance import BagDistance
from py_stringmatching.similarity_measu... |
"""
.. module:: iNET
:platform: Unix, Windows
:synopsis: Class to construct and de construct iNET Packets
.. moduleauthor:: Diarmuid Collins <[EMAIL]>
"""
__author__ = "Diarmuid Collins"
__copyright__ = "Copyright 2018"
__maintainer__ = "Diarmuid Collins"
__email__ = "[EMAIL]"
__status__ = "Produc... |
#!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
if __name__ == '__main__':
sys.path.append(
os.path.abspath(os.path.join(os.path.dirnam... |
# -*- coding: utf-8 -*-
""" HMS Hospital Status Assessment and Request Management System
@author: nursix
"""
module = "hms"
if deployment_settings.has_module(module):
# -------------------------------------------------------------------------
# Hospitals
#
# Use government-assigned UUIDs inste... |
"""
SocksiPy - Python SOCKS module.
Version 1.5.0
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... |
html_doc= """<html><head><title>The Dormouse's story</title></head> <body>
<p class="title"><b>The Dormouse's story</b></p>
<p class="story">Once upon a time there were three little sisters; and their names were
<a href="http://example.com/elsie" class="sister" id="link1">Elsie</a>,
<a href="http://example.com/lacie" c... |
import pytest
from pocs.camera.simulator import Camera as SimCamera
from pocs.camera.sbig import Camera as SBIGCamera
from pocs.camera.sbigudrv import SBIGDriver, INVALID_HANDLE_VALUE
from pocs.focuser.simulator import Focuser
from pocs.scheduler.field import Field
from pocs.scheduler.observation import Observation
fr... |
"""
Mozilla Persona authentication backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/persona.html
"""
from ..utils import handle_http_errors
from .base import BaseAuth
from ..exceptions import AuthFailed, AuthMissingParameter
class PersonaAuth(BaseAuth):
"""BrowserID authenticatio... |
#!/usr/bin/env python
# Copyright 2021 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... |
"""
Build the zipped robofab + dependency distros for RoboFab.
Check out fresh copies of the code from SVN.
Compile into zips.
Write optional html page.
"""
import os, glob, time
def getRevision(url):
""" Ask svn for the revision."""
cmd = "svn info \"%s\""%url
d = os.popen(cmd... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from ast import literal_eval
from odoo import api, fields, models
from pytz import timezone, UTC, utc
from datetime import timedelta
from odoo.tools import format_time
class HrEmployeeBase(models.AbstractModel):
... |
import os
import sys
import argparse
import datetime
import pytz
from twinkerer import Twinkerer, post
from twinkerer import twitterapi
class DateStringAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
formats_ = [
'%Y-%m-%d',
'%Y/%m/%d',
... |
import logging
from dateutil import parser
import math
import json
from get_database import get_mode_db, get_section_db
from datetime import datetime, timedelta
from userclient import getClientSpecificQueryFilter
import stats
import time
# TODO: Argh! Until now, we just had the data collector import the webapp.
# Now ... |
# Copyright 2016 Intel Corporation
#
# Copyright 2013 International Business Machines Corporation
# All Rights Reserved.
# Copyright 2016 Intel Corporation
#
# 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 c... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:/Projects/QtCreator/DDA_UIs/TunnelSelection.ui'
#
# Created: Thu Aug 15 13:29:56 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = Q... |
"""Contains the audio featurizer class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from data_utils import utils
from data_utils.audio import AudioSegment
class AudioFeaturizer(object):
"""Audio featurizer, for extracting feat... |
from django.db import models
# Create your models here.
class VariSNP(models.Model):
"""
Description:
benchmark database for neutral variations from dbSNP
"""
dbsnp_id = models.CharField(max_length=255)
# heterozygosity
# heterozygosity_standard_error
# creation_date
# creation_... |
from tsanet import TsaHost
def iperf(src, dst, duration=10):
output = 'output/iperfclientTCP-{src}-{dst}.txt'.format(src=src.name, dst=dst.name)
cmd = 'iperf -c {ip} -t {duration}'.format(
ip=dst.IP(), duration=duration, output=output)
print "host {src} cmd {cmd}".format(src=src.name, cmd=cmd)
... |
################################################################################
# MIT License
#
# Copyright (c) 2017 Jean-Charles Fosse & Johann Bigler
#
# 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 t... |
from chatterbot.logic import LogicAdapter
class SpecificResponseAdapter(LogicAdapter):
"""
Return a specific response to a specific input.
:kwargs:
* *input_text* (``str``) --
The input text that triggers this logic adapter.
* *output_text* (``str``) --
The output text... |
import logging
from pprint import pprint as pp
import click
from flask.cli import with_appcontext
from scout.server.extensions import store
LOG = logging.getLogger(__name__)
@click.command("groups", short_help="Update phenotype groups for an institute")
@click.argument("institute-id")
@click.option(
"-p",
... |
# Standard imports
import unittest
import datetime as pydt
import logging
import json
# Our imports
import emission.core.get_database as edb
import emission.net.usercache.abstract_usercache as enua
import emission.storage.timeseries.abstract_timeseries as esta
import emission.storage.pipeline_queries as epq
import emi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Common functions
import os, sys
import requests
from bs4 import BeautifulSoup
lib_path = os.path.abspath( os.path.join( '..', '..', 'lib' ) )
sys.path.append(lib_path)
from commons import *
from overpasser import *
from routing import *
from feriados import *
from make_json... |
#!/usr/bin/env python2
"""
ExtinctioRecallTask_PresetTiming.py
Display images from a specified folder and present them to the subject, rating the images on given scales.
Also present rest periods, sound checks, and mood ratings to the subject in between runs.
Created 8/21/18 by DJ.
Updated 8/29/18 by DJ - added parall... |
# LIBTBX_SET_DISPATCHER_NAME dev.dials.generate_tutorial_text
import functools
import os
import sys
import tempfile
import time
from optparse import SUPPRESS_HELP, OptionParser
import procrunner
import py
import dials.util
import dials_data.download
def _command_runner(
command, output_directory=None, store_c... |
from gen import *
########
# Main #
########
flow_var[0] = """
(declare-fun tau () Real)
(declare-fun r () Real)
(declare-fun psi () Real)
(declare-fun phi () Real)
(declare-fun p () Real)
(declare-fun gRDR () Real)
(declare-fun gAIL () Real)
(declare-fun beta () Real)
(declare-fun xAIL () Real)
(declare-fun xRDR ()... |
""" API v0 views. """
import logging
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from rest_framework.generics import GenericAPIView
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from lms.djangoapps.certificates.api import get... |
"""
The following operators are understood:
~q Request
~s Response
Headers:
Patterns are matched against "name: value" strings. Field names are
all-lowercase.
~a Asset content-type in response. Asset content types are:
... |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... |
# Copyright 2015 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 writing, ... |
melody_pad_pattern = {
"Center+Halfmoon-Alt-LR": [4, 0, 1, 2, 3, 5, 12, 6, 11, 7, 10, 8, 9],
"Center+Halfmoon-Alt-LR (no M5)": [0, 1, 2, 3, 5, 12, 6, 11, 7, 10, 8, 9],
"Center+Halfmoon-Alt-LR (no M5,M1,M2)": [2, 3, 5, 12, 6, 11, 7, 10, 8, 9],
"Center+Halfmoon-Alt-LR (Handpan style)": [0, 1, 2, 3, 5, 1... |
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailsearch import urls as wagtailsearch_urls
from wagtail.wagtaildocs import urls as wagtaild... |
'''
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
send a message to the topic's listeners via a publish() method.
:copyright: Copyright 2006-2009 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE.txt for details... |
# styled text using wxPython's
# wx.StyledTextCtrl(parent, id, pos, size, style, name)
# set up for folding and Python code highlighting
# source: Dietrich 16NOV2008
# http://www.python-forum.org/pythonforum/viewtopic.php?f=2&t=10065#
import keyword
import logging
import wx
import wx.stc as stc
from wx.lib.pubsub i... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... |
#!/usr/bin/python2
import smtplib
from datetime import datetime
import os.path
import sys
import gdata.data
import gdata.docs.data
import gdata.docs.client
import ConfigParser
from twython import Twython
import twitter
class MotionUploader:
def __init__(self, config_file_path):
# Load config
... |
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.management import call_command
from django_hats.roles import RoleFinder
from tests import RolesTestCase
from tests.roles import GeneticCounselor,... |
# curio/network.py
#
# Copyright (C) 2015
# David Beazley (Dabeaz LLC)
# All rights reserved.
#
# Some high-level functions useful for writing network code. These are largely
# based on their similar counterparts in the asyncio library. Some of the
# fiddly low-level bits are borrowed.
#
# Note: Not sure this modul... |
import os
from tenable_io.client import TenableIOClient
from tenable_io.exceptions import TenableIOApiException
def example(test_name, test_file):
# Generate unique file.
policy_name = test_name(u'my test policy')
test_file_output = test_file(u'my_exported_policy.tenable_io')
'''
Instantiate an... |
#!/usr/bin/env python
import argparse
import re
import json
import bz2
import pointpoly
# This can operate in two modes. If --split, it will generate separate
# TextDB files, one for each geographic region. If --lda, it will
# determine the distribution of topics in each geographic region.
# The arguments --spans, --... |
# 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.
import json
import logging
import re
import signal
import subprocess
import sys
import tempfile
from telemetry.internal.platform import profiler
from teleme... |
# This module provides standard support for "packages".
#
# The idea is that large groups of related modules can be placed in
# their own subdirectory, which can be added to the Python search path
# in a relatively easy way.
#
# The current version takes a package name and searches the Python
# search path for a direct... |
from flask import _request_ctx_stack as stack, request, abort
from werkzeug.local import LocalProxy
from functools import wraps
import jwt
from tenant import Tenant
def require_tenant(func):
@wraps(func)
def inner(*args, **kwargs):
assert tenant
return func(*args, **kwargs)
return inne... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.testutils import TestCase
class ReactPageViewTest(TestCase):
def test_redirects_unauthenticated_request(self):
owner = self.create_user("[EMAIL]")
org = self.create_organization(owner=owner)
... |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement, print_function
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <[EMAIL]>'
__docformat__ = 'restructuredtext en'
import sys, os, shutil, glob, py_compile, subprocess, re, zipfile, time, textwrap... |
from __future__ import absolute_import
from collections import namedtuple
from datetime import datetime, timedelta
import pytz
from casexml.apps.case.mock import CaseBlock
import uuid
from xml.etree import ElementTree
from corehq.apps.app_manager.const import USERCASE_TYPE
from corehq.apps.domain.models import Domain
f... |
# 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... |
import sys
from test import support
import unittest
from importlib import _bootstrap
from .. import util
from . import util as ext_util
@util.case_insensitive_tests
class ExtensionModuleCaseSensitivityTest(unittest.TestCase):
def find_module(self):
good_name = ext_util.NAME
bad_name ... |
#!/usr/bin/env python
import json
clist=[
'Cuba',
'Haiti',
'Dominican Republic',
'Puerto Rico',
'Jamaica',
'Trinidad and Tobago',
'Guadeloupe',
'Martinique',
'Bahamas',
'Barbados',
'Saint Lucia',
'Aruba',
'Saint Vincent and the Grenadines',
'United States Virgin Islands',
'Grenada',
'Antigua and Barbuda',
'Dominica',
... |
# -*- coding: utf-8 -*-
'''
Copyright (C) 2017 Rafael Picanço.
The present file is distributed under the terms of the GNU General Public License (GPL v3.0).
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
import... |
# Configuration file for ipengine.
c = get_config()
#------------------------------------------------------------------------------
# IPEngineApp configuration
#------------------------------------------------------------------------------
# IPEngineApp will inherit config from: BaseParallelApplication,
# BaseIPytho... |
# Modified version of:
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([EMAIL])
# The author disclaims copyright to this source code.
# This file is exempt from the license included with the rest of this software.
import sys
import struct
import socket
import time
import select
import re
import cod... |
"""Tests for transports.py."""
import unittest
from unittest import mock
import asyncio
from asyncio import transports
class TransportTests(unittest.TestCase):
def test_ctor_extra_is_none(self):
transport = asyncio.Transport()
self.assertEqual(transport._extra, {})
def test_... |
#!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import division
import math
from gnuradio import gr, gr_unittest, analog, blocks
def sincos(x):
return math.cos(x) + math.sin(x) * 1j... |
from django import forms, template
from django.forms.formsets import all_valid
from django.forms.models import modelform_factory, inlineformset_factory
from django.forms.models import BaseInlineFormSet
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin import widgets
from django.contri... |
# 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 the Li... |
# note: py.io capture tests where copied from
# pylib 1.4.20.dev2 (rev 13d9af95547e)
from __future__ import with_statement
import pickle
import os
import sys
import py
import pytest
import contextlib
from _pytest import capture
from _pytest.capture import CaptureManager
from _pytest.main import EXIT_NOTESTSCOLLECTED
f... |
import re
import sys
from typing import Iterator
from tools.base import checker
INVALID_REFLINK = re.compile(r".* ref:.*")
REF_WITH_PUNCTUATION_REGEX = re.compile(r".*\. <[^<]*>`\s*")
RELOADABLE_FLAG_REGEX = re.compile(r".*(...)(envoy.reloadable_features.[^ ]*)\s.*")
VERSION_HISTORY_NEW_LINE_REGEX = re.compile(r"\* (... |
from diofant import (And, Equality, MatrixSymbol, Mod, Or, Piecewise,
Unequality, Xor)
from diofant.abc import a, b, c, x
from diofant.printing.lambdarepr import NumPyPrinter
__all__ = ()
def test_numpy_piecewise_regression():
"""
Test that NumPyPrinter needs to print Piecewise()'s choi... |
import util as ut, glob, os, dset, box, img as ig, experiments, numpy as np, scipy.io, camo, copy, rotation, mvg, imtable, iputil as ip, pylab, planefit, glob, tour
# Code for generating the figures/videos in the paper and the talk
RESDIR_LOO = '/data/scratch/aho/camo-results/camera-ready-loo/loo'
RESDIR_NOLOO = '/da... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.