src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Michael Droettboom All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, t... |
# coding: utf-8
#
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
from datetime import date
from django.test import TestCase
from testapp import factories
from zivinetz.models import AssignmentChange
class ChangesTestCase(TestCase):
def test_change_tracking(self):
assignment = factories.AssignmentFactory.create()
self.assertEqual(AssignmentChange.objects.cou... |
# Copyright Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
#!/usr/bin/env python
# coding: utf-8
"""
LogBot
A minimal IRC log bot
Written by Chris Oliver
Includes python-irclib from http://python-irclib.sourceforge.net/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as publishe... |
#!/usr/bin/env python3.6
import argparse
import subprocess
PRIVATE_RSA_KEY_PATH="~/.ssh/id_rsa"
PORTS = [3306, 27017]
def main():
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("-m", "--marte", action="store_true", help="re... |
import argparse
import os
import random
import numpy as np
from feature_extraction.feature_extractor_for_sequence import extract_features
from feature_extraction.tools import *
from feeder.feeder import Dataset
from feeder import utils
from support_operations.plot_confusion_matrix import plot_confusion_matrix
import pi... |
from yaml import load as load_yaml
config_file = "/Users/namelessnerd/oncodata/db/connection_params.yml"
def load_db_configuration(config_file=config_file):
with open(config_file, "r") as config_file:
configs = load_yaml(config_file)
return configs
def create_mongo_protocol(project_id, connection_par... |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... |
#!/usr/bin/python -u
# Name: fqn.plugin.name
from includes import pluginClass
from includes import regexp
import os
import sys
import re
import subprocess
import inspect
class PluginControl(pluginClass.Base):
def setOptions(self):
''' Create additional argument parser options
specific to the plugin '''
dic = ... |
from __future__ import print_function, division
import time
import logging
import os
from pomdpy.pomdp import Statistic
from pomdpy.pomdp.history import Histories, HistoryEntry
from pomdpy.util import console, print_divider
from experiments.scripts.pickle_wrapper import save_pkl
module = "agent"
class Agent:
"""... |
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... |
# gizela
#
# Copyright (C) 2010 Michal Seidl, Tomas Kubin
# Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz>
# URL: <http://slon.fsv.cvut.cz/gizela>
#
# $Id$
from gizela.data.PointLocalGama import PointLocalGama
from gizela.stat.PointDisplBase import PointDisplBase
from gizela.stat.TestResult import TestResult
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2020 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Data useful for calibrations (Smith-Pokorny cone fundamentals etc...)
"""
from __future... |
#!/usr/bin/env python
import numpy as np
n = 0; t = 0;
arr = np.load('fa.npy')
t=t+1;
if arr.dtype!='float32': print("arr.dtype!='float32'"); n = n + 1
t=t+1;
if any(arr!=[1,2,3,4]): print("arr!=[1,2,3,4]"); n = n + 1
arr = np.load("fb.npy")
t=t+1
if arr.dtype!='float32': print("arr.dtype!='float32'"); n = n + 1
t=... |
import math, os, sys, time
import numpy as Numeric
from pysparse import spmatrix
from pysparse import itsolvers
from pysparse import precon
ll = spmatrix.ll_mat(5,5)
print ll
print ll[1,1]
print ll
ll[2,1] = 1.0
ll[1,3] = 2.0
print ll
print ll.to_csr()
print ll[1,3]
print ll[1,-1]
print ll.nnz
ll.export_mtx('test.m... |
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... |
# Copyright 2013 - Mirantis, Inc.
# Copyright 2015 - Huawei Technologies Co. Ltd
# Copyright 2016 - Brocade Communications Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License ... |
#!/usr/bin/python
# 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/
import os
import re
import sys
from urllib.request import urlretrieve
from pathlib import Pat... |
import math
import random
import mMap
from misc.mLogger import log
from misc import utils
import random
class RTSState(mMap.mMap):
def __init__(self, d, camp):
super(RTSState, self).__init__(d)
self.camp = camp
def Clone(self):
st = RTSState(self.to_dict(), self.camp)
return st
def equal(self, state):
... |
from django.test import TestCase
from geokey.contributions.models import Observation
from geokey.projects.tests.model_factories import ProjectF, UserF
from geokey.categories.tests.model_factories import (
CategoryFactory, LookupFieldFactory, LookupValueFactory,
TextFieldFactory, MultipleLookupFieldFactory, Mu... |
from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
import os
VERSION = '0.3'
# Fazendo os dados irem para o lugar correto. [Make data go to the right place.]
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
for scheme in INST... |
import torch
import torch.nn as nn
import torch_dct as dct
import math
from nsoltUtility import Direction
class NsoltBlockDct2dLayer(nn.Module):
"""
NSOLTBLOCKDCT2DLAYER
ベクトル配列をブロック配列を入力:
nSamples x nComponents x (Stride(1)xnRows) x (Stride(2)xnCols)
コンポーネント別に出力(nComponents):... |
"""
(c) 2013 LinkedIn 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.0
Unless required by applicable law or agreed to in writing... |
import os.path, sys, string, codecs
from kuralib import kuraapp
from kuragui.guiconfig import guiConf
from kuragui import guiconfig
False = 0
True = 1
def splitCSVLine(line):
"""Splits a CSV-formatted line into a list.
See: http://www.colorstudy.com/software/webware/
"""
list = []
position = 0
... |
''' Wind Manipulation Routines '''
import math
from sharppy.sharptab import interp, vector
from sharppy.sharptab.constants import *
__all__ = ['mean_wind', 'mean_wind_npw', 'sr_wind', 'sr_wind_npw',
'wind_shear', 'helicity', 'max_wind', 'corfidi_mcs_motion',
'non_parcel_bunkers_motion', 'mbe_vect... |
from mycroft.messagebus.message import Message
import time
__author__ = "jarbas"
class BusQuery():
def __init__(self, emitter, message_type, message_data=None,
message_context=None):
self.emitter = emitter
self.waiting = False
self.response = Message(None, None, None)
... |
# Adjust LED brightness by rotating Potentiometer
# GrovePi + Rotary Angle Sensor (Potentiometer) + LED
# http://www.seeedstudio.com/wiki/Grove_-_Rotary_Angle_Sensor
# http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit
'''
The MIT License (MIT)
GrovePi for the Raspberry Pi: an open source platform for connecting... |
import base64, socket, sys
from twisted.application import service
from twisted.internet import defer, protocol, reactor
from twisted.python import log
from twisted.words.protocols.jabber import client, error, jid, sasl, xmlstream
from twisted.words.xish import domish
XPATH_ALL = "//*"
XPATH_AUTH = "//auth[@xmlns='%s'... |
import cv2
import numpy as np
import math
import features as ft
NUMBER_TRAINING_EXAMPLES = 150
NUMBER_TEST_EXAMPLES = 10
NUMBER_CLASSES = 4
FEATURE_TYPE = "humoments"
file_path_list = ["data/dataset1/scew_test/", "data/dataset1/nut/", "data/dataset1/profile_20/", "data/dataset1/profile_40/"]
file_saving_path = "data/"... |
import pygame
BLACK = ( 0, 0, 0)
WHITE = ( 255, 255, 255)
BLUE = ( 0, 0, 255)
RED = ( 255, 0, 0)
GREEN = ( 0, 255, 0)
size = (800, 600)
class Player(pygame.sprite.Sprite):
change_x = 0
change_y = 0
level = None
def __init__(self):
pygame.sprite.Sprite.__init__(self)
#The player. take an image, but now a... |
# Copyright Least Authority Enterprises.
# See LICENSE for details.
import os
from itertools import count, islice
from uuid import uuid4
from pykube import KubeConfig
import pem
import attr
from pyrsistent import InvariantException
from hypothesis import given
from fixtures import TempDir
from zope.interface.ve... |
import typing
import os
from cauldron import cli
from cauldron import environ
from cauldron.session import projects
from cauldron.session.writing import file_io
from cauldron.session.writing.components.definitions import COMPONENT
from cauldron.session.writing.components.definitions import WEB_INCLUDE
PLOTLY_WARNING ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('qq', '0004_rawmessage_raw_item'),
]
operations = [
migrations.CreateModel(
name='Up... |
from strategy import Strategy
import gobject
class SimpleStrategy(Strategy):
def __init__(self):
super(SimpleStrategy, self).__init__()
def do_raise_cash(self, target, hand):
raised = 0
(monopolies, crap) = self.split_hand(hand)
# first try mortgage properties that are not
# part of monopolies
for e i... |
from __future__ import division, absolute_import, print_function
import sys
import platform
import warnings
from numpy.testing.utils import _gen_alignment_data
import numpy.core.umath as ncu
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_raises,
assert... |
from libsbml import *
arraysNs = ArraysPkgNamespaces();
doc = SBMLDocument(arraysNs);
doc.setPackageRequired("arrays", True);
model = doc.createModel();
# create parameters
param = model.createParameter();
param.setId("n");
param.setValue(10);
param.setConstant(True);
param = model.createParameter();
... |
"""Describe the possible operations."""
from lp.interpreter import Interpreter, TruthTable, SetTruthTable
class Operation:
"""Base class for operations."""
def perform(self, *args):
"""Perform the operation."""
raise NotImplementedError
def parse(self, line):
"""
Generic... |
#!/usr/bin/python3
import datetime, re, sys
if len(sys.argv) > 1:
fp = sys.argv[1]
else:
current_date=str(datetime.date.today())
fp = "/home/zachary/blog2.za3k.com/_posts/{}-weekly-review.md".format(current_date)
with open(fp, "r") as f:
lines = list(line for line in f)
budget_start = re.compile("^\\|... |
import logging
import pendulum
from pymongo import MongoClient
from bson.objectid import ObjectId
from niav.ssh_tunnel import SshTunnel
class Mongo(object):
"""
MongoDB helper
- MongoDB wrapper
- load configurations
- open SSH tunnel if needed
"""
def __init__(se... |
#!/usr/bin/env cctools_python
# CCTOOLS_PYTHON_VERSION 2.7 2.6
# All the vanilla python package dependencies of Umbrella can be satisfied by Python 2.6.
"""
Umbrella is a tool for specifying and materializing comprehensive execution environments, from the hardware all the way up to software and data. A user simply in... |
# -*- coding: utf-8 -*-
from djangosige.apps.fiscal.models import NotaFiscalSaida, NotaFiscalEntrada, ConfiguracaoNotaFiscal, AutXML, \
ErrosValidacaoNotaFiscal, RespostaSefazNotaFiscal, NaturezaOperacao, GrupoFiscal, \
ICMS, ICMSUFDest, ICMSSN, IPI, PIS, COFINS
from djangosige.configs.settings import MEDIA_RO... |
#!/usr/bin/env python
"""
The script builds OpenCV.framework for iOS.
The built framework is universal, it can be used to build app and run it on either iOS simulator or real device.
Usage:
./build_framework.py <outputdir>
By cmake conventions (and especially if you work with OpenCV repository),
the output dir sh... |
import os,csv
import argparse, os,sys, time
from numpy import *
import numpy as np
import scipy
import scipy.linalg
from des_model_lib import *
from mcmc_lib import *
linalg = scipy.linalg
import scipy.stats
import random as rand
np.set_printoptions(suppress=True) # prints floats, no scientific notation
np.set_printopt... |
"""
Rule Format
1. desc - Description of the findings
2. type
a. string
b. regex
3. match
a. single_regex - if re.findall(regex1, input)
b .regex_and - if re.findall(regex1, input) and re.findall(regex2, input)
c. regex_or - if re.findall(regex1, input) or re.findall(regex2, input)
d. ... |
"""
Tests for TimedeltaIndex methods behaving like their Timedelta counterparts
"""
import numpy as np
import pytest
import pandas as pd
from pandas import Index, Series, Timedelta, TimedeltaIndex, timedelta_range
import pandas.util.testing as tm
class TestVectorizedTimedelta:
def test_tdi_total_seconds(self):
... |
#!/usr/bin/python3
'''
strava.py - strava activity module
author: Norm1 <normand.cyr@gmail.com>
found here: https://github.com/normcyr/sopel-modules
'''
import requests
from bs4 import BeautifulSoup
from sopel.module import commands, example
def fetch_new_activity(url):
r = requests.get(url)
if r.status_co... |
from __future__ import print_function
import os
import gc
import sys
import traceback
__all__ = ['measure', 'measure_with_rehearsal']
def measure_with_rehearsal():
"""
Runs a benchmark when used as an iterator, injecting a garbage
collection between iterations. Example::
for b in riak.benchmark... |
import unittest
from ArduinoState import ArduinoState
import time
class ArduinoStateTest(unittest.TestCase):
def setUp(self):
self.m_Arduino = ArduinoState()
class InputTests(ArduinoStateTest):
def test_NullInput(self):
self.assertFalse(self.m_Arduino.UpdateState(""), "Empty string te... |
"""
Prints package completion strings.
"""
from __future__ import print_function
import argparse
__doc__ = argparse.SUPPRESS
def setup_parser(parser, completions=False):
pass
def command(opts, parser, extra_arg_groups=None):
from rez.cli._util import subcommands
import os
import re
# get com... |
from __future__ import absolute_import
from django.conf import settings
from django.db import IntegrityError, models, transaction
from django.db.models import Q
from django.utils import timezone
from sentry.db.models import (
BaseManager,
BoundedPositiveIntegerField,
FlexibleForeignKey,
Model,
san... |
from .corpus import *
from .document import *
import itertools
class Stopwords(object):
def __init__(self, stopwords):
self._stopwords = stopwords
def remove_from(self, words):
for word in words:
if not word:
continue
if word not in self._stopwords:
... |
#!/usr/bin/env python
# coding=utf-8
import requests
import urllib2
import json
import os
from flask import Flask
from flask import request
from flask import make_response
from bs4 import BeautifulSoup
# Flask app should start in global layout
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webh... |
# #
# Copyright 2013-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... |
#!/usr/bin/python
import remote_core as core
import os
import sys
import nmap
import datetime
import time
import re
import go_to_sleep
try:
nm = nmap.PortScanner() # instance of nmap.PortScanner
except nmap.PortScannerError:
print('Nmap not found', sys.exc_info()[0])
sys.exit(0)
exc... |
import json
import os
from io import open
import jsone
import mock
import pytest
import requests
import yaml
from jsonschema import validate
from tools.ci.tc import decision
here = os.path.dirname(__file__)
root = os.path.abspath(os.path.join(here, "..", "..", "..", ".."))
def data_path(filename):
return os.pa... |
# -*- coding: utf-8 -*-
"""This module provides the base for segment wrappers."""
import six
class Composite(object):
"""Part of a segment."""
_content = None
def __init__(self, index=0, max_length=3, required=False):
"""Constructor."""
self.index = index
self.max_length = max_l... |
#!/usr/bin/python3
import argparse
import ast
from subprocess import Popen,call,PIPE,STDOUT, CalledProcessError
import shutil
from pipes import quote
from io import StringIO, TextIOWrapper
import sys
import os
LSDVD="lsdvd -Oy {device}"
DDRESCUE="ddrescue -MA {device} --sector-size=2048 --timeout={timeout} {title}.I... |
import logging
from timeit import default_timer as timer
import cv2
import numpy as np
from opensfm import context
from opensfm import feature_loader
from opensfm import log
from opensfm import multiview
from opensfm import pairs_selection
from opensfm import pyfeatures
from opensfm import pygeometry
from opensfm.data... |
import sys, json, os, datetime
from shapely.geometry import asShape, mapping
from fiona import collection
from core import Dump
import core
import codecs
#name, cmt, desc, link1_href
def extract_shapefile(shapefile, uri_name, simplify_tolerance=None):
for feature in collection(shapefile, "r"):
... |
from django.db.models import Sum
from django.utils.timezone import now
from kolibri.auth.models import FacilityUser
from kolibri.core.serializers import KolibriModelSerializer
from kolibri.logger.models import AttemptLog, ContentSessionLog, ContentSummaryLog, ExamAttemptLog, ExamLog, MasteryLog, UserSessionLog
from res... |
# encoding: utf-8
# Copyright (C) 2010-2015 GRNET S.A. and individual contributors
#
# 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 la... |
import itertools
import string
from abc import ABCMeta, abstractproperty
import attr
def is_valid_formula(inst, attr, value):
if not isinstance(value, (Formula, str)):
raise ValueError('{} is not a valid formula type.'.format(value))
class Formula(object):
__metaclass__ = ABCMeta
group = {'ope... |
#!/usr/bin/env python
import sys
import cv2
import numpy as np
point_count = 0;
y = [];
x = [];
def run_prespective_transform():
global src
src_quad = np.array([(x[0], y[0]), (x[1], y[1]), (x[2], y[2]), (x[3], y[3])], np.float32);
dst_quad = np.array([(0.0, 0.0), (1032.0, 0.0), (1032.0, 581.0), (0.0, 581.0)], np.f... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Thierry Sallé (@seuf)
# 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
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'com... |
"""
Some help function to compute in parallel processing at some stage:
* CatalogueConstructor.run_signalprocessor = preprocessing + peak detection
Used only for offline computation.
This is usefull mainlly when the IO are slow.
"""
import time
import os
import loky
#~ import concurrent.futures.ThreadPoolExecuto... |
import http.client
class HttpResponse(object):
responses = {}
def __init__(self, domain, port=None, timeout=10, ssl=False):
self.domain = domain
self.timeout = timeout
self.ssl = ssl
if port is None and ssl is False:
self.port = 80
elif port is None and s... |
from babel import Locale
import sqlalchemy as sa
from sqlalchemy_utils.types import WeekDaysType
from sqlalchemy_utils.primitives import WeekDays
from sqlalchemy_utils import i18n
from tests import TestCase
class WeekDaysTypeTestCase(TestCase):
def setup_method(self, method):
TestCase.setup_method(self, ... |
# -*- coding: utf-8 -*-
from .common import *
class ReferenceDescriptorTest(TestCase):
def setUp(self):
self.content_type = ContentType.objects.get_for_model(Model)
def test_reference_descriptor_search_fields_empty(self):
reference_descriptor = ReferenceDescriptor.objects.create(content_typ... |
#!/usr/bin/env python
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it und... |
"""
Return Signiant Platform Status
"""
import time
import urllib.request, urllib.error, urllib.parse
import json
import os
# Default Signiant Status Page URL
SIGNIANT_STATUS_URL = 'https://1dmtgkjnl3y3.statuspage.io/api/v2/summary.json'
STATUS_PAGE_API_KEY = None
# We need this to be set as an env var - fail if it'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... |
import urllib2,urllib,re,os
import random
import urlparse
import sys
import xbmcplugin,xbmcgui,xbmc, xbmcaddon, downloader, extract, time
import tools
from libs import kodi
from tm_libs import dom_parser
from libs import log_utils
import tools
from libs import cloudflare
from libs import log_utils
from tm_libs import d... |
# -*- coding: utf-8 -*-
# Copyright © 2012-2017 Roberto Alsina and others.
# 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 t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Reza(User:reza1615), 2011
# MIT license
import catlib ,pagegenerators
import wikipedia,urllib,gzip,codecs,re
import MySQLdb as mysqldb
import config,os
from datetime import timedelta,datetime
wikipedia.config.put_throttle = 0
wikipedia.put_throttle.setDelay()
i... |
"""
Define all the jinja2 filters that I need.
I don't think I should need *too* many filters.
"""
import codecs
import markdown
from jinja2 import Markup
from docutils.core import publish_parts
def do_rst(to_convert):
"""
This filter converts a rst string to html.
"""
output = Markup(publish_parts(so... |
###############################################################
# Imports
###############################################################
from System import TimeSpan
from Deadline.Events import *
from Deadline.Scripting import *
###############################################################
# Give Deadlin... |
# Copyright (c) 2016 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... |
# This file is part of turbulucid
# (c) 2018 Timofey Mukha
# The code is released under the GNU GPL Version 3 licence.
# See LICENCE.txt and the Legal section in the README for more information
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as ... |
"""
Tests for txOAuth contributions to Twisted.
"""
from txoauth._twisted import FancyHashMixin
from twisted.trial.unittest import TestCase
class Hashable(FancyHashMixin):
compareAttributes = hashAttributes = ("value",)
def __init__(self, value):
self.value = value
class DifferentHashable(FancyHas... |
##[01_Telemac]=group
# *************************************************************************
"""
Versions :
0.0 premier script
0.2 : un seul script pour modeleur ou non
"""
# *************************************************************************
##Type_de_traitement=selection En arriere plan;Modeler;Modeler ... |
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public... |
# -*- coding: utf-8 -*-
'''
The function in `vdirsyncer.sync` can be called on two instances of `Storage`
to synchronize them. Due to the abstract API storage classes are implementing,
the two given instances don't have to be of the same exact type. This allows us
not only to synchronize a local vdir with a CalDAV serv... |
"""Tigramite causal discovery for time series."""
# Author: Jakob Runge <jakob@jakob-runge.com>
#
# License: GNU General Public License v3.0
from __future__ import print_function
import numpy as np
from collections import defaultdict, OrderedDict
from itertools import combinations, permutations
class OracleCI:
... |
#!/usr/bin/env python
# Copyright 2016 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 decorators
import logging
import unittest
from trace_test import TraceTest
#from .trace_test import TraceTest
def generator():
... |
'''
Copyright (c) 2011, Universidad Industrial de Santander, Colombia
University of Delaware
All rights reserved.
@author: Sergio Pino
@author: Henry Arguello
Website: http://www.eecis.udel.edu/
emails : sergiop@udel.edu - henarfu@udel.edu
Date : Feb, 2011
'''
import socket
import time
import sys
from receiver.RXA... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2018
# 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 -*-
#/#############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2004-TODAY Tech-Receptives(<http://www.tech-receptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
import subprocess
import sys
import os
import win32com.client
import time
outlook = None
nameAliasDict = {}
contacts = None
numEntries = None
file = None
mail_schema = "http://schemas.microsoft.com/mapi/proptag/0x800F101F"
alias_schema = "http://schemas.microsoft.com/mapi/proptag/0x3A00001F"
criticalCommit = False
svn... |
#!/usr/bin/python3
def parse_commandline_options():
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-s", "--stack", action='store_true', dest="stack", help="produces stack trace for each running component")
parser.add_option("-l", "--last_line", type='int', dest="line"... |
""" Module to test exec_bowtie member methods.
This module contains unit tests for exec_bowtie.py.
"""
import os
import unittest
import shutil
from src import exec_bowtie
__author__ = "YiDing Fang"
__maintainer__ = "YiDing Fang"
__email__ = "yif017@eng.ucsd.edu"
__status__ = "prototype"
# input file contents. F... |
""" PublisherHandler
This service has been built to provide the RSS web views with all the information
they need. NO OTHER COMPONENT THAN Web controllers should make use of it.
"""
__RCSID__ = '$Id$'
# pylint: disable=no-self-use
import types
from datetime import datetime, timedelta
# DIRAC
from DIRAC import gLo... |
#!/usr/bin/python
#
# Copyright Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
"Base class for simulation windows"
import gtk
from ase.gui.widgets import oops, pack, help
from ase import Atoms
class Simulation(gtk.Window):
def __init__(self, gui):
gtk.Window.__init__(self)
self.gui = gui
def packtext(self, vbox, text, label=None):
"Pack an text frame into the wi... |
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
# 导入hello.py 文件 和
import hello
import pythontest
import pythondef
#hello.print_func("World")
# Python 读写文件
# 1.打开文件 使用 open 打开文件后, 一定要记得调用文件对象的close()方法,比如可用try/finally 语句来确保最后能关闭文件.
file_object = open("testfile")
print(file_object.name)
try:
all_the_test = file_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`binary`
==================
Created by hbldh <henrik.blidh@nedomkull.com>
Created on 2016-01-26
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import numpy... |
import os
from .arguments import Arguments
from .uiwriter import UiWriter, HtmlWriter, CLIFormatter, HtmlFormatter
from .tpg import Tpg
from config import Config
from datetime import datetime
from flask import render_template
from jinja2 import Environment, FileSystemLoader, DebugUndefined, Template
env = Environment... |
# -*- coding: utf-8 -*-
"""
DBSCAN Acclerated by Facebook AI Faiss
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Joel Nothman <joel.nothman@gmail.com>
# Lars Buitinck
#
# License: BSD 3 clause
import numpy as np
import time
f... |
from elasticsearch_dsl import field
def test_custom_field_car_wrap_other_field():
class MyField(field.CustomField):
@property
def builtin_type(self):
return field.String(**self._params)
assert {'type': 'string', 'index': 'not_analyzed'} == MyField(index='not_analyzed').to_dict()
d... |
#!/usr/bin/python
#
# 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 distribut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.