src stringlengths 721 1.04M |
|---|
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
# -*- coding: utf-8 -*-
import scrapy
import crawler_type2.config as config
from crawler_type2.items import CrawlerType2Item
import urlparse
class TypeTwo(scrapy.Spider):
name = 'crawler_type2'
def start_requests(self):
source = getattr(self, 'source', None)
if source is None or source not in... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import wx
import widgetUtils
class attachDialog(widgetUtils.BaseDialog):
def __init__(self, voice_messages=False):
super(attachDialog, self).__init__(None, title=_("Add an attachment"))
panel = wx.Panel(self)
sizer = wx.BoxSizer(wx.VERTICAL)
lbl... |
"""
Copyright (c) 2018-2019 Alan Yorinks All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 as published by the Free Software Foundation; either
or (at your option) any later version.
This library is dist... |
# coding: utf-8
from __future__ import unicode_literals
import base64
import functools
import json
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_kwargs,
compat_HTTPError,
compat_str,
compat_urlparse,
)
from ..utils import (
clean_html,
determine_ext... |
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @Daddy_Blamo wrote this file. As long as you retain this notice you
# can do whatever you want wi... |
# 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 ... |
#!/usr/bin/python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it wi... |
#!/usr/bin/env python
'''
create ardupilot terrain database files
'''
from MAVProxy.modules.mavproxy_map import srtm
import math, struct, os, sys
import crc16, time, struct
# MAVLink sends 4x4 grids
TERRAIN_GRID_MAVLINK_SIZE = 4
# a 2k grid_block on disk contains 8x7 of the mavlink grids. Each
# grid block overlaps... |
from __future__ import print_function
import subprocess
import os
import sys
import shutil
import datetime
import distutils.dir_util
if sys.version_info < (3,):
input = raw_input
str = unicode
pwd = os.getcwd()
appver_file = r'.\AppVer'
target_shares = {
'release': [],
'test' : [],
'dev' : ... |
from builtins import object
import numpy as np
from cs231n.layers import *
from cs231n.fast_layers import *
from cs231n.layer_utils import *
class ThreeLayerConvNet(object):
"""
A three-layer convolutional network with the following architecture:
conv - relu - 2x2 max pool - affine - relu - affine - sof... |
# Copyright 2012 OpenStack LLC.
# 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... |
import argparse
class WrappedTextHelpFormatter(argparse.HelpFormatter):
"""Subclass that wraps description and epilog text taking paragraphs into account"""
def _fill_text(self, text, width, indent):
"""Wraps text like HelpFormatter, but doesn't squash lines
This makes it easier to do lists ... |
import tensorflow as tf
from .blocks import gather_nd
tf.app.flags.DEFINE_float('alpha', 1.0, '')
tf.app.flags.DEFINE_float('beta', 1.0, '')
FLAGS = tf.app.flags.FLAGS
def ce_loss(logits, labels, **kwargs):
"""
The standard classification loss. Applies softmax on the logits and computes the loss.
"""
cross_... |
# -*- coding: utf-8 -*-
#
# api_object_specification documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 20 09:52:22 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogene... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
# 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... |
#! /usr/bin/env python
import sys, shutil
from numpy import *
from os import path, makedirs
import subprocess
import re
from glob import glob
class color:
"""
define colors in the terminal
"""
purple = '\033[95m'
cyan = '\033[96m'
darkcyan = '\033[36m'
blue = '\033[94m'
green = '\033[9... |
#!/usr/bin/env python
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# ... |
#!/usr/bin/env python
# pylint: disable=missing-docstring
from setuptools import setup, find_packages
from template import __doc__ as description
extras_require = {
"dev": ["pipenv"],
"jmespath": ["jmespath"],
"netaddr": ["netaddr"],
"toml": ["toml"],
"yaml": ["PyYAML"],
}
# Flatten the list and a... |
# Copyright (c) 2003-2016 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Copyright (C) 2001 Michael Teo <michaelteo@bigfoot.com>
# smb.py - SMB/CIFS library
#
# This software... |
# Copyright (c) 2012 OpenStack Foundation.
# Administrator of the National Aeronautics and Space Administration.
# 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 a... |
# Copyright (C) 2005 Colin McMillen <mcmillen@cs.cmu.edu>
#
# This file is part of GalaxyMage.
#
# GalaxyMage 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 opti... |
__author__ = 'Konstantin Dmitriev'
from gettext import gettext as _
from argparse import ArgumentParser
from argparse import Action
from argparse import SUPPRESS
import os
import sys
from renderchan.core import RenderChan, __version__
class FormatsAction(Action):
def __init__(self,
option_string... |
import unittest
import gi.docstring
from gi.repository import GIMarshallingTests
from gi.repository import Gio
class Test(unittest.TestCase):
def test_api(self):
new_func = lambda info: 'docstring test'
old_func = gi.docstring.get_doc_string_generator()
gi.docstring.set_doc_string_genera... |
# -*- coding: utf-8; -*-
#
# @file staging.py
# @brief Staging specific settings.
# @author Frédéric SCHERMA (INRA UMR1095)
# @date 2016-09-01
# @copyright Copyright (c) 2016 INRA/CIRAD
# @license MIT (see LICENSE file)
# @details
import os
from .base import *
DEBUG = False
ADMINS = (
('admin_fscherma', 'frede... |
# Copyright 2016: Mirantis 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 b... |
from __future__ import absolute_import
from Components.config import ConfigSubsection, ConfigSubList, ConfigInteger, ConfigText, ConfigSelection
from . import TitleCutter
class ConfigFixedText(ConfigText):
def __init__(self, text, visible_width=60):
ConfigText.__init__(self, default = text, fixed_size = True, visib... |
# -*- coding: utf-8 -*-
# http://www.jonshouse.co.uk/rpidmx512.cgi
from twisted.internet import protocol, reactor, endpoints
from pigpio import pi, pulse as pig_pulse, OUTPUT
PORT = 50007
# pins
PIN_DI = 18 # Driver Input
PIN_DE = 23 # Driver output enable (high to enable)
PIN_RE = 24 # Receive output enable (... |
import logging
import math
import socket
import dask
from dask.sizeof import sizeof
from dask.utils import parse_bytes
from .. import protocol
from ..utils import get_ip, get_ipv6, nbytes, offload
logger = logging.getLogger(__name__)
# Offload (de)serializing large frames to improve event loop responsiveness.
# W... |
from django.contrib import messages
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.urlresolvers import reverse
from django.shortcuts import render, redirect, get_object_or_404
from django.utils.translation import ugettext_lazy as _
from helpers.models import Helpers
from offe... |
from django.conf import settings
from django.db import models
from django.utils.encoding import smart_str
from django.utils import timezone
from django.template.defaultfilters import slugify
from django.shortcuts import get_object_or_404
from election_registrar import models as registrar
import logging
import time
impo... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'adminArea.ui'
#
# Created: Mon Oct 20 09:26:27 2014
# by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attri... |
# -*- 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... |
# -*- coding: utf-8 -*-
# © <2016> <Moneygrid Project, Lucas Huber, Yannick Buron>
# based on account_wallet by Yannick Buron, Copyright Yannick Buron
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
'name': 'Exchange / Community Banking',
'version': '9.0.0.1.x',
'category': 'Exchange'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Symantec AV Log parser."""
from __future__ import unicode_literals
import unittest
from plaso.parsers import symantec
from tests.parsers import test_lib
class SymantecAccessProtectionUnitTest(test_lib.ParserTestCase):
"""Tests for the Symantec AV L... |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty
from kivy.uix.spinner import Spinner
from kivy.uix.listview import ListItemButton
from kivy.... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.survey.tests.common import SurveyCase
class TestCourseCertificationFailureFlow(SurveyCase):
def test_course_certification_failure_flow(self):
# Step 1: create a simple certification
... |
#!/usr/bin/env python3
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
# distributed with this work for additional information regarding copyright
# ownership. You may not use this file except in compliance with the Licen... |
# $Id$
#
# Copyright (C) 2014 Seiji Matsuoka
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from rdkit.Chem.Draw.canvasbase import CanvasBase
f... |
import logging
from hcsvlab_robochef.cooee.ingest import *
from hcsvlab_robochef.ace.ingest import *
from hcsvlab_robochef.ice.ingest import *
from hcsvlab_robochef.monash.ingest import *
from hcsvlab_robochef.griffith.ingest import *
from hcsvlab_robochef.md.ingest import *
from hcsvlab_robochef.auslit.ingest import ... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... |
import unittest
import sys
sys.path.append('./')
solutions = __import__('solutions.088_merge_sorted_array', fromlist='*')
class Test088(unittest.TestCase):
def test_merge(self):
s = solutions.Solution()
nums1 = []
nums2 = []
self.assertEqual(s.merge(nums1, len(nums1), nums2, len(... |
# -*- coding: UTF-8 -*-
from django.http import HttpResponseRedirect, HttpResponse
from datetime import datetime
from django.core.urlresolvers import reverse
from meregistro.shortcuts import my_render
from apps.seguridad.decorators import login_required, credential_required
from apps.seguridad.models import Usuario, P... |
# encoding=utf8
import random
import sys
import numpy as np
from mathpy.numtheory import isrelativelyprime
def lcg(n, seed=None):
r"""
Implementation of a linear congruential generator for generating n random samples in U(0, 1).
Parameters
----------
n : int
The number of ... |
import getpass
import os
from contextlib import contextmanager
from datetime import datetime, timedelta
from stem import Signal
from stem.connection import connect
from rasp.base import DefaultEngine
from rasp.errors import ControllerError
class TorController(object):
"""
Attributes:
address (str): I... |
# -------------------------------------------------------------------
#
# Copyright (C) 2020, Andrew W. Steiner and Sarah Wellence
#
# This file is part of bamr.
#
# bamr 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... |
# TASK
# This should be a user plug-in
from __future__ import print_function
import os
class Task:
def __init__(self, logger, output, script, parallelism, number, params):
self.logger = logger
self.process = None
self.fd = None
self.output = output
self.script = script
... |
import unittest
import numpy as np
from spglib import get_symmetry
class TestGetSymmetry(unittest.TestCase):
def setUp(self):
lattice = [[4, 0, 0], [0, 4, 0], [0, 0, 4]]
positions = [[0, 0, 0], [0.5, 0.5, 0.5]]
numbers = [1, 1]
magmoms = [0, 0]
self._cell = (lattice, posit... |
# Copyright 2014 Red Hat, 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 agr... |
# Copyright 2015 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 a... |
""" Funciones: convierte_distancia.py
Por about.me/carlosgbr
Versión 1
Para Python 3.0 y superior
Entrada:
Salida:
Se ilustra el uso de funciones en Python
"""
"""
ENUNCIADO: Esta función convierte millas a kilómetros (km).
Complete la función para devolver el resultado de la conversión.
Llame a la funció... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Red Hat, 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 la... |
##
# @author Brandon Michael
# This program simulates a simplified game of Yahtzee where a player
# plays against the computer.
# Allow your program to use the randint function
import random
# Create and initialize pre-loop "constants"
TWO_OF_KIND_POINTS = 25
YAHTZEE_POINTS = 50
# Create any other pre-loop variables... |
from collections import OrderedDict
from pathlib import Path
import pytest
from Pegasus.yaml import dumps, loads
@pytest.mark.parametrize(
"s, expected",
[
("key: 1", 1),
("key: 2018-10-10", "2018-10-10"),
("key: yes", "yes"),
("key: true", True),
],
)
def test_loads(s, e... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'send_chanmsg_dialog.ui'
#
# Created: Wed May 11 01:26:04 2016
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtC... |
import os
import cPickle as pickle
from paddle.v2.framework.framework import Program, Parameter, g_program, \
Variable
__all__ = [
'save_vars', 'save_params', 'save_persistables', 'load_vars', 'load_params',
'load_persistables', "save_inference_model", "load_inference_model"
]
def is_parameter(var):
... |
import os
import sys
import click
import gitlint
from gitlint.lint import GitLinter
from gitlint.config import LintConfig, LintConfigError, LintConfigGenerator
from gitlint.git import GitContext, GitContextError
from gitlint import hooks
DEFAULT_CONFIG_FILE = ".gitlint"
# Error codes
MAX_VIOLATION_ERROR_CODE = 252
... |
"""
Django settings for project_unchained project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DI... |
from django.contrib import admin
from models import WikiPage, Revision, Comparison
def latest_revision_display(obj):
latest_revision = obj.latest_revision()
if latest_revision is None:
return '0'
return u'%s' % latest_revision.number
latest_revision_display.short_description = 'Version'
def who_... |
#!/usr/bin/env python
import BeautifulSoup as BS
import urllib2, re, os, sys, difflib
def get_full_name(abrv_name):
full_name = None
for line in open('tRNA_species.csv'):
if line.split(',')[0].strip() == abrv_name:
full_name = line.split(',')[1][:-1]
break
return... |
"""This module handles the game flow."""
from game import enter_building_handler
from game import feeder
from game import feeding_handler
from game import take_resource_action
from game import resource
from game import resource_picker
from game.buildings import building_factory
class GameState(object):
PENDING_ADD_... |
#
# Copyright (C) 2004-2008 Greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from __future__ import print_f... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... |
# This file is part of Epoptes, http://epoptes.org
# Copyright 2010-2018 the Epoptes team, see AUTHORS.
# SPDX-License-Identifier: GPL-3.0-or-later
"""
Send message dialog.
"""
from epoptes.common import config
from epoptes.ui.common import locate_resource
from gi.repository import Gtk
class SendMessage:
"""Load ... |
import re
classes_reg = re.compile(r'(.+?)(<?->)(.+)')
variable_reg = re.compile(r'(.+?)(,.+?)?(<?->)([^,]+)(,.+)?')
class_reg = re.compile(r'(class|struct)([^:{]+?)(:[^{]+?){([^}]+?)}', re.DOTALL)
class_var_reg = re.compile(r'(let|var)([^:=]+?)(:[^=]+)(=.+?)?')
class Direction:
ONE_WAY = 0
TWO_WAY = 1
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import, unicode_literals
import os
import os.path
import sys
import logging
import traceback
from simiki.compat import is_py2, unicode
try:
import SimpleHTTPServer as http_server
except ImportError:
# py3
import ... |
import os
import pytest
from .ansible import AnsiblePlaybook
from .common import PopenTask, TimeoutException, TaskException
from .vagrant import VagrantBoxDownload
def test_timeout():
PopenTask(['sleep', '0.1'])()
PopenTask(['sleep', '0.1'], timeout=None)()
PopenTask(['sleep', '0.1'], timeout=0.2)()
... |
# The functions in this file are to help produce human readable diffs
# between our JSON representation of candidates.
import re
from django.conf import settings
from django.utils.translation import ugettext as _
import jsonpatch
import jsonpointer
def get_descriptive_value(election, attribute, value, leaf):
... |
import unittest
import subprocess
import sys
ex2 = __import__('02')
class TestEx1(unittest.TestCase):
def test_props(self):
command = [sys.executable, '01.py', 'props', 'name']
p = subprocess.Popen(command,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
she... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2012 KMEE (http://www.kmee.com.br)
# @author Luis Felipe Miléo <mileo@kmee.com.br>
#
# This prog
# ram is free software: you can redistribut... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 1 12:55:06 2014
@author: ying
"""
import mne
import numpy as np
#import matplotlib.pyplot as plt
from mne.minimum_norm.inverse import (apply_inverse, _check_method, _check_ori,
prepare_inverse_operator, _pick_channels_inverse_operator, _check_ch_names,
... |
#!/usr/bin/env python
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://www.newznab.com/
#
# This file is part of Newznab
#
# Newznab 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 L... |
# -*- coding: utf-8 -*-
#
# Advanced Emulator Launcher
#
# Copyright (c) 2016-2017 Wintermute0110 <wintermute0110@gmail.com>
#
# 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; version 2 of the L... |
###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mo... |
# Copyright 2012 Red Hat, Inc.
# Copyright 2013 IBM Corp.
# 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.... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
# 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... |
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
# Copyright (c) 2012-2013 Benjamin Bruheim <grolgh@gmail.com>
# This file is covered by the LGPLv3 or later, read COPYING for details.
import datetime
import os
import uuid
import pytz
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
fro... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#此为最终结果 已经可以查找到有关键字的文件
'''
grep -rl 'python' /root
'''
import os
def init(func):
def wrapper(*args,**kwargs):
res = func(*args,**kwargs)
next(res)
return res
return wrapper
@init #生成器调用装饰器
def search(target):
'''取出所有文件路径'''
#更改为生成器... |
# pylint: disable=missing-docstring
import shutil
import unittest
from datetime import timedelta
from django.utils.timezone import now
from guardian.shortcuts import remove_perm
from rest_framework import exceptions, status
from resolwe.flow.models import Collection, Data
from resolwe.flow.serializers import Contrib... |
# -*- coding: utf-8 -*-
"""2D DeepOBS dataset."""
import numpy as np
import tensorflow as tf
from . import dataset
class two_d(dataset.DataSet):
"""DeepOBS data set class to create two dimensional stochastic testproblems.
This toy data set consists of a fixed number (``train_size``) of iid draws
from tw... |
# 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... |
# coding=utf-8
"""
Attempt at implementing k-fold cross validation for model parameter tuning.
"""
__author__ = 'paul.tunison@kitware.com'
import logging
import numpy
from masir import FeatureMemory
from masir.search.EventContentDescriptor import iqr_modules
from masir.search.EventContentDescriptor.cross_validation... |
#!/usr/bin/env python3
import json,requests,math
#ポストデータからUserIdを取得
def userId_Get(userId):
tmp = userId.split(';')
for tmp1 in tmp:
if 'userId' in tmp1:
return tmp1.split('=')[1]
return None
#ログインしてUserIdを取得
def Get_userId(SegaId,password):
url = 'https://chunithm-net... |
#!/usr/bin/env python
#
# This is a tool that works like debug location coverage calculator.
# It parses the llvm-dwarfdump --statistics output by reporting it
# in a more human readable way.
#
from __future__ import print_function
import argparse
import os
import sys
from json import loads
from math import ceil
from ... |
from glob import glob
from ..reprap_kind import ReprapKind
class ReprapACM(ReprapKind):
"""Repraps which are controlled by an ACM device of some kind
(usually an Arduino)."""
def __init__(self, connection, firmware="Unknown", *args, **kargs):
self.__serial = connection
self.__buffer =... |
"""
sphinxcontrib.httpdomain
~~~~~~~~~~~~~~~~~~~~~~~~
The HTTP domain for documenting RESTful HTTP APIs.
:copyright: Copyright 2011 by Hong Minhee
:license: BSD, see LICENSE for details.
"""
import re
from docutils import nodes
from docutils.parsers.rst.roles import set_classes
from pygments.l... |
# This file is part of Bika LIMS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
from AccessControl import getSecurityManager
from bika.lims.browser import BrowserView
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.browser.bika_... |
# Matroska tagger for Exaile
# Copyright (C) 2010 Johannes Sasongko <sasongko@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later vers... |
from graph import Graph
from distance import calculate_distance
import sys
import os
from io import open
import json
def import_cities():
'''
Import the city flight connection path JSON file,
Returns dictionary of cities
'''
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
filenam... |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017 Tijme Gommers
#
# 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... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 Foun... |
"""Default tags used by the template system, available to all templates."""
from __future__ import unicode_literals
import os
import sys
import re
from datetime import datetime
from itertools import groupby, cycle as itertools_cycle
import warnings
from django.conf import settings
from django.template.base import (No... |
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from direct.interval.IntervalGlobal import *
from otp.speedchat import SpeedChatGlobals
from toontown.toonbase import TTLocalizer
class DistributedGreenToonEffectMgr(DistributedObject.DistributedObject):
notify = Di... |
#!/usr/bin/python
__module_name__ = "Cancel's DictBot"
__module_version__ = "3.0.1"
__module_description__ = "DictBot by Cancel"
import xchat
import os
import re
import string
import ConfigParser
from DictService_client import *
print "\0034",__module_name__, __module_version__,"has been loaded\003"
#the globals go... |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2013 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.