gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from time import *
from tkinter import *
from random import *
import webbrowser
from modules.affichage import *
from modules.mouvements import *
from modules.recherche import *
from modules.menu import *
from modules.gestionnaire import *
def dec(cube,can,faceT):
if faceT[0]==0:
if faceT[1]==2: faceT[1]=0
elif f... | |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import itertools
import os
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Iterable, Mappin... | |
from __future__ import absolute_import
import responses
import six
from django.core.urlresolvers import reverse
from sentry.models import Environment, Integration, Rule, RuleActivity, RuleActivityType, RuleStatus
from sentry.testutils import APITestCase
from sentry.utils import json
class ProjectRuleDetailsTest(AP... | |
#! /usr/bin/env python
# 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
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Segment pixel-wise street/not street for a single image with a lasagne model.
"""
import logging
import sys
import time
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',
level=logging.DEBUG,
stream=sys.stdout)... | |
# Copyright 2015, 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... | |
import numpy as np
import re
from writeOnFiles import writeFile
from taxoTree import TaxoTree,printTree
from misc import mem,isInDatabase,partitionSampleByMetadatumValue,setOperations
from graph import Graph
from kruskal import kruskal
from comparisonFunctions import printComparison,f
from distanceFunctions import pr... | |
# Computes the t-statistics on Gini. Not very elegant, but faster.
import math
import csv
from scipy import stats
import numpy
def tstat(x1, x2, s1, s2, n):
'''
(float, float, float, float, int) => float
Computes the t-statistic for two datasets.
'''
t = (x1 - x2) / math.sqrt((s1**2 +s2**2)/n)
... | |
"""Tests for go.apps.sequential_send.vumi_app"""
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.task import Clock, LoopingCall
from vumi.message import TransportUserMessage
from vumi.tests.helpers import VumiTestCase
from vumi.tests.utils import LogCatcher
from go.apps.sequenti... | |
#!/usr/bin/env python
"""Windows specific utils."""
import ctypes
import exceptions
import logging
import os
import re
import time
import _winreg
import ntsecuritycon
import pywintypes
import win32api
import win32file
import win32security
from google.protobuf import message
from grr.lib import config_lib
from grr.l... | |
"""
Tests for the BNMF Variational Bayes algorithm, with optimised matrix operation updates.
"""
import sys, os
project_location = os.path.dirname(__file__)+"/../../../"
sys.path.append(project_location)
import numpy, math, pytest, itertools, random
from BNMTF.code.models.bnmf_vb_optimised import bnmf_vb_optimised
... | |
#!/usr/bin/python
# Compresses the core Blockly files into a single JavaScript file.
#
# Copyright 2012 Google Inc.
# http://blockly.googlecode.com/
#
# 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 Licen... | |
from .. import BaseProvider, ElementsType
# Data source
#
# The country codes in this provider comes from the following source:
# List of country calling codes
# https://en.wikipedia.org/wiki/List_of_country_calling_codes
#
# Data was collected from the alphabetical listing by country or region
localized = True
cla... | |
# test_ptypes.py
# Copyright (c) 2013-2019 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0103,C0111,W0108
# PyPI imports
import numpy as np
from pmisc import AE
# Intra-package imports
import peng.ptypes
###
# Global variables
###
emsg = lambda msg: (
"[START CONTRACT MSG: {0}]Argument `*[a... | |
'''This module implements specialized container datatypes providing
alternatives to Python's general purpose built-in containers, dict,
list, set, and tuple.
* namedtuple factory function for creating tuple subclasses with named fields
* deque list-like container with fast appends and pops on either end
* Cha... | |
# -*- coding: utf-8 -*-
from __future__ import division
import logging
import random
import time
import unittest
import psycopg2.extensions
from jukoro import arrow
from jukoro import pg
from .base import Base, BaseWithPool
__all__ = ['TestPgPool', 'TestPgConnection', 'TestHistory', 'TestAutoCommit',
... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
#!/usr/bin/env python
# tile2360.py -- convert NetHack 3.4.3 tile sets most of the way to 3.6.0
#
# Copyright (c) 2015, Ray Chason
# 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. Redistribu... | |
#!/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... | |
"""Home Assistant auth provider."""
import asyncio
import base64
from collections import OrderedDict
import logging
from typing import Any, Dict, List, Optional, Set, cast
import bcrypt
import voluptuous as vol
from homeassistant.const import CONF_ID
from homeassistant.core import HomeAssistant, callback
from homeass... | |
from scanner_engine.utils.redirection.utils import run_redirection_scan
from scanner_engine.utils.watcher.utils import run_watcher_scan
from register_site.models import RedirectionsIndex, EntriesIndex, WatchersIndex
from scanner_engine.models import RedirectionScanResult
from rest_framework import viewsets
from rest_fr... | |
'''
With this recipe, you can control pan/tilt and preset of Sony VISCA Color Video Camera.
'''
# <!-- parameters
param_disabled = Parameter({'desc': 'Disables this node?', 'schema': {'type': 'boolean'}})
param_ipAddress = Parameter({'schema': {'type': 'string'}})
_port = 52381
param_port = Parameter({'schema': {'t... | |
# coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants_test.pant... | |
# Copyright 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 requ... | |
import os
import shutil
import sys
import tempfile
from resdk import Resolwe
from ..base import URL, USER_PASSWORD, USER_USERNAME, BaseResdkFunctionalTest
TEST_FILES_DIR = os.path.abspath(
os.path.normpath(os.path.join(__file__, "../../../files"))
)
DOCS_SCRIPTS_DIR = os.path.abspath(
os.path.normpath(os.pat... | |
from django import forms
from django.contrib.auth import authenticate
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext as _
from .. import scope
from ..constants import RESPONSE_TYPE_CHOICES, SCOPES
from ..forms import OAuthForm, OAuthValidationError
from ..scope import SCOP... | |
#!/usr/bin/env vpython
# Copyright 2021 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.
"""Unit tests for classes in gtest_utils.py."""
import unittest
import gtest_utils
FAILURES = [
'NavigationControllerTest.Reload... | |
#
# FILE: TreeBrowser.py
#
# DESCRIPTION:
# This file provides a generic hierarchical tree browser widget.
#
# AUTHOR: Steve Kinneberg <[email protected]>,
# MontaVista Software, Inc. <[email protected]>
#
# Copyright 2001 MontaVista Software Inc.
#
# This program is free software; you can redist... | |
from __future__ import absolute_import, unicode_literals
import io
import os
import sys
from collections import defaultdict
from functools import partial
from distutils.errors import DistutilsOptionError, DistutilsFileError
from setuptools.py26compat import import_module
from setuptools.extern.six import string_types
... | |
from hearthbreaker.cards.minions.neutral import (
BloodfenRaptor,
IronbeakOwl,
NoviceEngineer,
StonetuskBoar,
WarGolem,
MogushanWarden,
FaerieDragon,
KoboldGeomancer,
ElvenArcher,
ArgentSquire,
SilvermoonGuardian,
TwilightDrake,
MagmaRager,
DireWolfAlpha,
Worg... | |
" ""VK API description"""
# Copyright (c) 2015-2016 The Khronos Group Inc.
# Copyright (c) 2015-2016 Valve Corporation
# Copyright (c) 2015-2016 LunarG, Inc.
# Copyright (c) 2015-2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with t... | |
# -*- test-case-name: diamondash.tests.test_server -*-
"""Diamondash's web server functionality"""
import yaml
import json
from os import path
from glob import glob
from pkg_resources import resource_filename, resource_string
from twisted.web import http
from twisted.web.static import File
from twisted.web.template ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
'''Utilities.py - Tools for writing reproducible scripts
=========================================================
The :mod:`Utilities` modules contains utility functions for argument
parsing, logging and record keeping within scripts.
This module is imported by most UMI-tools tools. It provides convenient
and consis... | |
# This file is part of VoltDB.
# Copyright (C) 2008-2013 VoltDB Inc.
#
# This file contains original code and/or modifications of original code.
# Any modifications made by VoltDB Inc. are licensed under the following
# terms and conditions:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a... | |
#
# Copyright 2005 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 2, or (at your option)
# any later version.
#
#... | |
# -*- test-case-name: txweb2.test.test_util -*-
##
# Copyright (c) 2005-2015 Apple Inc. 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 w... | |
# mapping of entity names to utf-8 values
# lists all characters in the "XHTML 1.1 + MathML 2.0" DTD
map_utf8 = {
"CloseCurlyDoubleQuote": "\xe2\x80\x9d",
"CloseCurlyQuote": "\xe2\x80\x99",
"LeftAngleBracket": "\xe2\x8c\xa9",
"LeftCeiling": "\xe2\x8c\x88... | |
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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: iso-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <[email protected]>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files... | |
# Copyright 2020 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 required by applicable ... | |
#! /usr/bin/env python
"""Write structured grids to NetCDF files.
Write netcdf
++++++++++++
.. autosummary::
~landlab.io.netcdf.write.write_netcdf
"""
import pathlib
import numpy as np
import xarray as xr
from landlab.io.netcdf._constants import (
_AXIS_COORDINATE_NAMES,
_AXIS_DIMENSION_NAMES,
_NP_... | |
from __future__ import annotations
from django.db import connection
from django.test import TestCase
from django.test.utils import override_settings
from django_mysql.rewrite_query import rewrite_query
from tests.testapp.utils import CaptureLastQuery
class RewriteQueryTests(TestCase):
def test_it_doesnt_touch_n... | |
"""
SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested w... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# gen_oxml_classes.py
#
"""
Generate class definitions for Open XML elements based on set of declarative
properties.
"""
import sys
from string import Template
class ElementDef(object):
"""
Schema-related definition of an Open XML element
"""
instances =... | |
import logging
from urllib import quote
from urlparse import urlparse
from pylons import config
import ckan.lib.base as base
import ckan.model as model
import ckan.lib.helpers as h
import ckan.new_authz as new_authz
import ckan.logic as logic
import ckan.logic.schema as schema
import ckan.lib.captcha as captcha
impor... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import atexit
import collections
import contextlib
import ctypes
import logging
import os
import platform
import re
import socket
import struct
import subpro... | |
from collections import defaultdict
from traceback import format_exc
from struct import unpack
from errno import EINTR
import socket
from clusto.services.config import conf, get_logger
log = get_logger('clusto.dhcp', 'INFO')
import logging
runtime = logging.getLogger('scapy.runtime')
runtime.setLevel(logging.ERROR)
l... | |
import pyopencl as cl
import numpy as np
import scipy as sp
from scipy import misc
from scipy import ndimage
import random as r
import datetime as date
import time
from PIL import Image
import os
import tkFileDialog as tfd
from Tkinter import Tk
#Don't truncate printed arrays
np.set_printoptions(threshold=np.nan)
cl... | |
#!/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.
'''Unit tests for grit.format.policy_templates.writers.reg_writer'''
import os
import sys
if __name__ == '__main__':
sys.path.... | |
# Copyright (c) 2012 - 2015 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | |
"""
User settings/preference dialog
===============================
"""
import sys
import logging
from .. import config
from ..utils.settings import SettingChangedEvent
from ..utils.propertybindings import (
AbstractBoundProperty, PropertyBinding, BindingManager
)
from AnyQt.QtWidgets import (
QWidget, QMai... | |
#from django.shortcuts import render
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import get_object_or_404
from django.db.models import Q
import json
import requests
from collections import Counter
from random import randrange
fr... | |
import os
import logging
import datetime
import math
import re
from six.moves.urllib.request import urlopen
from six.moves.urllib.parse import urlencode
import aniso8601
from flask import Flask, json, render_template
from flask_ask import Ask, request, session, question, statement
ENDPOINT = "https://tidesandcurrent... | |
from . import bindings
from .utils.conversion import boolean_t
from .utils import six
NV_UNIQUE_NAME = bindings['NV_UNIQUE_NAME']
NV_UNIQUE_NAME_TYPE = bindings['NV_UNIQUE_NAME_TYPE']
data_type_t = bindings['data_type_t']
def data_type_t_safe(id):
try:
return data_type_t(id)
except ValueError:
... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | |
# Copyright 2010 OpenStack LLC.
# Copyright 2011 Piston Cloud Computing, Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | |
# 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.
from __future__ import unicode_literals
from collections import OrderedDict
from operator import itemgett... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | |
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class PrepaymentRecharge(object):
"""
NOTE: This class i... | |
from common_fixtures import * # NOQA
from cattle import ApiError
def _get_agent_for_container(container):
agent = None
for map in container.hosts()[0].instanceHostMaps():
c = map.instance()
if c.agentId is not None:
agent = c.agent()
assert agent is not None
return agent
... | |
import numpy as np
import matplotlib.pyplot as plt
import struct
import os, sys
import re
import copy
class Matrix:
"""
Class to Read and Hangle Matrix files
"""
def __init__(self,Path): # Give the Path of the folder containing all the mtrx files
# Read PATH and open file
self.Path = Pa... | |
import sys
import os
import glob
import tempfile
import shutil
import time
import urllib2
import netrc
import json
from urlparse import urlparse, urljoin
from subprocess import Popen, PIPE, check_call
from w3lib.form import encode_multipart
from scrapy.command import ScrapyCommand
from scrapy.exceptions import UsageE... | |
#
# Copyright 2014 China Mobile Limited
#
# Author: Gangyi Luo <[email protected]>
#
# 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... | |
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
"""
This file parses messages using functions defined in in the template's
parser.py
@copyright: 2012-15 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of t... | |
# VS SIMULATE
from shared_functions import *
from net_designs import *
import pandas as ps
import json
import numpy as np
import pickle
import networkx as nx
import scipy.stats as sct
from scipy import stats as sc
import random
import h5py
import os
from copy import deepcopy
from scipy import stats as sc
def... | |
# encoding: utf-8
import hashlib
import os
import stat
import json
import mimetypes
import urllib2
import logging
from math import ceil
import posixpath
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.http import HttpResponse, HttpRespons... | |
#!/usr/bin/env python
import sys
import os
import pysam
import gzip
from argparse import ArgumentParser
from collections import defaultdict
class iteratorWrapper:
def __init__(self, inIterator, finalValue):
self.it = inIterator
self.finalValue = finalValue
self.endIter = False
def __iter__(self):
return sel... | |
from __future__ import absolute_import, print_function, division
import operator
from petl.compat import next, string_types, callable, text_type
from petl.comparison import Comparable
from petl.errors import ArgumentError
from petl.util.base import asindices, expr, Table, values, Record
def select(table, *args, *... | |
#!/usr/bin/python
# dictionaries: process type wordlists
# Author: Daniel McDonald
# make regular expressions and lists of inflected words from word lists
try:
from corpkit.lazyprop import lazyprop
except:
import corpkit
from lazyprop import lazyprop
def _verbs():
import corpkit
from corpkit.... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
import sys, random, os
from dmd import Layer, Frame
import sdl2
from sdl2_displaymanager import sdl2_DisplayManager
import time
class Particle(object):
def __init__(self, x, y, emitter):
self.x = x
self.y = y
self.parent = emitter
self.life = random.randint(int(self.parent.max_lif... | |
#!/usr/bin/env python
# Copyright (c) 2015 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.
"""This script will check out llvm and clang, and then package the results up
to a tgz file."""
import argparse
import fnmatch
imp... | |
# Copyright 2022 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
__version__ = '0.2.0'
import pymysql
from flask import Flask, Response, request
from books_util import *
conf = get_configuration()
db = pymysql.connect(**conf)
# server configuration
app = Flask(__name__)
@app.route('/configuration')
def configuration():
rdata = json.dumps({
"version": __version__,
... | |
'''
A tool that generates a binary blob of packaged files and a json bag with info on each file's location in the blob
You can split your files into "asset bundles", and create each bundle separately
with this tool. Then just process the json for each and they will load
the data and prepare it accordingly. This allows... | |
# 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... | |
from __future__ import division, print_function, absolute_import
import pytest
from math import sqrt, exp, sin, cos
from functools import lru_cache
from numpy.testing import (assert_warns, assert_,
assert_allclose,
assert_equal,
assert_a... | |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
import os
import re
import sys
import urllib
from ConfigParser import ConfigParser
import pkg_resources
from paste.deploy.util.fixtypeerror import fix_... | |
# 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 (C) 2011 The Android Open Source 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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | |
#Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgetbase.py
__version__='3.3.0'
__doc__='''Base class for user-defined graphical widgets'''
from reportlab.graphics import shapes
from repo... | |
#!/usr/bin/env python
import sys
import os
import json
from pprint import pprint
import random
from uuid import getnode
try:
# see if we're running in a plex plug-in
HTTP
except:
import requests
HTTP = None
class Logger:
def Debug(self, *args):
print args
Log = Log... | |
"""Growatt Sensor definitions for the Mix type."""
from __future__ import annotations
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
from homeassistant.const import (
ELECTRIC_POTENTIAL_VOLT,
ENERGY_KILO_WATT_HOUR,
PERCENTAGE,
POWER_KILO_WATT,
POWER_WATT,
)
from .s... | |
"""Support for Wireless Sensor Tags."""
import logging
from requests.exceptions import HTTPError, ConnectTimeout
import voluptuous as vol
from homeassistant.const import (
ATTR_BATTERY_LEVEL, ATTR_VOLTAGE, CONF_USERNAME, CONF_PASSWORD)
import homeassistant.helpers.config_validation as cv
from homeassistant import ... | |
from glob import glob
from distutils.util import convert_path
import distutils.command.build_py as orig
import os
import fnmatch
import textwrap
import io
import distutils.errors
import itertools
from setuptools.extern.six.moves import map, filter, filterfalse
try:
from setuptools.lib2to3_ex import Mixin2to3
exce... | |
# -*- coding: utf-8 -*-
import base64
import datetime
import hashlib
import io
import itertools
import json
import os
import random
import shutil
import subprocess
import tarfile
import tempfile
from configparser import ConfigParser
from contextlib import contextmanager
import factory
import factory.fuzzy
import facto... | |
# Copyright 2012 Nebula, 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 agree... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | |
"""
Autopsy Forensic Browser
Copyright 2019-2020 Basis Technology Corp.
Contact: carrier <at> sleuthkit <dot> org
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... | |
from rest_framework import serializers as ser
from api.base.serializers import (
JSONAPISerializer,
RelationshipField,
RestrictedDictSerializer,
LinksField,
is_anonymized,
DateByVersion,
HideIfNotNodePointerLog,
HideIfNotRegistrationPointerLog,
)
from osf.models import OSFUser, Abstrac... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test desidatamodel.check functions
"""
import os
import sys
import unittest
from unittest.mock import patch
from pkg_resources import resource_filename
from .datamodeltestcase import DataModelTestCase, DM
from .. import DataMod... | |
import numpy as np
import random
import json
import math
neuron_decay=0.9
maxneuronsperunit=64
maxaxonsperunit=128
maxunits=10
binary_io=True
bitsize=8
runtime=20
testsize=20
class neuron:
id=-1
myunit=-1
active=False
can_mutate=True
threshold=999
amount=0
decay=neuron_decay
... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
import dataset
import logging
import re
from datetime import datetime
from copy import deepcopy
import os
log = logging.getLogger('usertrack')
if not os.path.exists('databases'):
os.makedirs('databases')
db = dataset.connec... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, 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 must retain the above... | |
"""
Manage RabbitMQ Users
=====================
Example:
.. code-block:: yaml
rabbit_user:
rabbitmq_user.present:
- password: password
- force: True
- tags:
- monitoring
- user
- perms:
- '/':
- '.*'
- '.*'
- ... | |
from __future__ import unicode_literals
from django.test import TestCase
import factory
from factory.django import DjangoModelFactory
from django.contrib.auth.models import User
from faker import Faker as fake_factory
from models import Photo, Album
from django.test import Client
fake = fake_factory()
class UserFact... | |
import warnings
import cx_Oracle
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.encoding import force_text
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps ty... | |
import time
import random
#game function
def game():
print ("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print ("Welcome to the cavern of secrets!")
print ("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
time.sleep(3)
print ("You enter a dark cavern out of curiosity. It is dark and you can only make out a sma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.