text
stringlengths
475
200k
#!/usr/bin/env python """ Syncronizam doua fisiere """ from __future__ import print_function import os import argparse import shutil from functii_auxiliare import get_hash from functii_auxiliare import get_last_edit from functii_auxiliare import write_sync_file from functii_auxiliare import read_sync_file from functii_...
# Copyright (c) 2006 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
# Copyright edalize contributors # Licensed under the 2-Clause BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-2-Clause import os import logging from collections import OrderedDict from edalize.edatool import Edatool logger = logging.getLogger(__name__) class Xsim(Edatool): argtypes = ['pl...
#!/usr/bin/env python # Copyright 2014 The Kubernetes 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 # # Unle...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Yesudeep Mangalapilly <[EMAIL]> # Copyright 2012 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://w...
from django.db import models from countries.models import Country from people.models import Person # Models ----------------------------------------- class Company(models.Model): SOLE_TRADER = 1 CORPORATION = 2 TYPE_CHOICES = ( (SOLE_TRADER, 'Sole Trader'), (CORPORATION, 'Corporation'),...
from FileManagement.interface_filehandler import * # Brendan import pickle import os import sys import math # kate import re from datetime import * # Kris Little design class FileHandler(IFileHandler): def __init__(self): self.valid = True # Kris def load_file(self, file): ...
# 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...
# Copyright © 2017 Collabora Ltd. # # This file is part of pfg. # # pfg 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. # # pf...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import time from mcts.webapi_tests.semiauto import TestCase from mcts.webapi_tests.telephony import TelephonyTestCommon...
from __future__ import unicode_literals from functools import total_ordering from django.contrib.gis.geos import ( LinearRing, LineString, Point, Polygon, fromstr, ) from django.utils import six from django.utils.encoding import python_2_unicode_compatible from django.utils.html import html_safe @html_safe @pyt...
from south.tests import unittest import datetime import sys try: set # builtin, python >=2.6 except NameError: from sets import Set as set # in stdlib, python >=2.3 from south import exceptions from south.migration import migrate_app from south.migration.base import all_migrations, Migrations from south.creat...
#coding:utf8 from baseclass.IterativeRecommender import IterativeRecommender from random import choice from tool.qmath import sigmoid from math import log from collections import defaultdict #import tensorflow as tf class BPR(IterativeRecommender): # BPR:Bayesian Personalized Ranking from Implicit Feedback # S...
#!/usr/bin/env python # Copyright (c) 2013 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/licenses/LICE...
import logging import re import os from autotest.client.shared import error from autotest.client.shared import utils from virttest import utils_net, utils_test, utils_misc from virttest import aexpect from virttest import remote from virttest import data_dir @error.context_aware def run(test, params, env): """ ...
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
# coding: utf-8 import json import re import xml.etree.ElementTree from .common import InfoExtractor class JeuxVideoIE(InfoExtractor): _VALID_URL = r'http://.*?\.jeuxvideo\.com/.*/(.*?)-\d+\.htm' _TEST = { u'url': u'http://www.jeuxvideo.com/reportages-videos-jeux/0004/00046170/tearaway-playstation-...
# -*- coding: utf-8 -*- # Copyright © 2014 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the # Software without restriction, including without limitation # the rights to use...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
# Copyright (C) 2010-2014 GRNET S.A. # # 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 # (at your option) any later version. # # This program is distributed i...
from __future__ import with_statement from django.db import connection, transaction, IntegrityError from django.test import TransactionTestCase, skipUnlessDBFeature from models import Reporter class TransactionContextManagerTests(TransactionTestCase): def create_reporter_and_fail(self): Reporter.objects...
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 Ben Kurtovic <[EMAIL]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
from datetime import datetime from django.core.exceptions import ObjectDoesNotExist from ..medications import medications from ..models import Prescription, MedicationDefinition class PrescriptionCreator: """Creates all prescription records after completing patient history model. """ def __init__(self, ...
from unittest import TestCase import json from pycrunchbase.resource.node import Node from pycrunchbase.resource.utils import parse_date class TestNode(Node): KNOWN_PROPERTIES = ['property1', 'property2'] def _coerce_values(self): # intentionally coerce bad values for test purposes attr = '...
import zlib import struct import socket import ssl from synchronousdeluge import rencode __all__ = ["DelugeTransfer"] class DelugeTransfer(object): def __init__(self): self.sock = None self.conn = None self.connected = False def connect(self, hostport): if self.connected: ...
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <[EMAIL]> # # This file is part of subliminal. # # subliminal 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 3 of the License...
""" ============================================================ Empirical evaluation of the impact of k-means initialization ============================================================ Evaluate the ability of k-means initializations strategies to make the algorithm convergence robust as measured by the relative stan...
from . import AWSProperty, AWSAttribute, validate_pausetime from .validators import positive_integer, integer, boolean class AutoScalingRollingUpdate(AWSProperty): props = { 'MaxBatchSize': (positive_integer, False), 'MinInstancesInService': (integer, False), 'PauseTime': (validate_pauseti...
# -*- coding: utf-8 -*- from flask.ext import wtf from google.appengine.api import app_identity import flask import auth import util import model import config from main import app class ConfigUpdateForm(wtf.Form): analytics_id = wtf.StringField('Analytics ID', filters=[util.strip_filter]) announcement_html = ...
# Copyright 2021, The TensorFlow Federated 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...
import asyncio import aiohttp from aiohttp import web import logging from logging import handlers import signal import socket import time import unifi_ws_server class StreamerContext(object): pass class RequestHandler(aiohttp.server.ServerHttpProtocol): def __init__(self, **kwargs): self._log = kwar...
from xml.etree.ElementTree import Element, SubElement, tostring import os import re import traceback import xml.dom.minidom from couchpotato.core.media.movie.providers.metadata.base import MovieMetaData from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import getTitle from ...
import argparse import sys import os from osgeo import ogr from osgeo import osr import anyjson import shapely.geometry import shapely.ops import codecs import time format = '%.8f %.8f' tolerance = 0.01 infile = '/Users/kirilllebedev/Maps/50m-admin-0-countries/ne_50m_admin_0_countries.shp' outfile = 'map.shp' # Open...
"""Test zha switch.""" from unittest.mock import call, patch from homeassistant.components.switch import DOMAIN from homeassistant.const import STATE_ON, STATE_OFF, STATE_UNAVAILABLE from tests.common import mock_coro from .common import ( async_init_zigpy_device, make_attribute, make_entity_id, async_test_devi...
#!/usr/bin/python import struct import sys import hashlib from pyasn1.type import univ from pyasn1.codec.ber import encoder, decoder f = open(sys.argv[1], 'rb') filehdr = f.read(1024) if filehdr[0:2] != 'MZ': print "Not a DOS file." sys.exit(0) pepos = struct.unpack('<I', filehdr[60:64])[0] if filehdr[pepos:p...
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
import os import zipfile from thefuck.utils import for_app def _is_bad_zip(file): with zipfile.ZipFile(file, 'r') as archive: return len(archive.namelist()) > 1 def _zip_file(command): # unzip works that way: # unzip [-flags] file[.zip] [file(s) ...] [-x file(s) ...] # ^ ...
# encoding: 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 'Project.status' db.add_column('sentry_project', 'status', self.gf('django.db.models.fields.Positiv...
from django.db.models import Prefetch, prefetch_related_objects from django.test import TestCase from .models import Author, Book, Reader class PrefetchRelatedObjectsTests(TestCase): """ Since prefetch_related_objects() is just the inner part of prefetch_related(), only do basic tests to ensure its API h...
# -*- coding: utf-8 -*- """ ########## # Fields # ########## Each Field class does some sort of validation. Each Field has a clean() method, which either raises django.forms.ValidationError or returns the "clean" data -- usually a Unicode object, but, in some rare cases, a list. Each Field's __init__() takes at least...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
# -*- coding: iso-8859-1 -*- # Copyright (C) 2011 Daniele Simonetti # # 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, or # (at your option) any later versi...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible CHOICES = ( (1, 'first'), (2, 'second'), ) @python_2_unicode_compatible class Article(models.Model): headline = models.CharField(max_length=100, defa...
# Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# -*- 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 'DocumentSet.header_image' db.add_column(u'crowdataapp_documentset', 'header_image', ...
# 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...
""" hyperbola URL Configuration. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
import pytest from selenium import webdriver from selenium.common.exceptions import TimeoutException from selene import config from selene.common.none_object import NoneObject from selene.driver import SeleneDriver from tests.acceptance.helpers.helper import get_test_driver from tests.integration.helpers.givenpage imp...
# -*- coding: utf-8 -*- import multiscanner def test_valid_reports_string(): reportlist = [([('file', 'result')], {'Name': 'Test', 'Type': 'Test'})] r = multiscanner.parse_reports(reportlist, python=False) assert r == '{"file":{"Test":"result"}}' def test_valid_reports_python(): reportlist = [([('fi...
#!/usr/bin/env python import logging import os import sys from django.core.management import execute_from_command_line if 'DJANGO_SETTINGS_MODULE' not in os.environ: if len(sys.argv) > 1 and sys.argv[1] == 'test': os.environ['DJANGO_SETTINGS_MODULE'] = 'settings_test' else: os.environ.setdefau...
# Microsoft Azure Linux Agent # # Copyright 2018 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Kevin Brebanov <https://github.com/kbrebanov> # Based on pacman (Afterburn <https://github.com/afterburn>, Aaron Bull Schaefer <[EMAIL]>) # and apt (Matthew Williams <[EMAIL]>) modules. # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licens...
from collections import OrderedDict from collections.abc import Mapping, Iterator from contextlib import contextmanager from functools import partial from hashlib import md5 from operator import getitem import inspect import pickle import os import threading import uuid from distutils.version import LooseVersion from ...
# Copyright (C) 2008-2010 Adam Olsen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2009, 2010, 2011, 2013 CERN. # # Invenio 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, or (at your...
""" Belgium-specific Form helpers """ from __future__ import absolute_import from django.contrib.localflavor.be.be_provinces import PROVINCE_CHOICES from django.contrib.localflavor.be.be_regions import REGION_CHOICES from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy...
""" Helper routines for catkin. These are distributed inside of rosdep2 to protect catkin against future rosdep2 API updatese. These helper routines are assumed to run in an interactive mode with an end-user and thus return end-user oriented error messages. Errors are returned as arguments to raised :exc:`Validation...
""" Wrapper for loading templates from the filesystem. """ from django.conf import settings from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.utils._os import safe_join class Loader(BaseLoader): is_usable = True def get_template_sources(self, temp...
#!/usr/bin/env python # Copyright (c) 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 unittest from idl_lexer import IDLLexer from idl_ppapi_lexer import IDLPPAPILexer # # FileToTokens # # From a source file ...
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. # All rights reserved. """Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line o...
# -*- coding: utf-8 -*- """ *************************************************************************** __init__.py --------------------- Date : May 2016 Copyright : (C) 2016 by Victor Olaya Email : volayaf at gmail dot com *********************************...
import numpy as np import glob import struct import pdb import re class Nchilada(object): def __init__(self, filename): self.codedict = {1: 'int8', 2: 'uint8', 3: 'int16', 4: 'uint16', 5: 'int32', ...
""" 该文件是游戏的一些设置选项 """ class Settings(): """ 存储游戏的所有设置的类 """ def __init__(self): """ 初始化游戏的设置 """ self.screen_width = 1920 self.screen_height = 900 self.bg_color = (230, 230, 230) # 飞船设置 self.ship_limit = 3 # 设置子弹 self.bullet_width = 3 se...
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
import io import os import sys import unittest class Test_TestProgram(unittest.TestCase): def test_discovery_from_dotted_path(self): loader = unittest.TestLoader() tests = [self] expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__)) self.wasRun = False ...
""" ======================================================================= Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood ======================================================================= When working with covariance estimation, the usual approach is to use a maximum likelihood estimator,...
""" Tests for utilities that parse event logs. """ from opaque_keys.edx.locator import CourseLocator import edx.analytics.tasks.util.opaque_key_util as opaque_key_util from edx.analytics.tasks.tests import unittest VALID_COURSE_ID = unicode(CourseLocator(org='org', course='course_id', run='course_run')) VALID_LEGAC...
import os, shutil, sys, time from . import globals, builder if sys.version_info.major == 3: from tkinter import * else: from Tkinter import * # from tkFileDialog import * from PIL import Image, ImageTk class ScrollIt(): def __init__(self): self.image1 = Image.open(mGui.btn2text.get()[9:] + '-sc...
# encoding: 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 model 'BillingReport' db.create_table('teams_billingreport', ( ('end_date', self....
# event/api.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Public API functions for the event system. """ from __future__ import absolute_import...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (c) 2018 Cisco and/or its affiliates. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
#!/bin/env python __author__ = "John Hover" __copyright__ = "2017 John Hover" __credits__ = [] __license__ = "GPL" __version__ = "0.9.1" __maintainer__ = "John Hover" __email__ = "[EMAIL]" __status__ = "Production" import logging import random import string class InfoConnectionFailure(Exception): ''' Network...
#._cv_part guppy.heapy.Prof from Tkinter import * import tkFileDialog import tkMessageBox class MyVar(StringVar): _default = 0.0 def set(self, value): StringVar.set(self, '%.2g'%value) suffixes = ('','K','M','G','T') def sizestring(value): value = float(value) sign = 1 if value < 0: sign = -1...
""" For a given aws account, go through all un-attached volumes and tag them. """ import boto import boto.utils import argparse import logging import subprocess import time import os from os.path import join, exists, isdir, islink, realpath, basename, dirname import yaml # needs to be pip installed import netaddr LO...
""" ======================================================================= Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood ======================================================================= The usual estimator for covariance is the maximum likelihood estimator, :class:`sklearn.covariance.Em...
from indra.statements import * from bioagents.mra.model_diagnoser import ModelDiagnoser from indra.assemblers.pysb import PysbAssembler from nose.plugins.attrib import attr drug = Agent('PLX4720') raf = Agent('RAF', db_refs={'FPLX': 'RAF'}) mek = Agent('MEK', db_refs={'FPLX': 'MEK'}) erk = Agent('ERK', db_refs={'FPLX...
"""CallTips.py - An IDLE Extension to Jog Your Memory Call Tips are floating windows which display function, class, and method parameter and docstring information when you type an opening parenthesis, and which disappear when you type a closing parenthesis. """ import re import sys import types from idlelib import C...
# Copyright 2015 Intel 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 require...
# # 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...
import unittest import getpass import os import shutil import time import tempfile from nose.plugins.skip import SkipTest from ansible.runner.action_plugins.synchronize import ActionModule as Synchronize class FakeRunner(object): def __init__(self): self.connection = None self.transport = None ...
#!/usr/bin/env python # Copyright (c) 2012 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. """Unittest for chrome_messages_json.py. """ import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os.pat...
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db import connections from django.db.models.query_utils import Q from django.db.models.sql.constants import ( CURSOR, GET_ITERATOR_CHUNK_SIZE, NO_RESULTS, ) from django...
#!/usr/bin/env python import sys from os import path, mkdir from vipsCC import * sizes = { 'ldpi':3, 'mdpi':4, 'hdpi':6, 'xhdpi':8, 'xxhdpi':12, 'xxxhdpi':16 } if ( len(sys.argv) < 2): print """ (H)Andy Image Resize ----------------------------------- This program resizes images into ldpi to xxxhdpi ** I...
class Command: def __init__(self, args, redirects): self.args = list(args) self.redirects = list(redirects) def __repr__(self): return 'Command(%r, %r)' % (self.args, self.redirects) def __eq__(self, other): if not isinstance(other, Command): return False ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
"""Handle AMQP Heartbeats""" import logging import pika.exceptions from pika import frame LOGGER = logging.getLogger(__name__) class HeartbeatChecker(object): """Sends heartbeats to the broker. The provided timeout is used to determine if the connection is stale - no received heartbeats or other activit...
#! /bin/env python import sys from optparse import OptionParser import copy import matplotlib matplotlib.use('Agg') import pylab import scipy.optimize import numpy from numpy import array import dadi import os #call ms program from within dadi, using optimized parameters (converted to ms units) core = "-n 1 0.922 -n 2...
""" ViewSets are essentially just a type of class based view, that doesn't provide any method handlers, such as `get()`, `post()`, etc... but instead has actions, such as `list()`, `retrieve()`, `create()`, etc... Actions are only bound to methods at the point of instantiating the views. user_list = UserViewSet.a...
# coding: utf-8 # # Copyright 2014 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 requi...
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...
#!/usr/bin/python # """ Reset an Protocol in the database to 0 """ import sys import yaml from optparse import OptionParser def reset_protocol(file, dest, name, attributes=None): try: with open(file, 'r') as stream: database = yaml.load(stream) except Exception, ex: print "Excepti...
import uuid from django.http import HttpRequest from django.test import TestCase from corehq.apps.domain.shortcuts import create_domain from corehq.apps.reports.cache import CacheableRequestMixIn, request_cache from corehq.apps.users.models import WebUser class MockReport(CacheableRequestMixIn): def __init__(sel...
# -*- test-case-name: twisted.trial.test.test_trial -*- # # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # # Author: Jonathan D. Simms <[EMAIL]> # Original Author: Jonathan Lange <[EMAIL]> from __future__ import generators import sys, types import warnings from twisted.python impor...
# system call top # (c) 2010, Tom Zanussi <[EMAIL]> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified, the displa...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # [EMAIL] # # This program is free software: you can redistribute it and/or mo...