src stringlengths 721 1.04M |
|---|
"""
Copyright (c) 2016, Battelle Memorial Institute
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, this
list of conditions a... |
# -*- coding: utf-8 -*-
# Copyright 2013, 2014, 2015, 2016, 2017, 2018 Kevin Reid and the ShinySDR contributors
#
# This file is part of ShinySDR.
#
# ShinySDR 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,... |
#!/usr/bin/env python2
# Copyright (c) 2014 The FacileCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the wallet keypool, and interaction with wallet encryption/locking
# Add python-facilecoinrpc t... |
"""remove history constraints
Revision ID: 03bdb0a44083
Revises: 534d805d5dcf
Create Date: 2019-03-21 15:32:02.572675
"""
from alembic import op
from rdr_service.dao.alembic_utils import ReplaceableObject
# revision identifiers, used by Alembic.
revision = "03bdb0a44083"
down_revision = "534d805d5dcf"
branch_labels... |
from merc import channel
from merc import errors
from merc import feature
from merc import message
from merc import mode
class PrivmsgFeature(feature.Feature):
NAME = __name__
install = PrivmsgFeature.install
MAX_TARGETS = 4
class _Privmsg(message.Command):
MIN_ARITY = 2
FORCE_TRAILING = True
def __ini... |
# -*- coding: utf-8 -*-
import os
DEBUG=True
SASS_DEBUG = DEBUG
TEMPLATE_DEBUG=DEBUG
#COMPRESS_ENABLED=True
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
ADMINS = (
('jacek', 'jacek@ivolution.pl'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
... |
__author__ = 'mouton'
from collections import defaultdict
import pygame
from pygame import Color
from pygame.rect import Rect
DEFAULT_WIDTH = 1
DEFAULT_COLOR = '000000'
_rectsList = defaultdict(list)
_rectsToUpdate = []
def init():
reinit()
def reinit():
_rectsList.clear()
del _rectsToUpdate[:]
def... |
# -*- coding: utf-8 -*-
import os
from distutils.core import setup
from setuptools import find_packages
__author__ = 'Alexei Kuzmin'
__version__ = "0.9.13"
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-yandex-kassa',
version=__version__,
packages=find... |
from heapq import heappop, heappush, heapify
class Graph:
def __init__(self, n, adj):
self.n = n
self.adj = adj
def mst(self,m):
return 'yes' if self._prims(m) else 'no'
def _prims(self,m):
best = [0] * self.n
remaining = set(range(1,self.n))
visited = [Tru... |
# This file is part of NDR.
#
# Copyright (C) 2017 - Secured By THEM
# Original Author: Michael Casadevall <michaelc@them.com>
#
# NDR 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 Li... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2017 Anler Hernández ... |
"""
Types for objects parsed from the configuration.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import os
from collections import namedtuple
import six
from compose.config.config import V1
from compose.config.errors import ConfigurationError
from compose.const import IS_WINDOW... |
import logging
from keras.layers import Dense, ZeroPadding1D, Embedding, Convolution1D, MaxPooling1D, Flatten, Input
from keras.models import Model
from utils.data_utils import load_embedding_matrix
def create_default_model(config_data):
nb_filter = 200
filter_length = 6
hidden_dims = nb_filter
embe... |
from webassets import Environment, six
from webassets.env import RegisterError
from .package import Package
class Assets(object):
def __init__(self, env=None, **kwargs):
if env:
self.env = env
else:
self.env = Environment(**kwargs)
self.packages = {}
def regist... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2010-2012 Asidev s.r.l.
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... |
##############################################################################
# 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... |
import time
def fake_mic(logger, q, mic_stopped):
time.sleep(60)
logger.debug("TRIGGERED")
class StoppableAudioStreamLike:
def __init__(self, file):
self._f = file
self._eof = False
self._last_byte = None
def read(self, size=-1):
if mic_sto... |
'''
https://github.com/hasgar/CricLiveNotifier
'''
#!/usr/bin/python
import getpass
import os
from crontab import CronTab
from bs4 import BeautifulSoup
import urllib2,cookielib
from urllib2 import urlopen
from xml.dom.minidom import parse, parseString
import sys
from math import ceil
from sys import argv
import Foundat... |
from __future__ import print_function, division
import imgaug as ia
from imgaug import augmenters as iaa
from scipy import misc, ndimage
import numpy as np
from skimage import data
def main():
augseq = iaa.Sequential([
iaa.Fliplr(0.5),
iaa.CoarseDropout(p=0.1, size_percent=0.1)
])
print("-... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005 Jonas Borgström <jonas@edgewall.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://t... |
# Copyright 2016 Sebastian Spautz <sebastian@human-injection.de>
#
# This file is part of "RPI Display Backlight Control for Kodi".
#
# "RPI Display Backlight Control for Kodi" is free software: you can
# redistribute it and/or modify it under the terms of the GNU General
# Public License as publishe... |
# -*- coding: koi8-r -*-
## OJAB iq module
## Copyright (C) Boris Kotov <admin@avoozl.ru>
##
## 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 op... |
#!/usr/bin/env python
#coding: utf-8
#### FUNCTIONS ####
def header(string):
"""
Display header
"""
timeInfo = time.strftime("%Y-%m-%d %H:%M")
print '\n', timeInfo, "****", string, "****"
def info(string):
"""
Display basic information
"""
timeInfo = time.strftime("%Y-%m-%... |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Ibai Roman
#
# This file is part of GPlib.
#
# GPlib 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 ... |
##
# Copyright 2021-2021 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 (F... |
# Copyright (C) 2014-2015 eNovance SAS <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
#!/usr/bin/env python3
#
# Copyright (C) Anton Liaukevich 2011-2020 <leva.dev@gmail.com>
#
# This program 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 3 of the License, or (at your o... |
# -*- 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... |
# PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# 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 ap... |
# -*- coding: utf-8 -*-
# flake8: noqa
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Cluster'
db.create_table('documents_cluster', (
('id', self.gf('d... |
from setuptools.command.sdist import sdist as SetuptoolsSdist
from setuptools import setup, find_packages
import os
import shutil
import version
from src import PROJECT_NAME, PROJECT_DESCRIPTION, README_PATH
class SdistAndClean(SetuptoolsSdist):
'''
Runs the default setuptools sdist command and then cleans t... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
用list实现队列
"""
class Queue(object):
"""docstring for Queue"""
class EmptyNode(object):
"""
用EmptyNode来实现特殊的空节点表示
"""
pass
def __init__(self, cap):
super(Queue, self).__init__()
self.__empty = self.EmptyNode()... |
"""
Test application that uses plottools
An application required by the REFL group and mainly test copy and print.
The following is a checklist of functionality to look for while testing:
1- Start the application:
the graph should have theory curve, experimental data, chisq
with a white background.
2- Hove... |
# Copyright 2016 Red Hat
# 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 appli... |
# Copyright (c) 2013 Marion Zepf
# Copyright (c) 2014 Walter Bender
# 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, cop... |
'''
SOApp config file
'''
import os
import sys
class Config(object):
DEBUG = False
TESTING = False
DEVELOPMENT = False
WTF_CSRF_ENABLED = True
# Random value needed for OAuth2 process (unsecure value)
OAUTH2_STATE_RANDOM = '+HqEsxiec6/inR3EPwM29DCF9IUBNSmQ9giWY2yC1u0='
class DevelopmentConfig... |
# Copyright 2016 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 applica... |
from CommonServerPython import *
import jwt
import uuid
import requests
import json
import re
import zipfile
from StringIO import StringIO
from datetime import datetime, timedelta
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
# CONSTANTS
TOKEN_TIMEOUT = 300 # 5 minutes
URI_AUTH = 'auth/v2/... |
"""
Convolution (using FFT, NTT, FWHT), Subset Convolution,
Covering Product, Intersecting Product
"""
from __future__ import print_function, division
from sympy.core import S
from sympy.core.compatibility import range, as_int
from sympy.core.function import expand_mul
from sympy.discrete.transforms import (
fft, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""
Parse Bank statement
====================
From CSV to ledger
"""
# Created: Sat May 18 18:32:47 2019
# Author: Óscar Nájera
# License: GPL-3
import argparse
import csv
import shlex
import subprocess
from datetime import datetime
from collections import namedtuple
... |
'''
Created on Mar 23, 2015
@author: Coeurl
'''
import shutil
import os
from tests import setup_test_logging, BZTestCase, __dir__
from bzt.modules.grinder import GrinderExecutor
from tests.mocks import EngineEmul
from bzt.utils import BetterDict
setup_test_logging()
class TestGrinderExecutor(BZTestCase):
def ... |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
"""
Provides a Python implementation of RDDs.
"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import io
import sys
import copy
import pickle
import random
import logging
import functools
import itertools
import subprocess
from collections import defaul... |
# This file is part of Pyrakoon, a distributed key-value store client.
#
# Copyright (C) 2013, 2014 Incubaid BVBA
#
# 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.or... |
"""
Texas - Ticket Sales System
Copyright (C) 2010 Ben Sarsgard
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 ... |
"""Definition classes for transformations."""
import collections
import logging
logger = logging.getLogger( __name__ )
TransformResult = collections.namedtuple( 'TransformResult', ['payload', 'end_offset'] )
TransformResult.__new__.__defaults__ = (b'', 0)
class Transform( object ):
"""Base class for defining tra... |
from __future__ import unicode_literals
from future.builtins import int, str, zip
from django import forms
from django_comments.forms import CommentSecurityForm, CommentForm
from django_comments.signals import comment_was_posted
from django.contrib.admin.templatetags.admin_static import static
from django.utils.safest... |
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
# Simo Sorce <ssorce@redhat.com>
#
# Copyright (C) 2007 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... |
import zlib
from django.db import models
from django.utils.translation import ugettext_lazy as _
class AbstractAddress(models.Model):
"""
Superclass address object
This is subclassed and extended to provide models for
user, shipping and billing addresses.
The only required fields are last_name... |
import os
import time
import socket
import paramiko
import contextlib
import subprocess
from rrmngmnt.executor import Executor
AUTHORIZED_KEYS = os.path.join("%s", ".ssh/authorized_keys")
KNOWN_HOSTS = os.path.join("%s", ".ssh/known_hosts")
ID_RSA_PUB = os.path.join("%s", ".ssh/id_rsa.pub")
ID_RSA_PRV = os.path.join("... |
import os
from pydub import AudioSegment
from pydub.playback import play
class SoundSystem(object):
"Systém pro pouštění zvuků a přehrávání textu."
def __init__(self):
self.samples = {
'Beep': AudioSegment.from_wav("robbie/sounds/Beep.wav"),
'Action': AudioSegment.from_wav("robbie/sounds/Action.wav"),
'... |
# Copyright (c) The ppo team
# See LICENSE for details.
import tempfile
import os
from ppo import plugins
from structlog import get_logger
try:
from pysqlite2 import dbapi2 as sqlite
except ImportError:
import sqlite3 as sqlite
class SQLite3Parser(plugins.ParserPlugin):
"""
I parse SQLite database... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
A simple, lightweight, WSGI-compatible web framework.
'''
__author__ = 'Michael Liao'
import types, os, re, cgi, sys, time, datetime, functools, mimetypes, threading, logging, urllib, traceback
try:
from cStringIO import StringIO
except ImportError:
from Str... |
import h5py as _h5
import numpy as _np
import logging as _logging
import time as _time
_logger = _logging.getLogger(__name__)
import ipdb as pdb
import re as _re
def _timestamp2filename(cls, ftype, filename=None):
# ======================================
# Get filename from timestamp
# ==================... |
#!/usr/bin/env python
from graphitesend import graphitesend
import unittest2 as unittest
import socket
import os
class TestAll(unittest.TestCase):
""" Basic tests ( better than nothing ) """
def setUp(self):
""" reset graphitesend """
# Drop any connections or modules that have been setup fr... |
# Pretty-printers for libstc++.
# Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
# 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
... |
import re
import typing
from datetime import datetime
import logging
from sdcm.es import ES
from test_lib.utils import get_class_by_path
from .base import ClassBase, __DEFAULT__
from .metrics import ScyllaTestMetrics
LOGGER = logging.getLogger(__name__)
ES_LUCENE_ESCAPE_REGEXP = re.compile(r'([^0-9a-zA-Z_.])')
c... |
# -*- coding: utf-8 -*-
#
import codecs
import io
import os
import textwrap
import abstractRenderer
#
# Simplest renderer. Ignores everything except ascii text.
#
class Renderer(abstractRenderer.AbstractRenderer):
def __init__(self, inputDir, outputDir, outputName, config):
self.identity = 'asci... |
"""
Django settings for lci 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_DIR, ...)
import... |
# -*- coding: utf-8 -*-
'''
Created on 14 Apr 2016
@author: Éric Piel
Copyright © 2016 Éric Piel, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Odemis is... |
#!/usr/bin/env python
#####################################################################
# This script presents how to run some scenarios.
# Configuration is loaded from "../../examples/config/<SCENARIO_NAME>.cfg" file.
# <episodes> number of episodes are played.
# Random combination of buttons is chosen for every... |
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
#!/usr/bin/env python
def quicksort(arr, partition):
if (partition == "hoare"):
quicksort_hoare(arr, 0, len(arr) -1)
elif (partition == "lomuto"):
quicksort_lomuto(arr, 0, len(arr) -1)
else:
raise ValueError()
def quicksort_hoare(arr, lo, hi):
# lo and hi follow standard method... |
"""
Descriptive HTTP status codes, for code readability.
See RFC 2616 - Sec 10: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Also see django.core.handlers.wsgi.STATUS_CODE_TEXT
"""
HTTP_100_CONTINUE = 100
HTTP_101_SWITCHING_PROTOCOLS = 101
HTTP_200_OK = 200
HTTP_201_CREATED = 201
HTTP_202_ACCEPTED = 202
HTT... |
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
import sys
sys.path.insert(0, 'pyps')
import version as proj_version
import pyps.version as proj_version
requires = [
'docit',
'colour',
]
setup(
name='pyps',
author='Brian Mearns',
auth... |
import os
import re
import json
import codecs
import lxml.etree as ET
from copy import deepcopy
from collections import namedtuple, defaultdict
try:
from PIL import Image
except ImportError:
pass
from builder.ext_button import Button, Option, ChromeString, ChromeFile
try:
basestring
except NameError:
... |
# -*- encoding:utf-8 -*-
"""
交易执行代理模块
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from contextlib import contextmanager
from functools import total_ordering
from enum import Enum
import numpy as np
import pandas as pd
from . import ABuTradeDra... |
#
# Copyright (C) 2001 Andrew T. Csillag <drew_csillag@geocities.com>
#
# You may distribute under the terms of either the GNU General
# Public License or the SkunkWeb License, as specified in the
# README file.
#
import sys
import string
import ParseSkunkDoc
def doDocString(s):
"""**if <cod... |
# Copyright (C) 2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 versio... |
# Copyright 2016 F5 Networks 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 writi... |
'''
PUMA560AKB Load kinematic and dynamic data for a Puma 560 manipulator
from robot.puma560akb import *
Defines the object 'p560m' in current workspace which describes the
kinematic and dynamic characterstics of a Unimation Puma 560 manipulator
modified DH conventions and using the data and conventions of:
Arms... |
"""
Export neuroimaging results created with feat in FSL following NIDM-Results
specification.
@author: Camille Maumet <c.m.j.maumet@warwick.ac.uk>
@copyright: University of Warwick 2013-2014
"""
import re
import os
import sys
import glob
import json
import numpy as np
import subprocess
import warnings
# If "nidmres... |
# 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 ... |
# -*- coding: utf-8 -*-
#
# period documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 10 18:37:45 2012.
#
# 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
# autogenerated file.
#
# All ... |
import asyncio
from collections import OrderedDict
import logging
from artiq.tools import TaskObject
from artiq.protocols import pyon
logger = logging.getLogger(__name__)
# support Qt CamelCase naming scheme for save/restore state
def _save_state(obj):
method = getattr(obj, "save_state", None)
if method is... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
# coding: utf-8
import pytest
from lupin import Schema, String, Constant, Int, Mapping, Float, processors, List
from ..fixtures import Thief, Painting, Jewel, Book
@pytest.fixture
def thief_schema():
return Schema({
"firstName": String(binding="first_name"),
"lastName": String(binding="last_name... |
#!/usr/bin/env python
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011, Nexenta Systems Inc.
#
# 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 restric... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/usr/bin/env python
import os
import shutil
import sys
import subprocess
from string import Template
from optparse import OptionParser
import doppler
CONFIG_TEMPLATES_PATH = os.path.join(os.path.dirname(doppler.__file__), "config")
DEFAULT_CONFIG_PATH = "/etc/doppler-agent.conf"
DEFAULT_UPSTART_PATH = "/etc/init... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from mock import MagicMock
import json
import urllib
import urllib2
import sys
import os
sys.path.append(os.getcwd())
import interactivespaces
TEST_ACTIVITY_DATA = {
"id":"53",
"bundleContentHash":"hjkl",
... |
"""
Operations on EDS
"""
import warnings
from itertools import count
from delphin import variable
from delphin import scope
from delphin import eds
from delphin import util
def from_mrs(m, predicate_modifiers=True, unique_ids=True,
representative_priority=None):
"""
Create an EDS by convertin... |
# Copyright (c) 2019, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
# Takes a json file that contains many tiles with their bounding boxes (Tile-Spec format)
# and a bounding box, and outputs a json file for each tile that is overlapping with the bounding box
import sys
import os
import argparse
import json
from bounding_box import BoundingBox
# common functions
def load_tiles(ti... |
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
import datetime
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
ex... |
from functions import groups,search,logger,config
import re
import discord
import pprint
DESC="Ban many members at once with id's"
USAGE="massban [list of id's (separated with space or new line)]"
async def init(bot):
chat=bot.message.channel
try:
if len(bot.args)>0:
uid = ' '.join(bot.arg... |
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing the sync stages."""
import contextlib
import datetime
import logging
import os
import sys
from xml.etree import ElementTree
from... |
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
'''
Here We use the Floyd Steinberg transforming matrix:
| * 7 |
1/16 | |
| 3 5 1 |
to produce the error diffusion. Where the star (*) indicates current pixel
and other elements represent the weight if pixels. See error_d... |
# -*- coding: utf-8 -*-
# code-06.py
"""
Dependência: Matplotlib, NumPy
Executar no prompt: pip install matplotlib
Executar no prompt: pip install numpy
Executar no prompt: pip install scikit-learn
Executar no prompt: pip install scipy
*** Atenção:
Este arquivo deverá executado no mesmo diretório do arquivo iris.csv
... |
from datetime import datetime
from flask import abort, flash, request, render_template, redirect, url_for
from flask.ext.login import login_required, current_user
from sqlalchemy import desc
from . import blog
from .forms import PostForm, DeleteForm
from ..models import db, Post
@blog.route('/')
@blog.route('/inde... |
#!/usr/bin/env python
"""
File scheduler.py
Job scheduler for managing configured events
by Kana kanabanarama@googlemail.com
"""
import time
import atexit
import logging
from datetime import datetime
from apscheduler.schedulers.background import BackgroundScheduler # pylint: disable=import-error
from apscheduler.even... |
#
# Copyright 2014 Quantopian, 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 wr... |
'''
Finds the cheapest fares filed to a given city
Example:
python cheapest-destinations.py YTO CA
Result:
FLL 165.62
MCO 165.62
JFK 172.36
LGA 191.12
'''
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_except... |
from __future__ import division
import pylab
import numpy as np
import run_data
reload(run_data)
def get_unit_gradients(resdict, ind=0, op=lambda x: x):
return dict((k, np.gradient(op(v[ind])))
for k,v in resdict.iteritems())
def get_gradients(resdict, op1=lambda x: x, op2=lambda x: x):
retur... |
#! /usr/bin/env jython
#
# Copyright 2014 Simone F. <groppo8@gmail.com>
#
# This file is part of qat_script.
# qat_script 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, o... |
from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
from django.conf import settings
from django.db import connection
from common.alignment import Alignment, ClosestReceptorHomolog
from protein.models import Protein, ProteinSegment
from structure.models imp... |
# Django settings for analytics project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
APPLICATION_DIR = os.path.dirname(globals()['__file__'])
PROJECT_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), ".."),
)
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATAB... |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... |
from __future__ import division, print_function
from .. import fdiff
from ..fdiff import *
import matplotlib.pyplot as plt
import pandas as pd
import os
import numpy as np
from uncertainties import unumpy
plot = False
def test_second_order_diff():
"""Test `second_order_diff`."""
# Create a non-equally space... |
# -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.