gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" Creole Wiki (as used on bitbucket.org). See http://www.wikicreole.org/wiki/Creole1.0 for syntax. """ # Simple edit of gwiki.py import re, os, sys, subprocess from common import default_movie, plain_exercise, insert_code_and_tex from plaintext import plain_quiz from misc import _abort from doconce import errwarn d...
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
#!/usr/bin/env python import json import logging import os import string import subprocess import sys import time import uuid from random import choice from twisted.internet import reactor, defer from twisted.internet.task import deferLater from twisted.internet.defer import CancelledError from twisted.python import...
# -*- coding: utf-8 -*- # # Copyright (c) 2011 - 2015 -- Lars Heuer <heuer[at]semagia.com> # All rights reserved. # # License: BSD, see LICENSE.txt for more details. # """\ This module defines a event handlers to process cables. :author: Lars Heuer (heuer[at]semagia.com) :organization: Semagia - <http://www.sema...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Course.name_en' db.add_column('courses_course', 'name_en', self.gf('dj...
from django.db import models from django.db.models.related import RelatedObject from django.forms.forms import pretty_name from django.utils import formats from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils.text import capfirst from django.utils.encoding import force_un...
#!/usr/bin/env python import re import struct import logging import six # Python 2+3 compatibility try: import hashlib as md5 except ImportError: import md5 try: from Crypto.Cipher import ARC4 from Crypto.Cipher import AES from Crypto.Hash import SHA256 except ImportError: AES = SHA256 = None ...
# -*- coding: utf-8 -*- ''' maze game demo behaviors ''' import os # Import Python libs from collections import deque try: import simplejson as json except ImportError: import json # Import ioflo libs from ioflo.base.odicting import odict from ioflo.base.globaling import * from ioflo.base import aiding fro...
import os from unittest import mock import pytest from pyjob.lsf import LoadSharingFacilityTask @pytest.mark.skipif(pytest.on_windows, reason="Unavailable on Windows") @mock.patch("pyjob.lsf.LoadSharingFacilityTask._check_requirements") class TestCreateRunscript(object): def test_1(self, check_requirements_mock)...
# Copyright 2018 The TensorFlow Probability 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 o...
""" Implements helpers to build LLVM debuginfo. """ import abc import os.path from contextlib import contextmanager from llvmlite import ir from numba.core import cgutils @contextmanager def suspend_emission(builder): """Suspends the emission of debug_metadata for the duration of the context managed block."...
#!/usr/bin/env python # Copyright (C) 2014 Open Data ("Open Data" refers to # one or more of the following companies: Open Data Partners LLC, # Open Data Research LLC, or Open Data Capital LLC.) # # This file is part of Hadrian. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this...
#!/usr/bin/env python # # Generated Mon May 2 14:23:33 2011 by parse_xsd.py version 0.4. # import saml2 from saml2 import SamlBase import xmldsig as ds import xmlenc as xenc from saml2 import saml NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:metadata' class EntityIDType_(SamlBase): """The urn:oasis:names:tc:SAML:...
#!/usr/bin/env python # Copyright (c) 2013, 2014 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=F0401 import json import optparse import os import re import shutil import subprocess import sys import tempf...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals """ This module is used for analysis of materials with potential application as intercalation batteries. """ __author__ = "Anubhav Jain, Shyue Ping Ong" __cop...
# Copyright 2013 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 applicable law or ...
# Copyright (c) 2010-2012 OpenStack, 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 ...
# 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...
# Copyright 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
""" Created on July 25th, 2017 @author: rouxpn """ from __future__ import division, print_function, unicode_literals, absolute_import import os import re import csv import xml.etree.ElementTree as ET import numpy as np from decimal import Decimal from collections import defaultdict class phisicsdata(): """ This...
#!/usr/bin/env python import sys import glob import numpy as np import matplotlib.pyplot as plt import scipy.signal as scs from plotTools import addToPlot # =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* def readColsFromFile( filename , cols ): csvOn = 'csv' in filename try: if( csvOn ): dat ...
# -*- coding: utf-8 -*- # Copyright (c) 2014 Docker. # # 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...
import os import warnings import numpy as np from math import sin, cos, sqrt, log10 from scipy import integrate from scipy.interpolate import interp1d, interp2d from scipy.special import ellipk, ellipe # These are complete elliptic integrals of the first and the second kind. from sympy.functions.special.elliptic_integr...
# -*- coding: utf-8 -*- """ Created on Sat Feb 01 10:45:09 2014 Training models remotely in cloud @author: pacif_000 """ from monk.roles.configuration import get_config from monk.roles.administrator import AdminBroker from monk.roles.monitor import MonitorBroker import monk.core.api as monkapi import logging import...
#!/usr/bin/env python __author__ = 'greghines' import numpy as np import os import pymongo import sys import random from IPy import IP import matplotlib.pyplot as plt if os.path.exists("/home/ggdhines"): base_directory = "/home/ggdhines" else: base_directory = "/home/greg" sys.path.append(base_directory+"/gi...
# Copyright The OpenTelemetry 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 or agreed to in ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import collections from pymatgen.util.testing import PymatgenTest from pymatgen.core.units import (Energy, Time, Length, unitized, Mass, Memory, EnergyArray, TimeArray, Length...
# -*- coding: utf-8 -*- """ Steps for behavioral style tests are defined in this module. Each step is defined by the string decorating it. This string is used to call the step in "*.feature" file. """ from __future__ import unicode_literals import pip import pexpect import os from behave import given, when, then @g...
from collections import OrderedDict from functools import lru_cache import json import os import re import textwrap from inspect import Signature, Parameter from jsonref import JsonRef import requests from requests import Request from civis.base import Endpoint, get_base_url from civis._deprecation import deprecate_p...
# coding: utf-8 from __future__ import unicode_literals from datetime import datetime import io import logging import os from jinja2.exceptions import TemplateNotFound import jinja2 import json from mkdocs import nav, search, utils from mkdocs.utils import filters from mkdocs.relative_path_ext import RelativePathExt...
from __future__ import absolute_import, division, unicode_literals from future.builtins import int, open, str from hashlib import md5 import os try: from urllib.parse import quote, unquote except ImportError: from urllib import quote, unquote from django.apps import apps from django.contrib import admin from ...
# This file is part of Androguard. # # Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # 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://...
""" ******** Matching ******** """ # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # Copyright (C) 2011 by # Nicholas Mancuso <nick.mancuso@gmail.com> # All rights reserved. # ...
"""Calibration of predicted probabilities.""" # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Balazs Kegl <balazs.kegl@gmail.com> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Mathieu Blondel <mathieu@mblondel.org> # # License: BSD 3 clause from __future__ impo...
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest import numpy import os from external.wip import work_in_progress import rmgpy.quantity from rmgpy.molecule import Molecule from rmgpy.species import Species from rmgpy.reaction import Reaction from rmgpy.kinetics import Arrhenius from rmgpy.thermo import Ther...
import re import numpy as np from pybedtools import * from pyfaidx import Fasta import subprocess, os, sys, shutil from collections import * import time import dill as pickle from difflib import SequenceMatcher def similar(a, b): return SequenceMatcher(None, a, b).ratio() # help from online sources ^^^^, helps v...
# # great_expectations documentation build configuration file, created by # sphinx-quickstart on Thu Jun 8 23:00:19 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configurat...
# # soaplib - Copyright (C) Soaplib 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. # # This l...
from twisted.internet import defer, protocol from twisted.python import reflect from txjsonrpc import jsonrpclib class BaseSubhandler: """ Sub-handlers for prefixed methods (e.g., system.listMethods) can be added with putSubHandler. By default, prefixes are separated with a '.'. Override self.separat...
# -*- coding: utf-8 -*- """ pycclib library for accessing the cloudControl API using Python Copyright 2010 cloudControl UG (haftungsbeschraenkt) 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 ht...
from django.http import HttpResponse from django.test import TestCase from django.test.utils import override_settings from django.utils.deprecation import MiddlewareMixin from corsheaders.middleware import ( ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, ACCESS_CONTROL_ALLOW_METHODS, A...
""" Tests for MLP classifier based in part on sklearn's logistic tests: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/linear_model/tests/test_logistic.py """ from io import BytesIO import pickle import sys from unittest import mock from unittest.mock import MagicMock import numpy as np import pyte...
# 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 operator import numpy as np from .visual import VisualAttributes, RED from .decorators import memoize from .message import SubsetDeleteMessage, SubsetUpdateMessage from .registry import Registry from .util import split_component_view, view_shape __all__ = ['Subset', 'SubsetState', 'RoiSubsetState', 'CompositeS...
from model.book import Book from model.client import Client from model.loan import Loan from model.exception import LibraryException __author__ = 'cosmin' class Library: ''' Represents an actual state of a library at a given moment in time. properties: _books - list of all the books ...
from __future__ import absolute_import, unicode_literals import collections from django import forms from django.core.exceptions import ValidationError from django.forms.utils import ErrorList from django.template.loader import render_to_string from django.utils.encoding import python_2_unicode_compatible, force_text...
# # The Python Imaging Library. # $Id$ # # a Tk display interface # # History: # 96-04-08 fl Created # 96-09-06 fl Added getimage method # 96-11-01 fl Rewritten, removed image attribute and crop method # 97-05-09 fl Use PyImagingPaste method instead of image type # 97-05-12 fl Minor tweaks to match the IFUNC9...
# -*- coding: utf-8 -*- """SQLite parser plugin for Windows 10 Timeline database files.""" from __future__ import unicode_literals import json from dfdatetime import posix_time as dfdatetime_posix_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions fro...
from __future__ import unicode_literals from operator import attrgetter from django.contrib.contenttypes.models import ContentType from django.contrib.sessions.backends.db import SessionStore from django.db.models import Count from django.test import TestCase, override_settings from .models import ( Base, Child,...
# # Copyright 2016 The BigDL 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 or agreed to in ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Hewlett-Packard Development Company, L.P. # 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 # # ...
#!/usr/bin/env python import csv,sys,os os.environ['MPLCONFIGDIR'] = '/tmp' import numpy from matplotlib.path import Path from rtree import index as rtree from pyproj import Proj, transform from struct import pack, unpack, calcsize, error import time import array import tempfile def shapefile(): """ shapefil...
# -*- 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. """Utilities for updating and building in the chroot environment.""" from __future__ import print_function import contextlib imp...
#!/usr/bin/env python __author__ = "waroquiers" import json import os import unittest from pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies import ( AngleNbSetWeight, CNBiasNbSetWeight, DeltaCSMNbSetWeight, DeltaDistanceNbSetWeight, DistanceAngleAreaNbSetWeight, Distanc...
"""DBF header definition. TODO: - handle encoding of the character fields (encoding information stored in the DBF header) """ """History (most recent first): 16-sep-2010 [als] fromStream: fix century of the last update field 11-feb-2007 [als] added .ignoreErrors 10-feb-2007 [als] added __getitem__: return...
import functools import json from django.db.models.sql import EmptyResultSet import commonware.log from rest_framework.decorators import api_view from rest_framework.exceptions import ParseError from rest_framework.mixins import ListModelMixin from rest_framework.routers import Route, SimpleRouter from rest_framework...
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. import operator import unittest from iptest import IronPythonTestCase, is_cli, is_netcoreapp, run_test, skipUnl...
from datetime import datetime import operator import numpy as np import pytest from pandas import ( DataFrame, Index, Series, bdate_range, ) import pandas._testing as tm from pandas.core import ops class TestSeriesLogicalOps: @pytest.mark.parametrize("bool_op", [operator.and_, operator.or_, oper...
""" This file performs unit tests of functions within Exomerge. Copyright 2018 National Technology and Engineering Solutions of Sandia. Under the terms of Contract DE-NA-0003525, there is a non-exclusive license for use of this work by or on behalf of the U.S. Government. Export of this program may require a license...
# -*- coding: utf-8 -*- """ lantz.drivers.cobolt.cobolt0601 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2015 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from pyvisa import constants from lantz import Action, Feat from lantz.messagebased import Mess...
import tkinter as tk import sys from linalg import (point,vector,unit,norm2,norm, unit_length,dot,inverse, translate,scale,identity, hom,proj,vapply,coords,line_intersect,perp2) ############################################################################## d...
'''create files contains estimated generalization errors for model INPUT FILE WORKING/transactions-subset2.pickle OUTPUT FILES WORKING/ege_week/YYYY-MM-DD/MODEL-TD/HP-FOLD.pickle dict all_results WORKING/ege_month/YYYY-MM-DD/MODEL-TD/HP-FOLD.pickle dict all_results ''' import collections import cPickle as pickl...
from __future__ import absolute_import import six from collections import namedtuple, defaultdict from django.db.models import Q from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from sentry.identity.pipeline import IdentityProviderPipeline from sentry.integrations import ( ...
from __future__ import unicode_literals import difflib import json import posixpath import sys import threading import unittest import warnings from collections import Counter from contextlib import contextmanager from copy import copy from functools import wraps from unittest.util import safe_repr from django.apps i...
#!/usr/bin/env python #---------------------------------------------------------------------------- # Name: ListCtrl.py # Purpose: Testing lots of stuff, controls, window types, etc. # # Author: Robin Dunn & Gary Dumer # # Created: # Copyright: (c) 1998-2017 by Total Control Software # Licence: ...
#!/usr/bin/env python2 # Copyright 2013-present Barefoot Networks, 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 b...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not...
#!/usr/bin/env python import sys import re import shlex import os from argparse import ArgumentParser try: from Bio import AlignIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio.Alphabet import generic_dna from Bio.Align import MultipleSeqAlignment except ImportError: sys....
# Author: Gael Varoquaux # License: BSD 3 clause import sys import numpy as np import scipy.sparse as sp import sklearn from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from...
#!/usr/bin/env python3 import abc import unittest from scapy.fields import BitField, ByteField, FlagsField, IntField from scapy.packet import bind_layers, Packet, Raw from scapy.layers.inet import IP, UDP, Ether from scapy.layers.inet6 import IPv6 from framework import VppTestCase, VppTestRunner from lisp import Vpp...
# Copyright 2006 James Tauber and contributors # Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # 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/...
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson 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 ...
#!/usr/bin/env python # Copyright 2013 Brett Slatkin # # 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 from ..debugging import bacpypes_debugging, ModuleLogger from ..capability import Capability from ..pdu import GlobalBroadcast from ..apdu import WhoIsRequest, IAmRequest, IHaveRequest, SimpleAckPDU from ..errors import ExecutionError, InconsistentParameters, \ MissingRequiredParameter, Par...
""" Routines for manipulating RFC2047 encoded words. This is currently a package-private API, but will be considered for promotion to a public API if there is demand. """ # An ecoded word looks like this: # # =?charset[*lang]?cte?encoded_string?= # # for more information about charset see the charset module. ...
import ply.yacc as yacc import os import codecs import re from analizadorLexico import tokens from sys import stdin precedence = ( ('right','ID','CALL','BEGIN','IF','WHILE'), ('right','PROCEDURE'), ('right','VAR'), ('right', 'ASSIGN'), ('right','UPDATE'), ('left','NE'), ('left','LT','LTE','GT','GTE'), ('left',...
# -*- encoding: utf-8 -*- # Copyright (c) 2017 ZTE # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
#!/usr/bin/env python # Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 that # can be found in the LICENSE file. import hashlib import json import logging import os import sys import tempfile import unittest # net_utils adjusts sys....
#------------------------------------------------------------------------------- # # Define standard Enable 'control' components, like text/image labels, # push buttons, radio buttons, check boxes, and so on. # # Written by: David C. Morrill # # Date: 10/10/2003 # # (c) Copyright 2003 by Enthought, Inc. # # Class...
#/*********************************************************************** # * Licensed Materials - Property of IBM # * # * IBM SPSS Products: Statistics Common # * # * (C) Copyright IBM Corp. 1989,2020 # * # * US Government Users Restricted Rights - Use, duplication or disclosure # * restricted by GSA ADP Schedule Con...
""" Kernel class. It provides Gram matrix computation and incomplete Cholesky decomposition capabilities. """ from scipy.spatial.distance import pdist, cdist, squareform from numpy import sum, sqrt, exp, dot, ones, array, zeros, argmax, \ hstack, newaxis, copy, argsort class Kernel(object): "...
import unittest from datetime import timedelta from django.conf.urls import url, include from django.contrib.auth import get_user_model from django.http import HttpResponse from django.test import TestCase from django.test.utils import override_settings from django.utils import timezone from .test_utils import TestCa...
#!/usr/bin/python3 # # Copyright 2012 Sonya Huang # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import os import shutil from tempfile import mkstemp from tests import TestCase, add from mutagen.asf import ASF, ASFHeaderError, ASFValue, UNICODE, DWORD, QWORD from mutagen.asf import BOOL, WORD, BYTEARRAY, GUID class TASFFile(TestCase): def test_not_my_file(self): self.failUnlessRaises( ASF...
# 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 # d...
#!/usr/bin/python -O # # Copyright (C) 2003-2012 Tad Marko (tad@markoland.net) # # This file is part of the mp3mirror project which has been released under the # MIT license. See the README.md file in the root project directory or the # project website (https://github.com/txtad/mp3mirror) for more informaiton. # imp...
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals import math import itertools from six.moves import map, zip import numpy as np from numpy.linalg import inv from numpy import pi, dot, transpose, radians fro...
""" Tests for the error model. """ from __future__ import annotations import math import numpy as np import pytest from cctbx.sgtbx import space_group from libtbx import phil from dials.algorithms.scaling.error_model.engine import ErrorModelRefinery from dials.algorithms.scaling.error_model.error_model import ( ...
#!/usr/bin/env python2 # coding: utf-8 import types def tokenize(line): # double quoted segment is preseverd tokens = line.split(' ') stck = [[]] for t in tokens: sp = t.split('"') n = len(sp) if n % 2 == 0: if len(stck) == 1: stck.append([t])...
# Copyright (c) 2013 Intel, Inc. # Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/li...
#!/usr/bin/python # # Copyright 2013 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 b...
# 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...
import json import re import textwrap import uuid from oslo.serialization import jsonutils from oslo.utils import encodeutils import pkg_resources import prettytable import six from . import exceptions from .i18n import _ from .common import cliutils VALID_KEY_REGEX = re.compile(r"[\w\.\- :]+$", re.UNICODE) def a...
""" This module contains essential stuff that should've come with Python itself ;) It also contains functions (or functionality) which is in Python versions higher than 2.5 which used to be the lowest version supported by Scrapy. """ import os import re import inspect import weakref import errno from functools import...
# Copyright 2016 Letv Cloud Computing # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # import mock import math import functools import contextlib import unittest import os import sys import json import itertools # Python 3 compatibility from pdc_client.compat import String...
# Copyright 2022 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 in writing, ...