text
stringlengths
475
200k
# # GUI for Update Agent # Copyright (c) 1999--2016 Red Hat, Inc. Distributed under GPLv2. # # Authors: # Preston Brown <[EMAIL]> # Adrian Likins <[EMAIL]> # Daniel Benamy <[EMAIL]> import os import sys import gtk import gtk.glade gtk.glade.bindtextdomain("rhn-client-tools", "/usr/share/locale") # We have...
# Copyright 2008-2015 Canonical # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero 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...
from django.contrib.gis.gdal import Envelope, OGRException from django.utils import unittest class TestPoint(object): def __init__(self, x, y): self.x = x self.y = y class EnvelopeTest(unittest.TestCase): def setUp(self): self.e = Envelope(0, 0, 5, 5) def test01_init(self): ...
""" A comparison of different methods in GLM Data comes from a random square matrix. """ from datetime import datetime import numpy as np from sklearn import linear_model from sklearn.utils.bench import total_seconds if __name__ == '__main__': import pylab as pl n_iter = 40 time_ridge = np.empty(n_it...
############################################################################### ## ## Copyright 2011 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://www...
# coding=utf-8 # # ROSREPO # Manage ROS workspaces with multiple Gitlab repositories # # Author: Timo Röhling # # Copyright 2016 Fraunhofer FKIE # # 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 a...
# Limon # Copyright (C) 2015 Monnappa # # This file is part of Limon. # # Limon 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. # Limo...
# Minimal Python Minimizer # Copyright 2008, Christopher Schmidt # Released under the MIT License # # Taken from: http://svn.crschmidt.net/personal/python/minimize.py # $Id: minimize.py 6 2008-01-03 06:33:35Z crschmidt $ # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software...
#!/usr/bin/env python # # Copyright 2020 Confluent 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...
import numpy as np from games.constants import * k = BLACK g = GREEN w = WHITE r = RED b = BLUE m = DARK_RED n = DARK_BLUE p = PURPLE o = ORANGE y = YELLOW NAV_SCREENS = { "Snake": np.array( [ [m, w, m, m, m, m, w, m], [w, m, m, m, m, m, m, w], [m, w, m, m, m, m, w...
""" ===================== SVM: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. The sample weighting rescales the C parameter, which means that the classifier puts more emphasis on getting these points right. The effect might ...
# Copyright 2011-2012 James McCauley # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# -*- coding: utf-8 -*- """ *************************************************************************** CanopyModel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com --------------------- ...
import os from traitlets import Bool from traitlets import default from traitlets import Dict from traitlets import Float from traitlets import Int from traitlets import List from traitlets import TraitType from traitlets import Union from traitlets.config import Configurable try: # Traitlets >= 4.3.3 from tr...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from pylib.base import environment from pylib.device import adb_wrapper from pylib.device import device_errors from pylib.device import device_utils from pyl...
"""Tests for student tracking""" import mock from django.test import TestCase from django.core.urlresolvers import reverse, NoReverseMatch from track.models import TrackingLog from track.views import user_track from nose.plugins.skip import SkipTest class TrackingTest(TestCase): """ Tests that tracking logs ...
"""Stuff that differs in different Python versions""" import os import imp import sys import site __all__ = ['WindowsError'] uses_pycache = hasattr(imp, 'cache_from_source') class NeverUsedException(Exception): """this exception should never be raised""" try: WindowsError = WindowsError except NameError: ...
# Copyright 2012 IBM Corp. # # 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 t...
# -*- coding: utf-8 -*- # # # Sale Fiscal Position Update module for OpenERP # Copyright (C) 2011-2014 Julius Network Solutions SARL <[EMAIL]> # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Mathieu Vatel <mathieu _at_ julius.fr> # @author Alexis de Lattre <[EMAIL]> # # This program ...
# 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...
import os import sys from distutils.core import setup from distutils.extension import Extension f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup_kwargs = {} try: from Cython.Distutils import build_ext except ImportError: cython_installed = False else: cytho...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsSearchWidgetWrapper. .. note:: 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 version...
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2008 Brendan Dolan-Gavitt <[EMAIL]> # # Additional Authors: # Mike Auty <[EMAIL]> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
import os import shutil import tempfile import contextlib import unittest import argparse import sys import torch import __main__ import random import inspect from numbers import Number from torch._six import string_classes from collections import OrderedDict import numpy as np from PIL import Image from _assert_uti...
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
# Copyright (c) 2009 Mikael Lind # # 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, modify, merge, publish, distr...
"""functions helper.""" from ast import literal_eval import base64 import os import hashlib import random import uuid import time import shutil import re import socket import _thread import OpenSSL import redis def addAppPath(path): """Add a path to sys path.""" os.sys.path.append(path) def getCwd(): ""...
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
# # Copyright (c) 2013-2018 Quarkslab. # This file is part of IRMA project. # # 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 in the top-level directory # of this distribution and at: # # http:...
"""Split single OBJ model into mutliple OBJ files by materials ------------------------------------- How to use ------------------------------------- python split_obj.py -i infile.obj -o outfile Will generate: outfile_000.obj outfile_001.obj ... outfile_XXX.obj ------------------------------------- Parser based ...
# Copyright 2011, Google 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 must retain the above copyright # notice, this list of conditions and the f...
''' Problem 32 from Project Euler We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital. The product 7254 is unusual, as the identity, 39 * 186 = 7254, containing multiplicand, multiplier, and product i...
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2013 Google Inc. All Rights Reserved. """The super-group for the update manager.""" import argparse import os import textwrap from googlecloudsdk.core.util import platforms from googlecloudsdk.calliope import base from googlecloudsdk.calliope import exceptions from googlecloudsdk.core import config from...
from django.db import models from django.utils import timezone class ReceiveAddress(models.Model): address = models.CharField(max_length=128, blank=True) available = models.BooleanField(default=True) @classmethod def newAddress(cls, address): receive_address = cls() receive_address.add...
# 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...
""" Black-box tests of the DjangoUserStateClient against the semantics defined in edx_user_state_client. """ from collections import defaultdict from unittest import skip from django.test import TestCase from edx_user_state_client.tests import UserStateClientTestBase from courseware.user_state_client import DjangoXB...
#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 thi...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import json import datetime import mimetypes import os import frappe from frappe import _ import frappe.model.document import frappe.utils import frappe.sessions import werkzeug.u...
# 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...
# test memoryview try: memoryview except: print("SKIP") raise SystemExit try: import uarray as array except ImportError: try: import array except ImportError: print("SKIP") raise SystemExit # test reading from bytes b = b'1234' m = memoryview(b) print(len(m)) print(m[0],...
""" Discrete Fourier Transform (:mod:`numpy.fft`) ============================================= .. currentmodule:: numpy.fft Standard FFTs ------------- .. autosummary:: :toctree: generated/ fft Discrete Fourier transform. ifft Inverse discrete Fourier transform. fft2 Discrete Fourier tr...
""" ================================ SVM Exercise ================================ A tutorial exercise for using different SVM kernels. This exercise is used in the :ref:`using_kernels_tut` part of the :ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. """ print(__doc__) import numpy as np i...
#!/usr/bin/python3 import logging logging.basicConfig(level=logging.DEBUG) from binascii import b2a_hex import bitcoin.txn import bitcoin.varlen import jsonrpc import jsonrpcserver import jsonrpc_getwork import merkletree import socket from struct import pack import sys import threading from time import time from uti...
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # 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 yo...
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- # Copyright 2010 Google Inc. All Rights Reserved. """Tests for grr.client.client_actions.plist.""" import os # pylint: disable=unused-import from grr.client import client_plugins # pylint: enable=unused-import from grr.client import vfs from grr.lib ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from gensim import corpora, models, similarities #, ldamodel import sys import re import latin.ansi_color as ansi_color import latin.textutil as textutil import latin.latin_char as char import latin.latindic as latindic import latin.util as util from latin.LatinObject im...
"""Macintosh binhex compression/decompression. easy interface: binhex(inputfilename, outputfilename) hexbin(inputfilename, outputfilename) """ # # Jack Jansen, CWI, August 1995. # # The module is supposed to be as compatible as possible. Especially the # easy interface should work "as expected" on any platform. # XXX...
# -*- coding: utf-8 -*- """ pygments.lexers.shell ~~~~~~~~~~~~~~~~~~~~~ Lexers for various shells. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu...
""" Provide tests for sysadmin dashboard feature in sysadmin.py """ import glob import os import re import shutil import unittest from util.date_utils import get_time_display, DEFAULT_DATE_TIME_FORMAT from nose.plugins.attrib import attr from django.conf import settings from django.contrib.auth.hashers import check_pa...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# 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 ...
# Copyright (c) 2010 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 ...
#!/usr/bin/env python # # Copyright (C) 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 by applicable ...
# -*- 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Ansible Project # # 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', ...
# 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 M2M table for field followers on 'SubtitleLanguage' db.create_table('videos_subtitlelanguage_...
# ScintillaData.py - implemented 2013 by Neil Hodgson [EMAIL] # Released to the public domain. # Common code used by Scintilla and SciTE for source file regeneration. # The ScintillaData object exposes information about Scintilla as properties: # Version properties # version # versionDotted # versionCommad...
#!/usr/bin/python # Copyright 2016 Jakub Jursa <[EMAIL]> # # This module 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 softw...
import os, sys, unittest sys.path.append(os.path.join('..')) from twyg.css3colors import color_to_rgba, rgba_to_color class TestCSS3Colors(unittest.TestCase): def test_valid(self): r, g, b, a = color_to_rgba('aquamarine') c = rgba_to_color(r, g, b, a, format='rgb') self.as...
#!/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. """ Creates a library loader (a header and implementation file), which is a wrapper for dlopen or direct linking with given library...
""" Script for removing all redundant Mac OS metadata files (with filename ".DS_Store" or with filename which starts with "._") for all courses """ import logging from django.core.management.base import BaseCommand from xmodule.contentstore.django import contentstore log = logging.getLogger(__name__) class Command...
import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import random import sys from PrimeDual import * from utils import save_model import torch.backends.cudnn as cudnn cudnn.benchmark = True def train(Project, params, dataset, dist, P_joint...
from __future__ import unicode_literals import re import itertools from .common import InfoExtractor from ..utils import unified_strdate class VineIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vine\.co/(?:v|oembed)/(?P<id>\w+)' _TESTS = [{ 'url': 'https://vine.co/v/b9KOOWX7HUx', 'md5'...
# -*- coding: utf-8 -*- # $Id: manpage.py 6270 2010-03-18 22:32:09Z milde $ # Author: Engelbert Gruber <[EMAIL]> # Copyright: This module is put into the public domain. # Rewritten almost completely # by Marcello Perathoner <[EMAIL]> """ Nroff writer for reStructuredText. Tweaked for Project Gutenberg usage. """ __...
# Copyright 2012, Google 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 must retain the above copyright # notice, this list of conditions and the f...
# Copyright (C) 2010 Google 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 must retain the above copyright # notice, this list of conditions and the...
# # qutip benchmark: mesolve 8 spin chain # import time try: from numpy import * from qutip import * except: print("nan") import sys sys.exit(1) def benchmark(runs=1): """ mesolver evolution of 8-spin chain """ test_name='8-spin ME [256]' N = 8# number of spins # uniform pa...
#!/usr/bin/env python # encoding: utf-8 # The benchmark is distributed under the Creative Commons, # Attribution-NonCommercial-NoDerivatives. This license includes the benchmark database # and its derivatives. For attribution, please cite this page, and our publications below. # This data is provided free of charge fo...
import struct from decimal import Decimal from twisted.internet import reactor from zmqbase import ClientBase import bitcoin import models import serialize import error_code def unpack_error(data): value = struct.unpack_from('<I', data, 0)[0] return error_code.error_code.name_from_id(value) def pack_block_...
# 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...
#!/usr/bin/env python import sys import rospy import serial import struct import binascii import time from teleop_twist_keyboard.msg import Command from xbee import ZigBee xbee = None XBEE_ADDR_LONG = '\x00\x13\xA2\x00\x40\x86\x96\x4F' XBEE_ADDR_SHORT = '\xFF\xFE' DEVICE = '/dev/tty.usbserial-A603HA9K' #Each bot will...
from django import forms from portfolio.models import Security, Transaction, Account from currency_history.models import Currency class BuyForm(forms.ModelForm): #def __init__(self, *pa, **ka): #super(BuyForm, self).__init__(*pa, **ka) #self.fields['security'].queryset = Security.objects.all() ...
""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-su...
""" Django Extensions additional model fields """ import re import six import warnings try: import uuid HAS_UUID = True except ImportError: HAS_UUID = False try: import shortuuid HAS_SHORT_UUID = True except ImportError: HAS_SHORT_UUID = False from django.core.exceptions import ImproperlyConf...
from django.contrib import admin from django.forms.models import BaseInlineFormSet from django.forms.fields import BooleanField from django.forms.formsets import DELETION_FIELD_NAME from django.forms.util import ErrorDict from django.utils.translation import ugettext as _ from multilingual.languages import * from mult...
from django.conf.urls.defaults import * from django.contrib.admindocs import views urlpatterns = patterns('', url('^$', views.doc_index, name='django-admindocs-docroot' ), url('^bookmarklets/$', views.bookmarklets, name='django-admindocs-bookmarklets' ), url('^tags/$...
# Copyright 2013 IBM Corp. # # 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 t...
# Copyright 2018 Canonical, Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero 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 distribute...
# -*- coding: utf-8 -*- # # This file is part of Inspirehep. # Copyright (C) 2016, 2017, 2018 CERN. # # Inspirehep 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...
# # Copyright (C) 2013,2014 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (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 #...
# 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...
#!/usr/bin/env python # # Copyright 2005 Google 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 must retain the above copyright # notice, this list of...
#!/usr/bin/python # (c) 2018, NetApp, 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': ['preview'], ...
from __future__ import print_function, division from sympy.core import Basic class CartanType_generator(Basic): """ Constructor for actually creating things """ def __call__(self, *args): c = args[0] c = list(c) letter, n = c[0], int(c[1]) if n < 0: raise ...
import re from django.template import Node, Variable, VariableNode, _render_value_in_context from django.template import TemplateSyntaxError, TokenParser, Library from django.template import TOKEN_TEXT, TOKEN_VAR from django.utils import translation from django.utils.encoding import force_unicode register = Library()...
# Rekall Memory Forensics # # Copyright 2016 Google Inc. All Rights Reserved. # # 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 v...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
## @file Compare_Songs.py # Compare Songs # @brief Functions associated with the collection of tracks to compare against # @details This file describes the methods by which we collect songs to process # against our user profile. import sys import spotipy import spotipy.util as util import Assemble_Profile...
# 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/LICENSE-2.0 # # Unless ...
import os import logging import serial from RPi.GPIO import * class BluetoothSerial: def __init__(self, usb, pin): self.usb = usb self.pin = pin self.port = None self.buffer = "" setmode(BCM) setup(self.pin, IN) self.Connected = False self.JustConnect...
#!/usr/bin/env python # # 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 # "L...
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
#!/bin/python import os import sys import re import urllib2 import random import datetime dbfile=""; def getSQLiteRows(sql): key=str(random.randint(0,9999)); os.system("sqlite3 \""+dbfile+"\" \""+sql+"\" > db_file_"+key); all_content=""; if(os.path.exists("db_file_"+key)): all_content=open("db_file_"+key,"r").re...
from javascript import console from browser import timer import math class Queue: def __init__(self): self._list=[] def empty(self): return len(self._list) == 0 def put(self, element): self._list.append(element) def get(self): if len(self._list) == 0: raise BaseError ...
# Copyright 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 in...
# coding: utf-8 from __future__ import unicode_literals import re import random from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, unified_strdate, ) class PornoVoisinesIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?pornovoisines\.com/showvideo/(?P<id>\d+)/(?P<...