text
stringlengths
475
200k
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditi...
import beanstalkc import yaml import logging import pprint import sys from collections import OrderedDict from .config import config from . import report log = logging.getLogger(__name__) def connect(): host = config.queue_host port = config.queue_port if host is None or port is None: raise Runt...
#!/usr/bin/python # Copyright (c) 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. """Generate new bench expectations from results of trybots on a code review.""" import collections import compare_codereview import...
#!/usr/bin/env python import rospy from actionlib import SimpleActionServer from art_msgs.msg import PickPlaceAction, PickPlaceGoal, PickPlaceResult, PickPlaceFeedback import random class FakeGrasping: ALWAYS = 0 NEVER = 1 RANDOM = 2 def __init__(self): self.left_server = SimpleActionServer(...
# Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, Inc. # Copyright 2013 Alessio Ababilov # Copyright 2013 Grid Dynamics # Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you ...
# 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 os import sys import subprocess from config import gen_config as gc from config import rfam_local as rl # ---------------------------------------------------------------------- def launch_genome_download(project_dir, upid_list): fp = open(upid_list, 'r') upids = [x.strip() for x in fp] fp.close(...
import pytest from datetime import datetime import maya def test_rfc2822(): r = maya.now().rfc2822() d = maya.MayaDT.from_rfc2822(r) assert r == d.rfc2822() def test_iso8601(): r = maya.now().iso8601() d = maya.MayaDT.from_iso8601(r) assert r == d.iso8601() def test_human_when(): r1 =...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compa...
""" Sources: Irish Counties: http://en.wikipedia.org/wiki/Counties_of_Ireland """ from django.utils.translation import ugettext_lazy as _ IE_COUNTY_CHOICES = ( ('antrim', _('Antrim')), ('armagh', _('Armagh')), ('carlow', _('Carlow')), ('cavan', _('Cavan')), ('clare', _('Clare')), ('cork...
""" Copyright (c) 2007 Jan-Klaas Kollhof This file is part of jsonrpc. jsonrpc 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...
#Copyright 2007-2009 WebDriver committers #Copyright 2007-2009 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 b...
from dxr.plugins.clang.tests import CSingleFileTestCase class OperatorCallTests(CSingleFileTestCase): source = """ struct Foo { void operator()(int) { } void operator[](int) { } }; int ...
""" Django's standard crypto functions and utilities. """ import hashlib import hmac import random import time from django.conf import settings from django.utils.encoding import force_bytes # Use the system PRNG if possible try: random = random.SystemRandom() using_sysrandom = True except NotImplementedError:...
# # Copyright (C) 2021 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be...
import unittest, sys, random, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_jobs, h2o_exec as h2e import h2o_util import multiprocessing, os, signal, time from multiprocessing import Process, Queue print "single writer, single reader flows (after sequenti...
import timeit import alignlib NUM_SAMPLES=1000 ALISIZE=2000 alignlib_vector = alignlib.makeAlignmentVector() alignlib_vector.addDiagonal( 0, ALISIZE, 0) python_vector = [] for x in xrange(ALISIZE): python_vector.append(x) def pythonBuildVector(): """build vector alignment in python.""" vector = [] ...
#!/usr/bin/env python # vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import os import socket import sys import codecs import platform import re test_type = sys.argv[1] test_client = sys.argv[2] shell = sys.argv[3] fname = os.path.join('tests', 'shel...
from __future__ import print_function import numpy as np import datetime as dt from bokeh.browserlib import view from bokeh.document import Document from bokeh.embed import file_html from bokeh.models.glyphs import Patch, Line, Text from bokeh.models import ( ColumnDataSource, DataRange1d, DatetimeAxis, Datet...
# # (c) 2016 Red Hat Inc. # # 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 d...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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) ...
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
# coding: utf-8 # # Charge Carrier Trapping Experiment # # CCT = Charge Carrier Trapping - This is a test of comparing the Zhou et al 2017 results with a data driven analysis using multinest # In[ ]: get_ipython().magic('matplotlib inline') from pylab import *;ion() from pandas import read_csv, DataFrame, concat ...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Manuel Sousa <[EMAIL]> # # 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 # ...
# # (c) 2015, Peter Sprygada <[EMAIL]> # # 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. # #...
from django.utils.html import strip_tags from django.utils.translation import ugettext_lazy as _, ungettext from django.utils.timezone import now from django.contrib import messages from django.views import generic from oscar.core.loading import get_model from oscar.core.utils import redirect_to_referrer from oscar.ap...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Mathew Davies <[EMAIL]> # (c) 2017, Sam Doran <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'me...
# -*- 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 'AuditLogEntry.ip_address' db.add_column('sentry_auditlogentry', 'ip_address', ...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The C-Bit Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API from test_framework.test_framework import BitcoinTestFramework from te...
#!/usr/bin/env python ''' This little example shows how a cursor can be created in image viewers, and renderers. The standard TkImageViewerWidget and TkRenderWidget bindings are used. There is a new binding: middle button in the image viewer sets the position of the cursor. ''' import sys from functools import p...
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import itertools import pytest from speaklater import is_lazy_string from sqlalchemy.exc import Integrity...
# This file is part of Copernicus # http://www.copernicus-computing.org/ # # Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as published # by the Free Softwa...
# Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS import trio class ThreadFSAccess: def __init__(self, trio_token, workspace_fs): self.workspace_fs = workspace_fs self._trio_token = trio_token def _run(self, fn, *args): return trio.from_thread.run(fn, *a...
# System imports import subprocess import time from os import path import shutil import numpy as np from flask.ext.cors import CORS from flask import * from werkzeug import secure_filename from flask_extensions import * import math # Local predicition modules # find modules in parent_folder/predictions # sys.path.app...
from direct.gui.DirectGui import * from direct.showbase import DirectObject from pandac.PandaModules import * import sys from otp.otpbase import OTPGlobals from otp.otpbase import OTPLocalizer from toontown.chat.ChatGlobals import * class ChatInputNormal(DirectObject.DirectObject): def __init__(self, chatMgr): ...
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Toolbelt - a utility tu run tools in do...
from test import support import unittest import dummy_threading as _threading import time class DummyThreadingTestCase(unittest.TestCase): class TestThread(_threading.Thread): def run(self): global running global sema global mutex # Uncomment if testing ano...
# Copyright 2016 Twitter. 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 agree...
import mock from nose.tools import * # noqa from tests.base import OsfTestCase from tests.factories import RegistrationFactory, UserFactory from website import models from scripts.email_registration_contributors import ( get_registration_contributors, send_retraction_and_embargo_addition_message, main, MAIL...
# -*- coding: utf-8 -*- # # 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 ...
from __future__ import print_function, division from sympy.core import S, C, sympify, cacheit from sympy.core.function import Function, ArgumentIndexError, _coeff_isneg from sympy.functions.elementary.miscellaneous import sqrt ############################################################################### ##########...
#!/usr/bin/env python # Copyright (c) 2013-2018 Hanson Robotics, Ltd. import unittest import os import yaml import roslaunch import rostopic from roslaunch import core from testing_tools.misc import wait_for, wait_for_message from genpy.message import fill_message_args from sensor_msgs.msg import JointState from tf...
import unittest from testlib import testutil, PygrTestProgram import ConfigParser import os import string import sys from pygr.mapping import Collection import pygr.Data try: import hashlib except ImportError: import md5 as hashlib config = ConfigParser.ConfigParser({'testOutputBaseDir': '.', ...
""" Copyright (c) 2017, Jairus Martin. Distributed under the terms of the MIT License. The full license is in the file LICENSE, distributed with this software. Created on June 7, 2017 @author: jrm """ from atom.api import Typed, set_default from enamlnative.widgets.toggle_button import ProxyToggleButton from .and...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
#!/usr/bin/env python # 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. """PyAuto: Python Interface to Chromium's Automation Proxy. PyAuto uses swig to expose Automation Proxy interfaces to Python. For comp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from decimal import Decimal from django.core.cache import cache from django.db import models from django.test import TestCase from django.utils import unittest from django.utils.translation import ugettext_lazy as _ from rest_framework import status, perm...
from datetime import date from django.contrib.auth.decorators import login_required from django.db.models import Q from django.http import HttpResponseForbidden, JsonResponse from django.shortcuts import render, get_object_or_404 from django.conf import settings from django.views.decorators.csrf import csrf_exempt fro...
# -*- coding: utf-8 -*- # # Copyright 2010-2014 The pygit2 contributors # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, # as published by the Free Software Foundation. # # In addition to the permissions in the GNU General Public Li...
""" Created on Jul 1, 2012 @author: msouza """ import unittest import os import sys import sifter import FunctionModels.Sifter2 from pprint import pprint class Test_Sifter_Deaminase(unittest.TestCase): """ Tests SIFTER inference and leave one out on a toy family. """ def setUp(self): """ ...
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
"""This module contains an extensible mainline that's used by all Cloudfeaster services. """ import logging import optparse import signal import sys import time import tor_async_util import tornado.httpclient import tornado.httpserver import tornado.web from cloudfeaster_services import __version__ from config impor...
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This prog...
# -*- coding: utf-8 -*- # Copyright: (c) 2018, www.privaz.io Valletech AB # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # OpenNebula common documentation DOCUMENTATION = r''' options: api_url: description: ...
import AlGDock.BindingPMF_plots import os, shutil, glob for run_type in ['cool','dock','postprocess','free_energies']: self = AlGDock.BindingPMF_plots.BPMF_plots(\ dir_dock='dock', dir_cool='cool',\ ligand_tarball='prmtopcrd/ligand.tar.gz', \ ligand_database='ligand.db', \ forcefield='prmtopcrd/gaff....
# Copyright 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/licenses/LICENSE-2.0 # # Unless requ...
#========================================================================== # # Copyright Insight Software Consortium # # 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...
__author__ = 'root' #copied from python3 import os import sys def which(cmd, mode=os.F_OK | os.X_OK, path=None): """Given a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` def...
# Needed ctypes routines from ctypes import c_double, byref # Other GDAL imports. from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException from django.contrib.gis.gdal....
# Copyright (c) 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 re from threading import Lock import crash_utils REVIEW_URL_PATTERN = re.compile(r'Review URL:( *)(.*?)/(\d+)') class Match(object): """Re...
#!/usr/bin/python # Copyright: (c) 2017, VEXXHOST, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['pr...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is a skeleton file that can serve as a starting point for a Python console script. To run this script uncomment the following line in the entry_points section in setup.cfg: console_scripts = fibonacci = siftsite.skeleton:run Then run `python setup.py ins...
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # 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...
# -*- coding: utf-8 -*- """ Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis on Heroku - Use sentry for error logging - Use opbeat for error reporting """ from __future__ import absolute_import, unicode_literals fro...
from distutils.core import setup CLASSIFIERS = ( ('Development Status :: 5 - Production/Stable'), ('Environment :: Console'), ('Environment :: Web Environment'), ('Framework :: Django'), #('Framework :: Zope3'), #('Framework :: Trac'), #('Framework :: TurboGears :: Widgets'), #('Framewo...
# -*- coding: utf-8 -*- # pidlockfile.py # # Copyright © 2008–2009 Ben Finney <[EMAIL]> # # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Python Software Foundation License, version 2 or # later as published by the Python Software Foundation. # No warranty expressed ...
""" Integrity check debugging tool for IMAP accounts. Run as: python -m inbox.util.consistency_check --help """ from __future__ import absolute_import, division, print_function import argparse import errno import os import pkg_resources import subprocess import sys from fnmatch import fnmatch from inbox.models...
""" gensuitemodule - Generate an AE suite module from an aete/aeut resource Based on aete.py. Reading and understanding this code is left as an exercise to the reader. """ from warnings import warnpy3k warnpy3k("In 3.x, the gensuitemodule module is removed.", stacklevel=2) import MacOS import EasyDialogs import os ...
#!/usr/bin/python # 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. """Runs Closure compiler on a JavaScript file to check for errors.""" import argparse import os import re import subprocess import sys imp...
# coding: utf-8 """Check if any file has changed and then build this Dockerfile""" import os import sys import subprocess import argparse class DockerOdooImages(object): """Class to build if has changed any file""" def __init__(self, folder, docker_image): """Init method folder : Folder to c...
# # Copyright IBM Corp. 2016 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 ...
#!/usr/bin/env python """ roms.interp Methods to interpolate ROMS fields onto other grids Written by Brian Powell on 11/02/13 Copyright (c)2017 University of Hawaii under the BSD-License. """ import numpy as np import netCDF4 import os import seapy from seapy.timeout import timeout, TimeoutError from joblib...
#!/bin/python #coding=utf-8 import MySQLdb import sys from optparse import OptionParser user_value="reboot" pass_value='reboot123' port_value=3306 def CHECK_ARGV(): argv_dict = {} usage = "usage: %prog [options] arg1 arg2" parser = OptionParser(usage) parser.add_option("-H","--host",dest="hostn...
# # Module implementing queues # # multiprocessing/queues.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must ret...
from django.core.cache import cache from rest_framework.authentication import (BaseAuthentication, get_authorization_header) from ..profiles.models import User from .exceptions import PermissionDenied from .models import check_auth_token class GoogleLoginAuthentication(Base...
import os import shutil import sys import tempfile import unittest from io import StringIO from django.conf import settings from django.contrib.staticfiles import finders, storage from django.contrib.staticfiles.management.commands.collectstatic import \ Command as CollectstaticCommand from django.core.cache.backe...
# 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 'GroupBookmark' db.create_table('sentry_groupbookmark', ( ('id', self.gf('sentry.db.mod...
import codecs from os.path import join,isfile,isdir from os import mkdir def get_intervals(layout): results = [] layout = codecs.open(layout,'r') count = 0 for line in layout: count = count + 1 if count < 8: continue if line.strip()=='': continue # print line.split(' ') numbers = '' segment...
#!/usr/bin/env python import operator from optparse import OptionGroup import sys from time import time from digress.cli import Dispatcher as _Dispatcher from digress.errors import ComparisonError, FailedTestError, DisabledTestError from digress.testing import depends, comparer, Fixture, Case from digress.comparer...
#@+leo-ver=4 #@+node:@file task.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # [EMAIL] # # This file is part of faces. # # faces is free software; you can red...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Serial port support for Windows. Requires PySerial and pywin32. """ from __future__ import division, absolute_import # system imports from serial import PARITY_NONE from serial import STOPBITS_ONE from serial import EIGHTBITS import win32fi...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from django.conf import settings CONTINENTS = ( ("AF", _("Africa")), ("NA", _("North America")), ...
# 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...
""" sentry.models.releasefile ~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.db import models from hashlib import sha1 from sentry.db.models import FlexibleForei...
# 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...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def add_legacy_name(apps, schema_editor): ContentType = apps.get_model('contenttypes', 'ContentType') for ct in ContentType.objects.all(): try: ct.name = apps.get_model(ct.app_label, c...
import django from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.generic import GenericForeignKey from django.db import models, IntegrityError, transaction from django.template.defaultfilters import slugify as default_slugify from django.utils.translation import ugettext_lazy as...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Michael J. Schultz <[EMAIL]> # # 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,...
#!/usr/bin/env python # # $Id: iotop.py 1160 2011-10-14 18:50:36Z [EMAIL] $ # # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Shows real-time network statistics. Author: Giampaolo Rodola' <[EMAIL]> ...
# -*- 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 model 'GeneratedCertificate' db.create_table('certificates_generatedcertificate', ( ('i...
# -*- coding: utf-8 -*- # Copyright © 2012-2015 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 t...
#!/usr/bin/env python # # Copyright 2006,2007,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at you...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unsmuggle_url, ) from ..compat import ( compat_parse_qs, compat_urlparse, ) class SenateISVPIE(InfoExtractor): _COMM_MAP = [ ["ag", "76440", "http://ag...
#coding:utf-8 import numpy as np from mlp import MultiLayerPerceptron from sklearn.datasets import load_digits from sklearn.cross_validation import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.metrics import confusion_matrix, classification_report """ 簡易手書き数字データの認識 scikit-learnのインストール...
""" 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 use this ...
# (c) 2018, Ansible Inc, # # 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 di...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, David Passante <@dpassante> # (c) 2017, René Moser <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {...
# 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 jsparser import * from utils import * import re from utils import * #Note all white space sent to this module must be ' ' so no '\n' REPL = {} #PROBLEMS # <<=, >>=, >>>= # they are unusual so I will not fix that now. a++ +b works fine and a+++++b (a++ + ++b) does not work even in V8 ASSIGNMENT_MATCH = '(?<!=|!...