gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Uso'
db.create_table(u'indicador05_uso', (
(u... | |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import xml.etree.ElementTree as ET
from indra.assemblers.pysb import PysbAssembler
import indra.assemblers.pysb.assembler as pa
from indra.assemblers.pysb.assembler import Policy, Param
from indra.assemblers.pysb.pre... | |
#!/usr/bin/env python
from SocketServer import TCPServer, ThreadingMixIn, StreamRequestHandler
from digg.api import Digg
from time import time
from urlparse import urlparse
import simplejson as json
import textwrap
import urllib
import re
digg = Digg()
ADDRESS = 'synack.me\t70'
htmlpattern = re.compile('<[^>]+>')
def... | |
"""The ants module provides basic functions for interfacing with ants functions.
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
>>> os.chdir(... | |
'''
Created on Oct 14, 2014
@author: hijungshin
'''
import processframe as pf
import util
import sys
import cv2
from visualobjects import VisualObject
import meanshift
import numpy as np
from itertools import cycle
from video import Video
# import lecturevisual
def find_objects(panorama, list_of_objects):
fo... | |
from __future__ import absolute_import
from .testcases import DockerClientTestCase
from mock import patch
from fig.cli.main import TopLevelCommand
from fig.packages.six import StringIO
import sys
class CLITestCase(DockerClientTestCase):
def setUp(self):
super(CLITestCase, self).setUp()
self.old_sy... | |
from __future__ import annotations
import atexit
import datetime
import io
import logging
import os
import re
import sys
from python_utils import types
from python_utils.converters import scale_1024
from python_utils.terminal import get_terminal_size
from python_utils.time import epoch
from python_utils.time import f... | |
# Copyright (c) 2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
import logging
import random
import weakref
from zope import interface
from twisted.application import service, strports
from twisted.internet import error, defer, reactor, endpoints
from twisted.spread import pb
from twisted... | |
#
# 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... | |
#!/usr/bin/env python
import rospy
from autobot.msg import drive_param
from autobot.msg import wall_dist
from autobot.msg import pathFinderState
from autobot.msg import detected_object
from autobot.srv import *
from sensor_msgs.msg import Image
from pathFinder import PathConfig
from obstruction import *
from stopsign ... | |
import typing
import os
from mitmproxy.utils import emoji
from mitmproxy import ctx, hooks
from mitmproxy import exceptions
from mitmproxy import command
from mitmproxy import flow
from mitmproxy import optmanager
from mitmproxy import platform
from mitmproxy.net import server_spec
from mitmproxy.net.http import stat... | |
# Copyright (c) 2017 Cisco Systems 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 re... | |
#!/usr/bin/python
#
# bsg_booth_4_block_gen < number of continuous rows of 4 partial products >
#
#
#
# This script generates sections of partial product arrays for use in
# multipliers. (See Computer Arthmetic Google Doc.)
#
#
#
#
import sys;
def emit_module_header (name, input_args, output_args) :
print "module... | |
__author__ = 'Michael Pryor'
if __name__ == '__main__':
import ConfigParser
import argparse
import datetime
import os
import logging
import sys
from logging import config
import bottle
parser = argparse.ArgumentParser(description='Twitter Project', argument_default=argparse.SUPPRES... | |
from __future__ import unicode_literals
import datetime
from decimal import Decimal
from django.core.paginator import Paginator
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils import unittest
from rest_framework import generics, status, pagination, filters, serializers
f... | |
# Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | |
# -*- test-case-name: calendarserver.webadmin.test.test_principals -*-
##
# Copyright (c) 2014-2015 Apple 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://... | |
"""Symbolic primitives + unicode/ASCII abstraction for pretty.py"""
import unicodedata
from ...core.alphabets import greeks
from ..conventions import split_super_sub
# first, setup unicodedate environment
def U(name):
"""Unicode character by name or None if not found."""
try:
u = unicodedata.lookup(... | |
from lxml import etree
from .box import *
from .table import *
__all__ = ('HTMLParser',)
def pumper(html_generator):
"""
Pulls HTML from source generator,
feeds it to the parser and yields
DOM elements.
"""
source = html_generator()
parser = etree.HTMLPullParser(
events=('start', ... | |
'''
Created on Feb 8, 2017
@author: hans-werner
'''
import matplotlib.pyplot as plt
from mesh import QuadCell, Cell, Interval
from function import Map, Constant, Nodal, Explicit
from matplotlib import colors as clrs
from matplotlib.patches import Rectangle
from matplotlib.collections import PatchCollection
from mpl_t... | |
# Copyright (C) 2009-2014 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided... | |
PostSynapticTemplateLibrary.register_template_specialisation( modelsrc='HULL10', synapsetype='MHR-dIN-Inhib',
template_type = PostSynapticMech_Exp2Syn_Base,
tau_open=1.5*ms, tau_close=30*ms, e_rev=-70*mV, popening=1.0, peak_conductance=0.5*nS,)
# tIN -> dIN
# ==============
def create_synapse_tIN_to... | |
#!/usr/bin/python
#
# Perforce Defect Tracking Integration Project
# <http://www.ravenbrook.com/project/p4dti/>
#
# COVERAGE.PY -- COVERAGE TESTING
#
# Gareth Rees, Ravenbrook Limited, 2001-12-04
# Ned Batchelder, 2004-12-12
# http://ned... | |
from __future__ import absolute_import, division, unicode_literals, print_function
import collections
import contextlib
import logging
import logging.handlers
import sys
import threading
import uuid
import warnings
#Support order in python 2.7 and 3
try:
from collections import OrderedDict
except ImportError:
... | |
"""
Implementation of JSONDecoder
"""
import re
import sys
from scanner import Scanner, pattern
try:
from _speedups import scanstring as c_scanstring
except ImportError:
pass
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
import struct
import sys
_BYTES = '7FF80000000000007F... | |
"""
Record Arrays
=============
Record arrays expose the fields of structured arrays as properties.
Most commonly, ndarrays contain elements of a single type, e.g. floats,
integers, bools etc. However, it is possible for elements to be combinations
of these using structured types, such as::
>>> a = np.array([(1, 2... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
from .linear import STTransform, NullTransform
from .chain import ChainTransform
from ._util import TransformCache
from ...util.event import E... | |
#!/usr/bin/env python
# Copyright (c) 2012, the GraphSpectrometer Contributors listed at
# http://github.com/ryanbressler/GraphSpectrometer/graphs/contributors
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | |
# Copyright (c) 2014 Mirantis, 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... | |
"""Models mixins for Social Auth"""
import base64
import time
import re
from datetime import datetime, timedelta
from openid.association import Association as OIDAssociation
from social_auth.utils import utc
# django.contrib.auth and mongoengine.django.auth regex to validate usernames
# '^[\w@.+-_]+$', we use the op... | |
"""
Tools for reading from the CELEX lexical database.
"""
# Copyright 2011-2013 Constantine Lignos
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicab... | |
''' Metrics for tracks, where tracks are arrays of points '''
from __future__ import division, print_function, absolute_import
from ..utils.six.moves import xrange
import numpy as np
from scipy.interpolate import splprep, splev
def winding(xyz):
'''Total turning angle projected.
Project space curve to best... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
"""
Inner products module
======================
Inner products between the truncated set of basis functions for the \
ocean and atmosphere streamfunction fields.
.. note :: These are calculated using the analytical expressions from \
De Cruz, L., Demaeyer, J. and Vannitsem, S.: A modular \
... | |
from __future__ import division
from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import scipy.sparse as sp
import os
import shutil
from tempfile import NamedTemporaryFile
import pytest
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.t... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
from six import string_types
import frappe, copy, json
from frappe import _, msgprint
from frappe.utils import cint
import frappe.share
rights = ("select", "read",... | |
from mock import Mock
from shapely.geometry import Point
import unittest2 as unittest
from molly.apps.common.components import LocalisedName, Identifier, Source, LocalisedNames, Identifiers
from molly.apps.places.models import PointOfInterest
from molly.apps.places.services import PointsOfInterest
class TestPointsOf... | |
from __future__ import unicode_literals
try:
from urllib.parse import parse_qs, urlencode, urlparse, quote, unquote
except ImportError:
from urllib import urlencode, quote, unquote
from urlparse import parse_qs, urlparse
from collections import namedtuple
import six
# To minimise memory consumption, we ... | |
import json
from datetime import datetime
import pytest
import requests_mock
from freezegun import freeze_time
from app import encryption
from app.celery.service_callback_tasks import (
send_complaint_to_service,
send_delivery_status_to_service,
)
from app.utils import DATETIME_FORMAT
from tests.app.db import... | |
# 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 applicab... | |
from __future__ import print_function
import requests
import json
import frappe
from six import iteritems, string_types
'''
FrappeClient is a library that helps you connect with other frappe systems
'''
class AuthError(Exception):
pass
class FrappeException(Exception):
pass
class FrappeClient(object):
def __init... | |
import pytest # pylint: disable=unused-import
import numpy as np
import xarray as xr
import pyomo.core as po
from pyomo.core.base.expr import identify_variables
from calliope.backend.pyomo.util import get_param
import calliope.exceptions as exceptions
from calliope.test.common.util import build_test_model as build_m... | |
import datetime
import unittest2
import json
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from datafeeds.datafeed_fms_api import DatafeedFMSAPI
from helpers.match_helper import MatchHelper
from helpers.match_manipulator import MatchManipulator
from models.event import Event
from model... | |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from page_sets.login_helpers import google_login
class TopPages... | |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python2.7
"""
This demo demonstrates how to embed a matplotlib (mpl) plot
into a PyQt4 GUI application, including:
* Using the navigation toolbar
* Adding data to the plot
* Dynamically modifying the plot's properties
* Processing mpl events
* Saving the plot to a file from a menu
The main goal is to... | |
#!/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
"""Open Python modules in your text editor.
Example: ped django.core.urlresolvers
"""
from types import ModuleType
from typing import Optional, Tuple, Any
import argparse
import importlib
import inspect
import os
import shlex
import subprocess
import sys
from .guess_module import guess_module, g... | |
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module to download and run the CIPD client.
CIPD is the Chrome Infra Package Deployer, a simple method of resolving a
package/... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
r"""
This module is a ParaViewWeb server application.
The following command line illustrates how to use it::
$ pvpython -dr .../pvw-visualizer.py --data /.../path-to-your-data-directory
--data
Path used to list that directory on the server and let the client choose a
... | |
#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | |
"""Errors for invalid sequence indices"""
# pylint: disable=too-few-public-methods, no-self-use, import-error, missing-docstring, useless-object-inheritance, unnecessary-pass
import six
from unknown import Unknown
TESTLIST = [1, 2, 3]
TESTTUPLE = (1, 2, 3)
TESTSTR = '123'
# getitem tests with bad indices
def function... | |
"""
Tesla car model
"""
import uuid
import json
from random import choice
__OFF__ = 'off'
__ON__ = 'on'
__COLOR__ = ['black', 'white', 'red', 'brown', 'gold', 'pink']
JSONEncoder_old = json.JSONEncoder.default
def JSONEncoder_new(self, obj):
if isinstance(obj, uuid.UUID):
return str(obj)
elif isinstan... | |
"""
=======
Plotter
=======
.. moduleauthor:: Adam Ginsburg <adam.g.ginsburg@gmail.com>
"""
from __future__ import print_function
import matplotlib
import matplotlib.pyplot
import matplotlib.figure
import numpy as np
import astropy.units as u
import copy
import inspect
from astropy import log
try:
from matplotlib... | |
#!/usr/bin/env python
'''
Python Perlin Noise based map generation
This program creates a pseudo-random noise pattern and then
applies a cos based interpolation. It then layers several octaves of noise
and uses a weighted average of them. A mask is then applied.
'''
import sys
import getopt
import datetime... | |
### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the code in this block
### end... | |
#!/usr/bin/env python
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
import sys
import os.path
import time
import argparse
import logging
from re import match as re_match
from shutil import rmtree
import random
import threading
import Queue
try:
import digits
except ImportError:
# Add pa... | |
####################################################################
# Readin configure file
####################################################################
# Internal modules
from program import PROGRAM
import auxfun as af
# External modules
import configparser
# Check reduplicative variable name
def checkDup... | |
from __future__ import unicode_literals
import collections
import functools
import logging
import copy
from moto.autoscaling import models as autoscaling_models
from moto.awslambda import models as lambda_models
from moto.datapipeline import models as datapipeline_models
from moto.ec2 import models as ec2_models
from ... | |
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
""" Message Parsing
Template-specific Message Parsers are defined here.
@copyright: 2012-2016 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this soft... | |
"""Search (Chapters 3-4)
The way to use this code is to subclass Problem to create a class of problems,
then create problem instances and solve them with calls to the various search
functions."""
from .utils import (
is_in, argmin, argmax, argmax_random_tie, probability,
weighted_sample_with_replacement, memo... | |
#!/usr/bin/env python
# vim: sw=2 ts=2
import click
import os
import sys
@click.command()
### Cluster options
@click.option('--console-port', default='443', type=click.IntRange(1,65535), help='OpenShift web console port',
show_default=True)
@click.option('--deployment-type', default='openshift-enterpri... | |
import pandas as pd
import networkx as nx
from .partition import Partition
def leaves_below(tree, node):
return set(sum(([vv for vv in v if tree.out_degree(vv) == 0]
for k, v in nx.dfs_successors(tree, node).items()), []))
class Resolver:
def __init__(self, df, column):
self.df ... | |
"""Allows the creation of a sensor that breaks out state_attributes."""
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.sensor import (
ENTITY_ID_FORMAT,
PLATFORM_SCHEMA,
DEVICE_CLASSES_SCHEMA,
)
from homeassistant.c... | |
from __future__ import division
import numpy as np
from numpy.linalg import inv
from numpy.core.umath_tests import inner1d
def initialize_gpu():
from cudamat import cudamat as cm
global cm
# this class wraps matrix operations so that you can switch between numpy
# and cuda operations
cm.cuda_set... | |
#!/usr/bin/env python
# Copyright 2017 Calico 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 ... | |
from __future__ import print_function, division
try:
import nfldb
nfldb_missing=False
except ImportError:
nfldb_missing=True
import numpy as np
import pandas as pd
import pytest
import nflwin.utilities as utils
class TestGetNFLDBPlayData(object):
"""Testing the ability to get play data from nfldb.""... | |
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... | |
import Mariana.settings as MSET
import Mariana.useful as MUSE
import Mariana.abstraction as MABS
import Mariana.activations as MA
import lasagne.init as LI
import numpy
import theano
import theano.tensor as tt
__all__= [
"Initialization_ABC",
"Identity",
"HardSet",
"SingleValue",
"Normal",
"U... | |
#!/usr/bin/env python3
#
# Working with threading and pySerial
#
# (C) 2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
"""\
Support threading with serial ports.
"""
import serial
import threading
class Protocol(object):
"""\
Protocol as used by the ReaderThread. This base cl... | |
# Copyright 2013 Google Inc. All Rights Reserved.
"""Implementations of installers for different component types."""
import os
import re
import ssl
import tarfile
import urllib2
from googlecloudsdk.core.util import files as file_utils
from googlecloudsdk.core import exceptions
from googlecloudsdk.core import proper... | |
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | |
"""
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... | |
# -*- coding: utf-8 -*-
class Node(object):
def __init__(self, key, value, parent, left=None, right=None):
self.key = key
self.value = value
self.parent = parent
self.left = left
self.right = right
def __str__(self):
return "<{}, {}>".format(self.key, self.val... | |
"""
The Tornado application
"""
import os
import errno
import shutil
import socket
import hashlib
import logging
import urlparse
import tornado.web
import tornado.ioloop
import tornado.httpserver
from tornado.options import options, define
import ms3.general_options as general_options
from ms3.commands import (
... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Spotify AB
#
# 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... | |
from graphql.type import (
GraphQLArgument,
GraphQLEnumType,
GraphQLEnumValue,
GraphQLField,
GraphQLInputField,
GraphQLInputObjectType,
GraphQLInterfaceType,
GraphQLNonNull,
GraphQLObjectType,
GraphQLString,
)
from ..dynamic import Dynamic
from ..enum import Enum
from ..field im... | |
import numpy as np
import abc
import collections
import math
from future.utils import with_metaclass
try:
# see if we have mpi and/or are using parallel
from mpi4py import MPI
if MPI.COMM_WORLD.Get_size() > 1: # need parallel capabilities
using_mpi = True
comm = MPI.COMM_WORLD
... | |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana Systems 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
#... | |
#! /usr/bin/env python
# MIT License
# Copyright (c) 2017 Rebecca ".bx" Shapiro
# 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
... | |
# Copyright (c) 2021 PaddlePaddle 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 app... | |
# Copyright (C) 2000 Greg Landrum
#
# 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 of the License, or (at your option) any later version.
#
# This library is distribu... | |
# -*- coding: utf-8 -*-
"""
Infection test result reporting for RLPPTM template
@license: MIT
"""
import base64
import cbor2
import datetime
import hashlib
import json
import re
import requests
import secrets
import sys
import uuid
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.... | |
# -*- coding: utf-8 -*-
# (c) 2009-2022 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Original PyFileServer (c) 2005 Ho Chun Wei.
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
ext_wsgiutils_server.py is an extension of the wsgiutils server in Pa... | |
# Copyright (c) 2017 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | |
#!/usr/bin/env python
# use python3
import numpy as np
import time
import sys
import argparse
import networkx as nx
import scipy
#from dpLoadh5 import dpLoadh5
from dpFRAG import dpFRAG
import _FRAG_extension as FRAG_extension
#read the input arguments
parser = argparse.ArgumentParser()
parser.add_argument('--size_o... | |
# 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... | |
"""This is a sample game built using a dungeon engine"""
import random
from dungeon import *
__author__ = 'dsent'
_ = lang_init()
class NormalScene(Scene):
_class_name = 'normal'
_msg_nonsense = (
_("You haven't really thought that was an option, have you?"),
_("That would be stupid, don't ... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import re
from frappe.utils import cint, strip_html_tags
from frappe.model.base_document import get_controller
def setup_global_search_t... | |
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from swaggyjenkins.m... | |
#!/usr/bin/env python
import sys, os, shutil, time, platform
from subprocess import Popen, PIPE
from distutils.core import setup, Extension, Command
from distutils import log
from distutils.dir_util import remove_tree
# -----------------------------------------------------------------------------
# Bootstrap
if sys.v... | |
"""The definition of the base geometrical entity with attributes common to
all derived geometrical entities.
Contains
========
GeometryEntity
"""
from __future__ import print_function, division
from sympy.core.compatibility import is_sequence
from sympy.core.basic import Basic
from sympy.core.sympify import sympify... | |
from guardian.shortcuts import assign_perm, get_users_with_perms, remove_perm
from polymorphic.models import PolymorphicModel
from taggit.managers import TaggableManager
from whatisit.apps.wordfish.storage import ImageStorage
from whatisit.settings import MEDIA_ROOT
from django.contrib.auth.models import User
from dj... | |
# coding=utf-8
# Copyright 2019 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
from json import dump
from os.path import join, isfile
from pyglet.event import EVENT_HANDLED
from pyglet.clock import schedule_once
from pyglet.window import Window, key
from sys import exit
from time import time
from winsound import Beep
from inclinometer import Inclinometer
# from projection import Projection
... | |
import pytest
def test_simple_unittest(testdir):
testpath = testdir.makepyfile("""
import unittest
class MyTestCase(unittest.TestCase):
def testpassing(self):
self.assertEquals('foo', 'foo')
def test_failing(self):
self.assertEquals('foo', 'ba... | |
'''artlaasya signals'''
from django.dispatch import receiver
from django.db.models.signals import pre_save, post_save, pre_delete
try:
from django.utils.text import slugify
except ImportError:
try:
from django.template.defaultfilters import slugify
except ImportError:
print("Unable to impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.