text stringlengths 475 200k |
|---|
"""
Preliminary module to handle fortran formats for IO. Does not use this outside
scipy.sparse io for now, until the API is deemed reasonable.
The *Format classes handle conversion between fortran and python format, and
FortranFormatParser can create *Format instances from raw fortran format
strings (e.g. '(3I4)', '(... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint, get_link_to_form
from frappe.model.document import Document
class Ass... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
#
# In the current iteration, there is a client object that can be loaded from
# the filesystem into the database and its settings loaded from the database.
# There are no... |
import chainerx
# TODO(sonots): Implement in C++
def square(x):
"""Returns the element-wise square of the input.
Args:
x (~chainerx.ndarray or scalar): Input data
Returns:
~chainerx.ndarray: Returned array: :math:`y = x * x`.
A scalar is returned if ``x`` is a scalar.
Note:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from migrate.exceptions import *
from migrate.versioning.version import *
from migrate.tests import fixture
class TestVerNum(fixture.Base):
def test_invalid(self):
"""Disallow invalid version numbers"""
versions = ('-1', -1, 'Thirteen', '')
f... |
#!/usr/bin/python
# Copyright (C) 2003-2011 Erik de Castro Lopo <[EMAIL]>
#
# 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 copyri... |
import IPython, graphviz, re
from io import StringIO
from IPython.display import Image
import numpy as np
import pandas as pd
import math
from sklearn import tree
from sklearn.datasets import load_boston, load_iris
from collections import defaultdict
import string
import re
YELLOW = "#fefecd" # "#fbfbd0" # "#FBFEB0"
B... |
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
from ctypes import wintypes
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Str... |
# -*- coding: utf-8 -*-
from django.utils.encoding import smart_str
class Menu(object):
namespace = None
def __init__(self):
if not self.namespace:
self.namespace = self.__class__.__name__
def get_nodes(self, request):
"""
should return a list of NavigationNode in... |
#
# crawler tab implementation
#
#
# Author: Gregory Fleischer ([EMAIL])
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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 ... |
#!/usr/bin/env python
import pygtk
import gtk
import dill
import pango
import os
import subprocess
import time
pygtk.require('2.0')
from os.path import expanduser
from lib.Project import Project
from pipeline_editor import PipelineEditor
from lib.Module import Module
from dialog import Dialog
from util.library import... |
# Copyright (c) 2015 Huawei, Tech. Co,. Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
# 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... |
# Parse Stripe payment info via exported payments.csv files
import sys
from datetime import tzinfo, timedelta, datetime
# TODO: use stripe_customers.csv to match payments to our db data
# Stripe file format
# id,Description,Created (UTC),Amount,Amount Refunded,Currency,Converted Amount,Converted Amount Refunded,Fee,... |
# -*- coding: utf-8 -*-
#
# 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
#... |
import bpy
import math
import sys
import os
import stat
import bmesh
import time
import random
from bpy_extras.object_utils import world_to_camera_view
##------------------------ SEARCH AND SELECT ------------------------
## SETEO VARIABLE DE ENTORNO
bpy.types.Scene.SearchAndSelectOt = bpy.props.StringProperty(defaul... |
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 1.4.41
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python 2 and python 3 compatibility library
from six i... |
"""CSS Selectors based on XPath.
This module supports selecting XML/HTML tags based on CSS selectors.
See the `CSSSelector` class for details.
This is a thin wrapper around cssselect 0.7 or later.
"""
from __future__ import absolute_import
from . import etree
try:
import cssselect as external_cssselect
except I... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2019-03-20 17:37
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... |
# -*- coding: utf-8 -*-
#
# This file is part of Export Layers.
#
# Copyright (C) 2013-2019 khalim19 <[EMAIL]>
#
# Export Layers 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 python2.7
import argparse
from modules.compute_ownership_graph import COMPUTE_OWNERSHIP
from modules.compute_symbology import TO_SYMBOLOGY
from modules.add_sic_descs import ADD_SIC_DESCRIPTION
from modules.enrich_terminal_nodes import ENRICH_TERMINAL_NODES
from generic.generic_meta_enrich import GENERI... |
#!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise
# 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',
'stat... |
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... |
##########################################################################
#
# Copyright (c) 2021, Cinesite VFX Ltd. 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 ... |
# -*- 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
... |
import datetime
import asyncio
import re
import sys
import subprocess
import json
import time
import os
from datetime import datetime
from discord.ext import commands
from cogs.utils.checks import cmd_prefix_len
'''Module for miscellaneous commands'''
class Imagedump:
def __init__(self, bot):
self.bot =... |
from numpy import log, pi as pi_num, exp
import sys
def best_path(probs, pi, T):
"""
Viterbi algorithm with backpointers
"""
n = len(T)
m = len(probs[0])
log_V = [[0. for _ in xrange(m)] for _ in xrange(n)]
backpt = [[0 for _ in xrange(m)] for _ in xrange(n)]
states = [0 fo... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
TextToFloat.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
*************************... |
# This file is part of BuhIRC.
#
# BuhIRC 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.
#
# BuhIRC is distributed in the hope that ... |
"""
webencodings.mklabels
~~~~~~~~~~~~~~~~~~~~~
Regenarate the webencodings.labels module.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
import json
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
def asser... |
from __future__ import print_function
a = '''cdef void glActiveTexture (cgl.GLenum texture)
cdef void glAttachShader (cgl.GLuint program, cgl.GLuint shader)
cdef void glBindAttribLocation (cgl.GLuint program, cgl.GLuint index, cgl.GLchar* name)
cdef void glBindBuffer (cgl.GLenum target, cgl.GLuint buffer)
cde... |
from django.contrib import admin
from django.contrib.contenttypes import generic
from django.db.models import Q
from models import Member, Membership, MemberAltname
from models import CoalitionMembership, Correlation, Party, \
Award, AwardType, Knesset
from links.models import Link
from video.models import Video
f... |
# -*- 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 'Developer'
db.create_table('frontend_developer', (
('id', self.gf('django.db.mod... |
import os
import inflector
from waflib.ConfigSet import ConfigSet
from waflib import Utils
__all__ = [
"check_pkg_config", "check_cc", "check_statement", "check_libs",
"check_headers", "compose_checks", "check_true", "any_version",
"load_fragment", "check_stub", "check_ctx_vars", "check_program"]
any_vers... |
"""
LTI user management functionality. This module reconciles the two identities
that an individual has in the campus LMS platform and on edX.
"""
import string
import random
import uuid
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
fr... |
# coding: utf-8
# Author: Vladimir M. Zaytsev <[EMAIL]>
import os
import leveldb
import logging
class DictLexicon(object):
TERM_FREQ_SEP = chr(255)
LEX_DIR_NAME = "dict.lexicon.ldb"
def __init__(self, root_dir):
self.term_dict = dict()
self.root_dir = root_dir
self.lexicon_root =... |
import math
import bitify.python.utils.i2cutils as I2CUtils
class HMC5883L(object):
'''
Simple HMC5883L implementation
'''
TWO_PI = 2 * math.pi
CONF_REG_A = 0
CONF_REG_B = 1
MODE_REG = 2
DATA_START_BLOCK = 3
DATA_XOUT_H = 0
DATA_XOUT_L = 1
DATA_ZOUT_H = 2
DATA_ZOUT_L =... |
#!/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.
'''A baseclass for simple gatherers based on regular expressions.
'''
import re
from grit.gather import skeleton_gatherer
class... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# 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 u... |
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test -alertnotify
#
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import Aut... |
#!/usr/bin/env python
#encoding: UTF-8
'''
网易云音乐 Menu
'''
import curses
import locale
import sys
import os
import json
import time
import webbrowser
from .api import NetEase
from .player import Player
from .ui import Ui
home = os.path.expanduser("~")
if os.path.isdir(home + '/netease-musicbox') is False:
os.mkd... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""An example functional test
The module-level docstring should include a high-level description of
what the t... |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/docs/userguide/ch2a_fonts.py
from tools.docco.rl_doc_utils import *
from reportlab.lib.codecharts import SingleByteEncodingChart
from reportlab.platypu... |
# -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... |
# 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.
#
# This program is distributed in the hope that it will be useful,... |
# -*- 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... |
"""Copyright 2009 Chris Davis
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
dist... |
#!/usr/bin/env python
from time import sleep
import yaml
from player import Player
from attack import Attack
def main():
# Load YAML config
config_path = "./attack.yml"
f = open(config_path, 'r')
attack_config = yaml.load(f)
f.close()
# Load attacks
attacks = {}
for name, properties... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... |
"""Tests for the data_helper.check module"""
import sys, unittest
from BaseTest import BaseTestWrapper
class IsBoolTestCase(BaseTestWrapper.BaseTest):
"""check.is_bool() test cases"""
def test_string(self):
"""Test if string is False"""
x = 'y'
self.assertFalse(self._bt['func'](x))
... |
import flags
import unittest
import re
import source
class FlagTestCase(unittest.TestCase):
def testParseParamDescription(self):
desc = '{!bbb|ccc?} aaa This \nis the desc. '
self.assertEquals(
('aaa', '!bbb|ccc?', 'This \nis the desc.'),
flags.ParseParameterDescription(desc))
desc = '{.... |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that app bundles are built correctly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(fo... |
from contextlib import contextmanager
import os
import sys
from unittest import expectedFailure
from django.test import TestCase
from django.test.runner import DiscoverRunner
def expectedFailureIf(condition):
"""Marks a test as an expected failure if ``condition`` is met."""
if condition:
return expe... |
from docutils.parsers.rst import Directive, directives
from docutils import nodes
from string import upper
from sphinx.util.compat import make_admonition
from sphinx import addnodes
from sphinx.locale import _
class bestpractice(nodes.Admonition, nodes.Element):
pass
class BestPractice(Directive):
has_content... |
#pylint: disable=missing-docstring, no-else-return, invalid-name, unused-variable, superfluous-parens
"""Testing inconsistent returns"""
import math
import sys
# These ones are consistent
def explicit_returns(var):
if var >= 0:
return math.sqrt(var)
else:
return None
def explicit_returns2(var)... |
import os
import sys
from PIL import Image
from django.conf import settings
from django.core.files.storage import default_storage as storage
from core.utils import resize_image
prefix_profile = 'uploads/profiles/'
prefix_container = 'uploads/container/'
prefix_upload_company = 'upload/logo_company'
def upload_loca... |
#
# 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 us... |
import fnmatch
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patt... |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.Crypter import Crypter
from module.network.HTTPRequest import BadHeader
class EmbeduploadCom(Crypter):
__name__ = "EmbeduploadCom"
__type__ = "crypter"
__version__ = "0.07"
__status__ = "testing"
__pattern__ = r'http://(?:www... |
# -*- 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... |
class ExtendedGcdEuclidean:
def __init__(self, modulo_num, another_num):
self.modulo_num = modulo_num
self.r_list = list([modulo_num, another_num])
self.q_list = list([None, None])
self.x_list = list([1, 0])
self.y_list = list([0, 1])
self.iter_list = list([-1, 0])
... |
# -*- coding: utf-8 -*-
__version__ = "0.0.0.0.1b Pre Alpha Alpha"
__author__ = "Tony Martin"
# Creating a host file for blocking ads
# Based on the idea of various adblocking sw running on TomatoUSB
# The goal is to simplify the adblocking sw by having a central point
# that merges and hosts the host file - this will... |
# encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class OktoberfestTVIE(InfoExtractor):
_VALID_URL = r'https?://www\.oktoberfest-tv\.de/[^/]+/[^/]+/video/(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.oktoberfest-tv.de/de/kameras/video/hb-zelt',
'info... |
#!/bin/python
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import numpy as np
import math
# State vector:
# 0-3: quaternions (q0, q1, q2, q3)
# 4-6: Velocity - m/sec (North, East, Down)
# 7-9: Position - m (North, East, Down)
# 10-12: Delta Angle bias - rad (X,Y,Z)
#... |
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the ... |
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# 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
# ... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# TestScriptInputOutput.py
#
# Check that <output> tags specified in a script are properly handled
#
# Copyright (c) 2015 Bertrand Coconnier
#
# 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; eit... |
"""
This morphological reconstruction routine was adapted from CellProfiler, code
licensed under both GPL and BSD licenses.
Website: http://www.cellprofiler.org
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2011 Broad Institute
All rights reserved.
Original author: Lee Kamentsky
"""... |
#!/usr/bin/env python
# This script is used to test the new method implementation
# It does that by comparing the computed prayer times for specific
# locations on specific dates to the "official" times on these dates.
# "official" turns out to be a tricky one for locations in places
# that are in non-Muslim countries... |
# This file is a minimal clang-format vim-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Add to your .vimrc:
#
# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr>
# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
#
# The first line enables clang-fo... |
#!/bin/env python
"""
Spacewalk external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
To use thi... |
# coding=utf-8
import socket
import json
import logging
import configuracao
logger = logging.getLogger()
class Contadores(object):
def __init__(self):
self.idiomas = {}
self.com_link = 0
self.sem_link = 0
# Porta que o Servidor esta
self.tcp = socket.socket(socket.AF_INET,... |
# Copyright 2013 Josh Durgin
# 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 a... |
# -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import parse_dict_header, ... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
unified_strdate,
xpath_text,
)
class CinchcastIE(InfoExtractor):
_VALID_URL = r'https?://player\.cinchcast\.com/.*?assetId=(?P<id>[0-9]+)'
_TEST = {
# Actual test is run in generic,... |
# Copyright 2019 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... |
""" Modified version of build_clib that handles fortran source files.
"""
from __future__ import division, absolute_import, print_function
import os
from glob import glob
import shutil
from distutils.command.build_clib import build_clib as old_build_clib
from distutils.errors import DistutilsSetupError, DistutilsError... |
#!/usr/bin/python
import unittest
import json
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__),
os.pardir,
os.pardir))
from nysa.cbuilder import sdb_component
SDB_DATA = \
" Set the Vendor ID (Hexidecimal 64-bit Number)\n" \... |
# 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... |
# encoding: utf-8
"""
Make reading the news more fun.
http://xkcd.com/1288/
"""
from __future__ import unicode_literals
import re
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
substitutes = {
"witnesses": "these dudes I know",
"Witnesses": "Th... |
#!/usr/bin/python
#
# Copyright (c) 2017 Obezimnaka Boms, <[EMAIL]>
# Copyright (c) 2017 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_ve... |
# 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 ... |
#!/usr/bin env python
from tests.unit import AWSMockServiceTestCase
from boto.cloudsearch2.domain import Domain
from boto.cloudsearch2.layer1 import CloudSearchConnection
class TestCloudSearchCreateDomain(AWSMockServiceTestCase):
connection_class = CloudSearchConnection
def default_body(self):
retu... |
import json
import sys
from ansible.module_utils.basic import env_fallback
from ansible.module_utils.urls import fetch_url
def scaleway_argument_spec():
return dict(
api_token=dict(required=True, fallback=(env_fallback, ['SCW_TOKEN', 'SCW_API_KEY', 'SCW_OAUTH_TOKEN', 'SCW_API_TOKEN']),
... |
#!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verify handling of build variants.
TODO: Right now, only the SCons generator supports this, so the
test case is SCons-specific. In pa... |
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... |
# -*- coding: UTF-8 -*-
# Copyright 2013-2018 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
from django.utils.translation import gettext_lazy as _
from lino.mixins import RegistrableState
from lino.api import dd
class PollStates(dd.Workflow):
item_class = Registrabl... |
# Generated by Django 2.2.5 on 2019-09-12 15:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import olympia.amo.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('bandwagon', '000... |
"""
WSGI config for logan project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... |
# -*- coding: ascii -*-
#
# Copyright 2007 - 2013
# Andr\xe9 Malo or his licensors, as applicable
#
# 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/LICENS... |
'''
$ python3 sum_of_digits.py
Input a number that we will use as available digits: 12234
Input a number that represents the desired sum: 5
There are 4 solutions.
$ python3 sum_of_digits.py
Input a number that we will use as available digits: 11111
Input a number that represents the desired sum: 5
There is a unique so... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.survey.tests.common import TestSurveyCommon
class TestCourseCertificationFailureFlow(TestSurveyCommon):
def test_course_certification_failure_flow(self):
# Step 1: create a simple certifica... |
__all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
TreeBuilder,
XML)
from b... |
__author__ = 'ZSGX'
import mysql.connector
from model.group import Group
from model.contact import Contact
import re
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection... |
#!/usr/bin/env python3
# Author: Darryl Wong
# Date: 10/15/2016
# Week 3 homework
list = ["apples", "pears", "oranges", "peaches"]
print (list)
# prompt the user for a fruit to add to our list
fruit = input ("Add a fruit: ")
list.append(fruit)
print (list)
# prompt the user for a fruit by index number
index = 0
... |
from unittest import TestCase
import simplejson as json
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.