gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# -*- coding: utf-8 -*- """ word_ladder_2.py ~~~~~~~~~~~~~~ A brief description goes here. """ import copy class Solution: # @param start, a string # @param end, a string # @param dictionary, a set of string # @return a list of lists of string MAX_EDGE_VALUE = 9999 def findLad...
"""Tests for module utils for timing and parallel computation """ # Author: Remi Flamary <remi.flamary@unice.fr> # # License: MIT License import ot import numpy as np import sys def test_parmap(): n = 100 def f(i): return 1.0 * i * i a = np.arange(n) l1 = list(map(f, a)) l2 = list(...
#!/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...
# -*- coding: utf-8 -*- """ URLResolver Addon for Kodi Copyright (C) 2016 t0mm0, tknorris 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 3 of the License, or ...
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2017 PyMeasure Developers # # 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 limit...
# -*- coding: ascii -*- """PySpec User Interface for console. """ import sys import time import optparse import pyspec import pyspec.util import pyspec.project import pyspec.framework from pyspec.embedded.setting import config import pyspec.compat_ironpython as compat import addin __pyspec = 1 __all__ = ("CUISpecTe...
#!/usr/bin/python # Copyright (C) 2016 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 ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# -*- coding: ibm850 -*- template_typed = """ #ifdef TYPED_METHOD_BIND template<class T $ifret ,class R$ $ifargs ,$ $arg, class P@$> class MethodBind$argc$$ifret R$$ifconst C$ : public MethodBind { public: $ifret R$ $ifnoret void$ (T::*method)($arg, P@$) $ifconst const$; #ifdef DEBUG_METHODS_ENABLED virtual Variant...
from skidl import SKIDL, TEMPLATE, Part, Pin, SchLib SKIDL_lib_version = '0.0.1' video = SchLib(tool=SKIDL).add_parts(*[ Part(name='AD725',dest=TEMPLATE,tool=SKIDL,keywords='Video',description='Low Cost RGB to NTSC/PAL Encoder with Luma Trap Port',ref_prefix='U',num_units=1,fplist=['SOIC*7.5x10.3mm*Pitch1.27m...
"Script to generate the order related views of Haldis" import random import typing from datetime import datetime from werkzeug.wrappers import Response # from flask import current_app as app from flask import ( Blueprint, abort, flash, redirect, render_template, request, session, url_f...
# Copyright (c) 2010-2014 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 agre...
#!/usr/bin/python import dweepy import ConfigParser import paho.mqtt.client as paho import psutil import signal import sys import time import pyupm_grove as grove import pyupm_i2clcd as lcd from random import randint from threading import Thread from twython import Twython import plotly.plotly as py from plotly.grap...
import numpy as np import scipy.stats as stats import sys # lib eh a nossa biblioteca criada para este trabalho import lib.naive_bayes as nb import lib.preprocessing as prep import lib.validation as valid from config.constants import * def case2(indexes=CASE_2_ATTRIBUTE_INDEXES,output=True): accuracy_in_each_...
#!/usr/bin/env python import argparse import codecs import copy import hashlib import json import logging import os import shutil import struct import subprocess import tempfile import xml.etree.ElementTree as ET from collections import defaultdict from Bio.Data import CodonTable logging.basicConfig(level=logging.INF...
from dash.orgs.models import TaskState from django.urls import reverse from django.test.utils import override_settings from unittest.mock import patch from casepro.test import BaseCasesTest from .models import URN, Contact, Field, Group, InvalidURN from .tasks import pull_contacts class URNTest(BaseCasesTest): ...
#!/usr/bin/python # interpolate scalar gradient onto nedelec space from dolfin import * import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc Print = PETSc.Sys.Print # from MatrixOperations import * import numpy as np #import matplotlib.pylab as plt import PETScIO as IO import common import ...
from common_fixtures import * # NOQA from gdapi import ApiError TEST_IMAGE = 'ibuildthecloud/helloworld' TEST_IMAGE_LATEST = TEST_IMAGE + ':latest' TEST_IMAGE_UUID = 'docker:' + TEST_IMAGE if_docker = pytest.mark.skipif("os.environ.get('DOCKER_TEST') == 'false'", reason='DOCKER_TEST is...
# 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...
""" Tests for the supervisord state """ # Import python lins import os import subprocess import time import salt.utils.path from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin from tests.support.runtests import R...
# 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/env python import argparse import os import subprocess import sys from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ enable_verbose_mode, is_verbose_mode, get_target_arch from lib.util import execute_stdout, get_atom_shell_version, scoped_cwd SOURCE_ROOT = os.p...
from __future__ import print_function, absolute_import, unicode_literals, division import six import subprocess import unittest2 from mock import patch from shmock import ShellCommandMock def call(args): process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.P...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File name: test_media.py # # VideoMorph - A PyQt5 frontend to ffmpeg and avconv. # Copyright 2015-2016 VideoMorph Development Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
#!/usr/bin/env python """ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import os import re import shlex import sys from optparse import OptionError from optparse import OptionGroup from optparse import OptionParser from optparse import SUPPRESS_...
# # 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...
# # Copyright (c) 2008-2015 Citrix 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
# Copyright (c) 2015 Mirantis, 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 requir...
# Copyright 2012 Red Hat, Inc. # Copyright 2013 IBM Corp. # 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....
# 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. import logging import os import Queue import re import subprocess import sys import threading import time from mopy.config import Config from mopy.paths imp...
""" JSON serialization and deserialization utilities. """ import datetime import json import os import types from collections import OrderedDict, defaultdict from enum import Enum from hashlib import sha1 from importlib import import_module from inspect import getfullargspec from uuid import UUID try: import nump...
# -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2016, Caleb Bell <Caleb.Andrew.Bell@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal...
# 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...
# -*- coding: utf-8 -*- # # Copyright 2016 SUSE 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 agr...
from argparse import ArgumentParser, _SubParsersAction from argparse import _MutuallyExclusiveGroup, _ArgumentGroup class GooeySubParser(_SubParsersAction): def __init__(self, *args, **kwargs): super(GooeySubParser, self).__init__(*args, **kwargs) # TODO: figure out how to correctly dispatch all of thes...
# -*- coding: utf-8 -*- # # NanoGUI documentation build configuration file, created by # sphinx-quickstart on Mon Aug 22 20:05:54 2016. # # 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. # # A...
import os from cuttsum.resources import MultiProcessWorker from cuttsum.pipeline import ArticlesResource from cuttsum.misc import si2df import cuttsum.judgements import numpy as np import pandas as pd import sumpy class RetrospectiveMonotoneSubmodularOracle(MultiProcessWorker): def __init__(self): self.d...
# Copyright (c) 2014 Cisco Systems # 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 require...
from datetime import timedelta as td import time from django.conf import settings from django.db import connection from django.http import ( HttpResponse, HttpResponseForbidden, HttpResponseNotFound, HttpResponseBadRequest, JsonResponse, ) from django.shortcuts import get_object_or_404 from django....
# -*- coding: utf-8 -*- from __future__ import absolute_import from typing import Any, Callable, Optional from django.conf import settings from django.http import HttpRequest, HttpResponse from django.test import TestCase from zerver.models import ( get_client, get_realm, get_stream, get_user_profile_by_email, ...
# ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # # Copyright (c) 2014 Tom Kralidis # # 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 ...
# 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 u...
from typing import Optional, List, TYPE_CHECKING import torch from allennlp.common import FromParams from allennlp.modules.util import replicate_layers from allennlp.modules.transformer.transformer_layer import TransformerLayer from allennlp.modules.transformer.bimodal_connection_layer import BiModalConnectionLayer f...
"""Similar to, but incompatible with BSON""" import struct import cStringIO import calendar import pytz from datetime import datetime __all__ = ['dumps', 'dump', 'loads', 'load'] def dumps(value): buff = cStringIO.StringIO() encode(value, buff) return buff.getvalue() def dump(value, stream): ...
# =============================================================================== # Copyright 2013 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
# Copyright 2015 Ian Cordasco # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
"""EntryAdmin for Zinnia""" from django.contrib import admin from django.db.models import Q from django.utils import timezone from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from django.core.urlresolvers import NoReverseMatch from django.utils.translation import ungettext_lazy ...
# Copyright (c) 2016 Red Hat, 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 require...
from __future__ import division, unicode_literals import os import re import sys import time from ..compat import compat_str from ..utils import ( encodeFilename, format_bytes, timeconvert, ) class FileDownloader(object): """File Downloader class. File downloader objects are the ones responsibl...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2017 Masten Space 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 http://www.apache.org/licenses/LI...
#!/usr/bin/env python # pylint: disable=too-many-lines # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) ...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Miscellaneous file manipulation functions """ import cPickle from glob import glob import gzip import os import re import shutil # The md5 module is deprecated in Python 2.6, but hashlib is only # ava...
#!/usr/bin/env python # # Copyright 2009 The Closure Library Authors. All Rights Reserved. """Utility for Closure Library dependency calculation. ClosureBuilder scans source files to build dependency info. From the dependencies, the script can produce a deps.js file, a manifest in dependency order, a concatenated s...
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, o...
# -*- test-case-name: pymeta.test.test_builder -*- from types import ModuleType as module import linecache, sys class TreeBuilder(object): """ Produce an abstract syntax tree of OMeta operations. """ def __init__(self, name, grammar=None, *args): self.name = name def makeGrammar(self, rul...
#!/usr/bin/env python # This file is part of the OpenMV project. # Copyright (c) 2013/2014 Ibrahim Abdelkader <i.abdalkader@gmail.com> # This work is licensed under the MIT license, see the file LICENSE for # details. """This module implements enough functionality to program the STM32F4xx over DFU, without requiringdf...
#!/usr/bin/python # Copyright 2015-2016 Arogi Inc # Copyright 2010-2014 Google # # 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 r...
# Copyright (c) 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 agreed to...
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import re import sys """Header Scanner. This module will scan a set of input sources for include dependencies. Use th...
# Copyright 2020 Google Research. 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...
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Andrew Dykstra <andrew.r.dykstra@gmail.com> # Mads Jensen <mje.mads@gmail.com> # # License: BSD (3-clause) import os.path as op from copy import deepcopy import warnings import ...
import copy def print_first(number,thing): if not hasattr(thing, '__iter__'): msg = "print_first_10: can't iterate over given thing..." print(msg) raise(Exception(msg)) return thing_len = len(thing) if thing_len == 0: msg = "Thing has no elements..." print(m...
# Copyright (C) 2016 EMC Corporation. # 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...
#!/usr/bin/env python from grr.lib import access_control from grr.lib import aff4 from grr.lib import rdfvalue from grr.lib import test_lib from grr.lib.aff4_objects import user_managers class GRRUserTest(test_lib.AFF4ObjectTest): def testUserPasswords(self): with aff4.FACTORY.Create("aff4:/users/test", "GRR...
#!/usr/bin/env python """ #@Author: Frankln Kenghagho #@Date: 04.04.2019 #@Project: RobotVA """ #This program is frontend and multi-task, namely # 1- Setting of model paths # 2- Setting of model hyperparameters # 3- Data preparation and loading into memory # 4- Training # 5- Inference # 6- Valida...
# -*- coding:utf-8 -*- import os import re import time import codecs import traceback from mrq.job import queue_job, get_job_result, Job import setting.api_config as config from setting.status_code import STATUS_CODE from com.connection import db from com.redis_conn import redis_instance def get_tel_info(tel_prefix)...
import importlib.util import itertools import os import re import shutil from collections import defaultdict from typing import Optional, IO, Dict, List import pytest import numpy as np from numpy.typing.mypy_plugin import _PRECISION_DICT, _EXTENDED_PRECISION_LIST try: from mypy import api except ImportError: ...
# # 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...
from scipy import misc import os import fnmatch import numpy as np import matplotlib.pyplot as plt from scipy import ndimage from scipy import signal from tqdm import tqdm import pickle # %matplotlib inline # images lading and processing functions --------------------------------------- def generate_image_list(path...
"""Several utilities for experimenting upon utlc datasets""" # Standard library imports import logging import os import inspect import zipfile from tempfile import TemporaryFile # Third-party imports import numpy import theano from pylearn2.datasets.utlc import load_ndarray_dataset, load_sparse_dataset from pylearn2.u...
# -*- test-case-name: twisted.names.test.test_names -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Asynchronous client DNS The functions exposed in this module can be used for asynchronous name resolution and dns queries. If you need to create a resolver with specific requi...
import csv import pandas as pd import igraph import luigi import util import aminer import filtering import config class YearFilterableTask(util.YearFilterableTask): @property def base_dir(self): return config.graph_dir class BuildPaperCitationGraph(YearFilterableTask): """Build the citation g...
from __future__ import absolute_import, unicode_literals from datetime import timedelta, datetime from time import time, mktime, gmtime from django.core.exceptions import MultipleObjectsReturned, ValidationError from django.db import models from django.db.models import signals from django.utils.translation import uge...
# Copyright 2016 Mario Graff Guerrero # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in wri...
"""Provide an authentication layer for Home Assistant.""" from __future__ import annotations import asyncio from collections import OrderedDict from datetime import timedelta from typing import Any, Dict, Mapping, Optional, Tuple, cast import jwt from homeassistant import data_entry_flow from homeassistant.core impo...
# 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 weakref from telemetry.internal.forwarders import do_nothing_forwarder from telemetry.internal.platform import network_controller_backend from teleme...
""" Vector Autoregression (VAR) processes References ---------- Lutkepohl (2005) New Introduction to Multiple Time Series Analysis """ from __future__ import print_function, division from statsmodels.compat.python import range import numpy as np import numpy.linalg as npl from numpy.linalg import slogdet from statsm...
from guardian.models import GroupObjectPermission from django.utils import timezone from rest_framework import serializers as ser from api.base.exceptions import InvalidModelValueError from api.base.serializers import ( BaseAPISerializer, JSONAPISerializer, JSONAPIRelationshipSerializer, VersionedDateTimeFiel...
# coding: utf-8 from __future__ import unicode_literals """ Classes and methods related to the Structure Notation Language (SNL) """ __author__ = 'Anubhav Jain, Shyue Ping Ong' __credits__ = 'Dan Gunter' __copyright__ = 'Copyright 2013, The Materials Project' __version__ = '0.1' __maintainer__ = 'Anubhav Jain' __ema...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# 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 th...
#!/usr/bin/env python import sys import unittest from io import StringIO from unittest.mock import patch from argparse import ArgumentTypeError from updatable.console import _str_to_bool, _list_updates, _list_package_updates, _updatable, _argument_parser from test.utils import get_environment_requirements_list_monkey, ...
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
# Copyright (c) 2006-2009 The Trustees of Indiana University. # All rights reserved. # # Redistribution and use in source and binary forms, with or without ...
import json import logging from decimal import Decimal from typing import Dict from django.conf import settings from django.core.serializers.json import DjangoJSONEncoder from django.db import transaction from ..account.models import Address from ..checkout.models import Checkout from ..order.actions import handle_fu...
# file eulfedora/api.py # # Copyright 2010,2011 Emory University Libraries # # 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 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...
from itertools import groupby from restapi.serializers import UserSerializer, CampaignSerializer, TaskSerializer from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from rest_framework.test import APIRequestFactory from tasks import models # TODO def page_link(page): return page.number d...
######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
# Copyright (c) 2014 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 agreed to ...
# Copyright 2022 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import logging import traceback from operator import itemgetter from restclients_core.exceptions import InvalidNetID from myuw.dao.campus_building import get_building_by_code from myuw.dao.canvas import ( get_canvas_active_enrol...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Oakcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Base class for RPC testing.""" from collections import deque import logging import optparse import os ...
#!/usr/bin/python # -*- coding: utf-8 -*- import logging from PyQt4.QtGui import QWidget, QVBoxLayout, QHBoxLayout from PyQt4.QtCore import QObject, SIGNAL # Custom Widgets from pyduel_gui.widgets.board_widget import BoardWidget from pyduel_gui.widgets.dice_widget import DiceWidget from pyduel_gui.widgets.action_wid...
# 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...
# Languages that we support on AMO, e.g we have translations for them # and they're tested. AMO_LANGUAGES = { 'af': {'english': 'Afrikaans', 'native': 'Afrikaans'}, 'ar': {'english': 'Arabic', 'native': '\u0639\u0631\u0628\u064a'}, 'ast': {'english': 'Asturian', 'native': 'Asturianu'}, 'az': {'english':...
""" Misc. helper functions used in Empire. Includes the PowerShell functions that generate the randomized stagers. """ from time import localtime, strftime from Crypto.Random import random import re import string import commands import base64 import binascii import sys import os import socket import sqlite3 import ...
# pyOCD debugger # Copyright (c) 2021 mikisama # Copyright (C) 2021 Ciro Cattuto <ciro.cattuto@gmail.com> # Copyright (C) 2021 Simon D. Levy <simon.d.levy@gmail.com> # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from __future__ import print_function, unicode_literals from future.builtins import input, open import os import re import sys from functools import wraps from getpass import getpass, getuser from glob import glob from contextlib import contextmanager from posixpath import join from fabric.api import env, cd, prefix,...
# coding: utf-8 from unittest import TestCase import os import sys # Hack environment to force import "item" module from grab/item.py location root = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, root) from lxml.html import fromstring from grab import Grab, DataNotFound from grab.it...