src stringlengths 721 1.04M |
|---|
"""Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... |
# -*- coding: utf-8 -*-
#
import matplotlib as mpl
import numpy
def mpl_color2xcolor(data, matplotlib_color):
'''Translates a matplotlib color specification into a proper LaTeX xcolor.
'''
# Convert it to RGBA.
my_col = numpy.array(mpl.colors.ColorConverter().to_rgba(matplotlib_color))
# If the a... |
# coding=utf-8
# Author: Joao Santos <jmigueltsantos@riseup.net>
#
# This file is part of SickChill.
#
# SickChill 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 you... |
#!/usr/bin/env python
#
# Python-bindings support functions test script
#
# Copyright (C) 2011-2021, Joachim Metz <joachim.metz@gmail.com>
#
# Refer to AUTHORS for acknowledgements.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as ... |
import time
import datetime
#
from vt_manager.communication.sfa.util.faults import MissingSfaInfo, UnknownSfaType, \
RecordNotFound, SfaNotImplemented, SliverDoesNotExist
from vt_manager.communication.sfa.util.defaultdict import defaultdict
from vt_manager.communication.sfa.util.sfatime import utcparse, datetime_... |
# -*- coding: utf-8 -*-
import re
from module.network.RequestFactory import getURL
from module.plugins.Hoster import Hoster
from module.plugins.Plugin import chunks
def getInfo(urls):
result = []
for chunk in chunks(urls, 10):
for url in chunk:
html = getURL(url)
if r'<div cl... |
from zope.interface import implementer
from pyramid.interfaces import ISessionFactory, ISession
from eduid_common.session.pyramid_session import SessionFactory as CommonSessionFactory
from eduid_common.session.pyramid_session import Session as CommonSession
import logging
logger = logging.getLogger(__name__)
_EDIT_U... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Shinichi Nakagawa'
from configparser import ConfigParser
from boto3.session import Session
import glob
import os
class Storage(object):
def __init__(self, config_file):
"""
init
:param config_file: Application config file
... |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... |
# Original code taken from mcuboot project at:
# https://github.com/mcu-tools/mcuboot
# Git SHA of the original version: a8e12dae381080e898cea0c6f7408009b0163f9f
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... |
import argparse, sys
from svtools.bedpe import Bedpe
from svtools.vcf.file import Vcf
from svtools.bedpetovcfconverter import BedpeToVcfConverter
import svtools.utils as su
# primary function
def bedpeToVcf(bedpe_file, vcf_out):
myvcf = Vcf()
converter = BedpeToVcfConverter(myvcf)
in_header = True
# p... |
#!/usr/bin/env python
"""
@package ion.agents.data.test.test_moas_ctdgv
@file ion/agents/data/test_moas_ctdgv
@author Bill French
@brief End to end testing for moas ctdgv
"""
__author__ = 'Bill French'
import gevent
import os
from pyon.public import log
from nose.plugins.attrib import attr
from ion.agents.data.tes... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2018 The gPodder Team
#
# gPodder 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 versi... |
#!/usr/bin/env python
"""
Filter GBK file by CDS: retain only those records which have correct CDS.
Correct CDS must:
1) contain a 'product' field;
2) have length that is a multiple of 3;
3) have start and stop codons.
Usage:
filter_gbk_by_cds.py -i <input_GBK_file> -o <output_GBK_file>
Options:
-h --help ... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... |
# 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
# distrib... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
baseRequestHandler.py
~~~~~~~~~~~~~~~~~~~~~
Base request handler
"""
import gevent
from gevent import monkey
monkey.patch_all()
import requests
import logging
import os
import socket
import time
import json
from requests import ConnectionError
from random... |
# -*- 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... |
import os
import pygame
from pygame.locals import *
from pgu import engine
import data
from cnst import *
import levels
class Menu(engine.State):
def __init__(self,game):
self.game = game
def init(self):
self.font = self.game.font
self.bkgr = pygame.image.load(data.filepat... |
# pylint: disable=invalid-name
import centre_registry.models
from django.db import migrations
from django.db import models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name='Centre',
fields=[
... |
#!/usr/bin/env python3
"""
#############################
Server application || TCP, socket
version python: python3
#############################
"""
import select
import signal
import socket
import sys
import uuid
import datetime
from communication import send, receive
from messages import Mess... |
import sys
if len(sys.argv) >= 3:
#try:
print sys.argv
args = sys.argv
mode_arg = args[args.index("-mode")+1]
print mode_arg
#############Build Reference File Mode###############
if mode_arg.lower() == "build_ref_files":
import BuildRef
print "Building Reference Files"
... |
# Copyright (C) 2015 - 2019 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
#
# This library is distributed in t... |
'''@file textreader.py
contains the Textreader class'''
import os
import numpy as np
class TextReader(object):
'''reads text from disk'''
def __init__(self, textfile, max_length, coder, base_pos=0,
end_pos=None):
'''TextReader constructor
Args:
textfile: the path... |
from common import *
from elements import *
from bcddevice import BCDDevice
class BCDElement:
obj = None
_type = None
_changed = False
_identifier = None
_enum = None
_value = None
fmt = None
def __init__(self, obj, type):
self.obj = obj
self._type = type
... |
#!/usr/bin/python
"""
::
This experiment is used to study Half wave rectifiers
"""
from __future__ import print_function
from SEEL_Apps.utilitiesClass import utilitiesClass
from SEEL_Apps.templates import ui_template_graph_nofft as template_graph_nofft
import numpy as np
from PyQt4 import QtGui,QtCore
impor... |
# -*- coding: utf-8 -*-
import re
import random
import json
import os
import sys
import datetime
import time
import threading
import logging
import urllib
from HttpClient import HttpClient
reload(sys)
sys.setdefaultencoding("utf-8")
HttpClient_Ist = HttpClient()
ClientID = int(random.uniform(111111, 888888))
PTWebQ... |
#!/opt/local/bin/python2.7
import sys
import socket
import getopt
import threading
import subprocess
# define some global variables
listen = False
command = False
upload = False
execute = ""
target = ""
upload_destination = ""
port = 0
# this r... |
from __future__ import print_function
import espressomd
from espressomd import checkpointing
checkpoint = checkpointing.Checkpointing(checkpoint_id="mycheckpoint")
checkpoint.load()
# necessary for using e.g. system.actors, since explicit checkpointing of actors is not implemented yet
system = espressomd.System(box_l... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from udata.api import api, fields, base_reference
from udata.core.badges.api import badge_fields
from .models import ORG_ROLES, DEFAULT_ROLE, MEMBERSHIP_STATUS, LOGO_SIZES
BIGGEST_LOGO_SIZE = LOGO_SIZES[0]
org_ref_fields = api.inherit('OrganizationRef... |
from sympy.core import sympify, Lambda, Dummy, Integer, Rational, oo, Float, pi
from sympy.functions import sqrt, exp, erf
from sympy.printing import sstr
import random
class Sample(tuple):
"""
Sample([x1, x2, x3, ...]) represents a collection of samples.
Sample parameters like mean, variance and stddev c... |
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>"""
import os
import select
import signal
import datetime
import collections
import borg
log = borg.get_logger(__name__)
class SessionTimeAccountant(object):
"""
Track the total CPU (user) time for members of a session.
Process accounting under Linux is ... |
# coding=utf-8
# This file is part of SickRage.
#
# URL: https://sick-rage.github.io
# Git: https://github.com/Sick-Rage/Sick-Rage.git
#
# SickRage 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 versio... |
#!/usr/bin/python3
import selenium.webdriver.support.ui as ui
from time import sleep
from selenium import webdriver
import sqlite3
from datetime import datetime
from pyvirtualdisplay import Display
from pathlib import Path
db = sqlite3.connect('/root/itchy-broccoli/db/moviedb.db')
cinemas = db.cursor()
#cursor.execut... |
from hops import constants
class JDBCStorageConnector():
"""
Represents a JDBC storage connector in the feature store
"""
def __init__(self, jdbc_storage_connector_json):
"""
Initialize the jdbc connector from JSON payload
Args:
:jdbc_storage_connector_json: JSON r... |
#!/usr/bin/python
print " __ "
print " |__|____ ___ __ "
print " | \__ \\\\ \/ / "
print " | |/ __ \\\\ / "
print " /\__| (____ /\_/ "
print " \______| \/ "
p... |
# coding=utf-8
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
# In jurisdi... |
# -*- coding: utf-8 -*-
import gi
gi.require_version('Peas', '1.0')
gi.require_version('Gtk', '3.0')
gi.require_version('Totem', '1.0')
from gi.repository import GLib, GObject # pylint: disable-msg=E0611
from gi.repository import Peas, Gtk, Gdk # pylint: disable-msg=E0611
from gi.repository import Gio, Pango, Totem # ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-11-01 13:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('daiquiri_query', '0003_query_language_and_actual_query'),
]
operations = [
mig... |
import pymel.core as pm
class ExportObjSequence:
def __init__(self):
self.objects = []
self.start_frame = None
self.end_frame = None
def export(self):
if not pm.ls(sl=True):
pm.warning("No objects selected")
return
path = pm.fileDia... |
# Copyright (c) 2012 Ian C. Good
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... |
#!/usr/bin/env python
#
# stm32_mem.py: STM32 memory access using USB DFU class
# Copyright (C) 2011 Black Sphere Technologies
# Written by Gareth McMullin <gareth@blacksphere.co.nz>
# Modified by Felix Ruess <felix.ruess@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
from sourcer import *
__all__ = [
'Collection',
'CommandHandler',
'Contract',
'Data',
'Definition',
'Dollar',
'For',
'Func',
'If',
'Import',
'Introduction',
'KeyValuePair',
'ModifiedStatement',
'Name',
'NamedElement',
'Namespace',
'Operation',
'P... |
from flask import Blueprint, render_template, request, url_for, redirect, flash
from flask_login import login_required, current_user
from flask_babel import gettext
from werkzeug.exceptions import NotFound
import critiquebrainz.frontend.apis.spotify as spotify_api
from critiquebrainz.frontend.apis import musicbrainz, m... |
import unittest
import numpy
import pytest
import cupy
from cupy.cuda import runtime
from cupy._indexing import generate
from cupy import testing
@testing.gpu
class TestIndices(unittest.TestCase):
@testing.for_all_dtypes()
@testing.numpy_cupy_array_equal()
def test_indices_list0(self, xp, dtype):
... |
#!/bin/env python
import struct
import zlib
from wrpg.wfont.common import (header_structure, character_entry_strucutre, PFONT_VERSION)
def pack_fontdata(archive):
default_char = struct.pack(character_entry_strucutre(), 0, 0, 0, 0, 0, 0)
char_array = [default_char] * 256
for char in archive['chars']:
... |
from record import Record
from recorder import Recorder
from timeutils import isotime
import time
import interact
import os
class Noter(Recorder):
def __init__(self, db_path, book_name):
Recorder.__init__(self, db_path)
self.book_name = book_name
def make_makers(self):
makers = []
... |
from __future__ import absolute_import, print_function
__all__ = ("Attribute", "Event", "Map")
import six
from uuid import uuid1
from base64 import b64encode
from collections import Mapping
from django.utils import timezone
from sentry.utils.dates import to_timestamp
class Attribute(object):
def __init__(self... |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from decimal import Decimal
from shuup.core.models... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 Alex Forencich
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... |
# 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... |
#!/usr/bin/python
import struct
import argparse
import sys
import os.path
def process_mtl(filename):
materials = []
file = open(filename)
for line in file:
tokens = line.split()
if(len(tokens) == 0):
continue
ident = tokens.pop(0)
if(ident == 'newmtl'):
m = {}
m['name'] = tokens[0]
m['color'] =... |
from lz4ex import lz4, lz4hc
import unittest
class TestLZ4(unittest.TestCase):
def test_compress_default(self):
input_data = b"2099023098234882923049823094823094898239230982349081231290381209380981203981209381238901283098908123109238098123"
input_data_size = len(input_data)
compressed = lz... |
# Documentation:
# qute://help/configuring.html
# qute://help/settings.html
# Don't load autoconfig.yml (this is required as of v2.0.0)
config.load_autoconfig(False)
# Name of the session to load by default
c.session.default_name = "default"
# Automatically save the current session
c.auto_save.session = True
# ... |
#pylint: disable=invalid-name
"""
Classes for each reduction step. Those are kept separately
from the the interface class so that the DgsReduction class could
be used independently of the interface implementation
"""
from __future__ import (absolute_import, division, print_function)
import os
import xml.dom... |
from mock import Mock, patch, call
from nose.tools import raises
from lxc4u.overlayutils import *
class TestCreatingOverlayGroup(object):
def setup(self):
self.lxc_service_patch = patch('lxc4u.lxc.LXCService')
self.mkdir_patch = patch('os.mkdir')
self.mount_patch = patch('overlay4u.mount')... |
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015-2017 Ceridwen <ceridwenv@gmail.com>
# Copyright (c) 2015 Florian Bruhin <me@the-compiler.org>
# Copyright (c) 2015 Radosław Ga... |
#!/usr/bin/env python3
import unittest
import torch
import gpytorch
from gpytorch.test.variational_test_case import VariationalTestCase
def likelihood_cls():
return gpytorch.likelihoods.MultitaskGaussianLikelihood(num_tasks=2)
def strategy_cls(model, inducing_points, variational_distribution, learn_inducing_... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import ast
import keyword
import re
from functools import wraps
import six
from pants.c... |
import re
from django.contrib.auth.models import User
from django.template import Context, Template
from dolphin.middleware import LocalStoreMiddleware
from dolphin.tests.flipper import BaseTest
class ActiveTagTest(BaseTest):
fixtures = ['dolphin_base_flags.json']
def check_res(self, text, expected):
... |
#!/usr/bin/env python3
# WidgetGen.py - regenerate the ScintillaWidgetCpp.cpp and ScintillaWidgetCpp.h files
# Check that API includes all gtkscintilla2 functions
import sys
import os
import getopt
scintillaDirectory = "../.."
scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
sys.path.... |
# -*- 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, ... |
# -*- coding: utf-8 -*-
'''
Compendium of generic DNS utilities
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils
import socket
# Import python libs
import logging
import time
log = logging.getLogger(__name__)
def __virtual__():
'''
Generic, should work on any platform (includ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from time import time
from plugins.plugin import Plugin
from bytebot_config import BYTEBOT_PLUGIN_CONFIG
import requests
class weather(Plugin):
"""
The weather function read the current temperature of the city Erfurt.
It is necessary to register to get an A... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 VMware, 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
... |
#!/usr/bin/env python3
# Copyright 2013 Daniel Narvaez
#
# 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... |
import curses, datetime, locale
from decimal import Decimal
_ = lambda x:x
#from i18n import _
from electrum_dvc.util import format_satoshis, set_verbosity
from electrum_dvc.bitcoin import is_valid
from electrum_dvc import Wallet, WalletStorage
import tty, sys
class ElectrumGui:
def __init__(self, config, netw... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import telemetry.timeline.event as timeline_event
class Slice(timeline_event.TimelineEvent):
"""A Slice represents an interval of time plus parameters as... |
#!/usr/bin/python2
#
# 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 or ... |
## @file
# process OptionROM generation from INF statement
#
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of ... |
#
# 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
# ... |
__author__ = "Andre Merzky, Ole Weidner, Mark Santcroos"
__copyright__ = "Copyright 2012-2015, The SAGA Project"
__license__ = "MIT"
""" PBSPro job adaptor implementation
"""
import threading
import saga.url as surl
import saga.utils.pty_shell as sups
import saga.adaptors.base
import saga.adaptors.... |
# -*- coding: utf-8 -*-
"""
Tests for the django management command `email_drip_for_missing_dsc_records`.
"""
import random
from datetime import timedelta
import mock
from pytest import mark
from testfixtures import LogCapture
from django.core.management import call_command
from django.test import TestCase
from djang... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# 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
#... |
# -*- coding: utf-8 -*-
# pyfootballmngr
# Copyright (C) <2015> Markus Hackspacher
# This file is part of pyfootballmngr.
# pyfootballmngr 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 o... |
"""
Pynamodb constants
"""
# Operations
BATCH_WRITE_ITEM = 'BatchWriteItem'
DESCRIBE_TABLE = 'DescribeTable'
BATCH_GET_ITEM = 'BatchGetItem'
CREATE_TABLE = 'CreateTable'
UPDATE_TABLE = 'UpdateTable'
DELETE_TABLE = 'DeleteTable'
LIST_TABLES = 'ListTables'
UPDATE_ITEM = 'UpdateItem'
DELETE_ITEM = 'DeleteItem'
GET_ITEM =... |
# Copyright 2016 Google LLC
# Modifications: 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 ... |
# -*- 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... |
import random
import unittest
import numpy as np
def random_point():
# tzwhere does not work for points with more latitude!
return random.uniform(-180, 180), random.uniform(-84, 84)
def list_of_random_points(length):
return [random_point() for i in range(length)]
class HelperTest(unittest.TestCase):
... |
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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... |
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
# -*- 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... |
"""Tests for `texclean.rc.cleaned_extensions`."""
# Copyright (c) 2013 Andrew Dawson
#
# 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 ri... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from setuptools import setup, find_packages
import codecs
import os
import re
import sys
def read(*parts):
path = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(path, ... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import datetime
import glob
import shutil
import os
# try:
# from urllib.parse import urlparse
# except ImportError:
# from urlparse import urlparse
import logging
log = logging.getLogger(__name__)
def copy_output_file_to_dataset(... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import six
import unittest
from datetime import datetime, timedelta, date, time
from functools import wraps
from dateutil.relativedelta import relativedelta
from mock import Mock, patch
from nose_parameterized import parameterized, param
from dateparser... |
import hierlist, string, regutil, os
import win32con, win32ui, win32api
import commctrl
from pywin.mfc import dialog
import glob
import pyclbr
import pywin.framework.scriptutils
import afxres
class HLIErrorItem(hierlist.HierListItem):
def __init__(self, text):
self.text = text
hierlist.HierListItem.__... |
import sublime
import sublime_plugin
import webbrowser
import threading
class UrlHighlighter(sublime_plugin.EventListener):
# Thanks Jeff Atwood http://www.codinghorror.com/blog/2008/10/the-problem-with-urls.html
# ^ that up here is a URL that should be matched
URL_REGEX = "\\bhttps?://[-A-Za-z0-9+&@#/%?=... |
#!/usr/bin/env python
## \file parse_config.py
# \brief Builds a worksheet of all SU2.cpp options
# \author A. Aranake, F. Palacios
# \version 5.0.0 "Raven"
#
# SU2 Original Developers: Dr. Francisco D. Palacios.
# Dr. Thomas D. Economon.
#
# SU2 Developers: Prof. Juan J. Alonso's group at... |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 optio... |
# -*-coding:utf-8 -*-
import os
import logging.config
import logging.handlers
import sys
BASE_DIR = os.environ['BERRYNET_ROOT']
TEXT_DIR = os.path.join(BASE_DIR, "texts")
TEMP_DIR = os.path.join(BASE_DIR, 'temp')
if not os.path.exists(os.path.join(BASE_DIR, "logs")):
os.makedirs(os.path.join(BASE_DIR, "logs"))... |
import unittest
import tempfile
import os
from auxiclean import Distributeur
class TestBase(unittest.TestCase):
# Cours (nom),Cours (code),Dispo,Programme
cours = {}
# Nom,Premier Choix,Deuxieme Choix,Troisieme Choix,Quatrieme Choix,
# Cinquieme Choix,Disponibilite,Tp_total,Schoplarite,Nobel,
# Pr... |
"""
# Notes:
- This simulation seeks to emulate the COBAHH benchmark simulations of (Brette
et al. 2007) using the Brian2 simulator for speed benchmark comparison to
DynaSim. However, this simulation includes CLOCK-DRIVEN synapses, for direct
comparison to DynaSim's clock-driven architecture. The synaptic connec... |
# -*- coding: utf-8 -*-
# File: export.py
"""
A collection of functions to ease the process of exporting
a model for production.
"""
import tensorflow as tf
from tensorflow.python.framework import graph_util
from tensorflow.python.platform import gfile
from tensorflow.python.tools import optimize_for_inference_lib
... |
import pandas as pd
import numpy as np
import pytest
import dask
import dask.dataframe as dd
from dask.dataframe._compat import tm, PANDAS_GT_100
from dask.dataframe.indexing import _coerce_loc_index
from dask.dataframe.utils import assert_eq, make_meta, PANDAS_VERSION
dsk = {
("x", 0): pd.DataFrame({"a": [1, ... |
#! python3
import logging
import requests
import re
from urllib.parse import urlsplit, urlunsplit, urljoin
_logger = logging.getLogger("spiralx.rest")
_logger.setLevel(logging.DEBUG)
# -------------------------------------------------------------
_has_scheme = lambda u: re.match(r"(?:https?:)?//", u) is not None... |
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import HTMLParser
import json
import os
import string
from telemetry.web_components import web_components_project
from tvcm import generate
class View... |
<<<<<<< HEAD
<<<<<<< HEAD
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 AKFish <akfish@gmail.com> #
# Copyright 2013 Vincent J... |
# Copyright 2006 James Tauber and contributors
#
# 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 agre... |
"""Single slice vgg with normalised scale.
"""
import functools
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
import data_loader
import deep_learning_layers
import dihedral
import dihedral_fast
import image_transform
import layers
import preprocess
import postprocess
import objective... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.