src stringlengths 721 1.04M |
|---|
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.safezone.GameTutorials
from panda3d.core import Vec4
from direct.gui.DirectGui import *
from direct.fsm import FSM
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLo... |
# -*- coding=utf-8 -*-
import datetime
import os
import shutil
import subprocess
from jinja2 import ChoiceLoader
import pkg_resources
from six import u
from starterpyth.cliforms import BaseForm
from starterpyth.utils import binary_path, walk
from starterpyth.log import display, GREEN, CYAN, RED
from starterpyth.trans... |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name="gitrecipe",
version='0.0.2',
description='Simple buildout recipe for downloading git repositories. It uses system git command and its syntax',
author='Ivan Gromov',
author_email='summer.is.gone@gmail.com',
url='htt... |
#! /usr/bin/env python
"""A suite to test file_exist."""
import os
import pytest
import luigi
from luigi.interface import build
from piret.counts import featurecounts as fc
from plumbum.cmd import rm, cp
def test_featurecount():
"""Test star index creation and mapping."""
map_dir = os.path.join("tests/test_c... |
#! /usr/bin/env python
'''Our code to connect to the HBase backend. It uses the happybase
package, which depends on the Thrift service that (for now) is
part of HBase.'''
from gevent import monkey
monkey.patch_all()
import struct
import happybase
import Hbase_thrift
from . import BaseClient
def column_name(integer... |
# Copyright 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
import json
from django.test import TestCase
from django.core import management
from django.contrib.auth.models import User
from app.services.models import Event
from app.achievement.utils import find_nested_json
from app.achievement.hooks import check_for_unlocked_achievements
from app.achievement.models import UserP... |
class clsLocation:
#this class provides the support for enumerated locations
ROOM=0
DOOR=1
WALL=2
#some more changes went here before the start of the service
#
#
#this branch is called development 01
#this is another branch here
class clsPlayerState:
#this class provides the functions to suppor... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... |
"""
Experiment Diary 2016-05-31
"""
import sys
import math
import matplotlib.pyplot as plt
from scipy import io
import numpy as np
from scipy.sparse.linalg import *
sys.path.append("../src/")
from worker import Worker
from native_conjugate_gradient import NativeConjugateGradient
from native_conjugate_gradient import ... |
# This file is part of Korman.
#
# Korman 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.
#
# Korman is distributed i... |
# -*- coding: utf-8 -*-
# Copyright 2009-2021 Joshua Bronson. All Rights Reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""Provide :class:`_DelegatingBidi... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
DsgTools
A QGIS plugin
Brazilian Army Cartographic Production Tools
-------------------
begin : 2019-07-04
git sha ... |
#!/usr/bin/env python
import socket
import threading
import sbs
TCP_IP = '10.0.0.184'
TCP_PORT = 10001
BUFFER_SIZE = 1024
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
pipeaway = {'kern.alert': None, 'daemon.warn': None, 'CMS MDM': None}
for key in pipeaway:
pipeaway[key] ... |
# -*- test-case-name: buildbot.test.test_util -*-
from twisted.trial import unittest
from buildbot import util
class Foo(util.ComparableMixin):
compare_attrs = ["a", "b"]
def __init__(self, a, b, c):
self.a, self.b, self.c = a,b,c
class Bar(Foo, util.ComparableMixin):
compare_attrs = ["b", "c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2001 by Object Craft P/L, Melbourne, Australia.
#
# LICENCE - see LICENCE file distributed with this software for details.
#
# To use:
# python setup.py install
#
"""Sybase module for Python
The Sybase module provides a Python interface to the Sybase r... |
# 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
# distributed under the ... |
#
# ----------------------------------------------------------------------------------------------------
#
# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2015, Anima Istanbul
#
# This module is part of anima-tools and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
"""Relax Vertices by Erkan Ozgur Yilmaz
Relaxes vertices without shrinking/expanding the geometry.
Version History
-------... |
from subprocess import Popen, PIPE
from gfbi_core.git_model import GitModel
from gfbi_core.editable_git_model import EditableGitModel
from gfbi_core.util import Index, Timezone
from git.objects.util import altz_to_utctz_str
from datetime import datetime
import os
import time
REPOSITORY_NAME = "/tmp/tests_git"
AVAILAB... |
from setuptools import setup, find_packages
import os
setup(
name='django-project-templates',
version = "0.11",
description="Paster templates for creating Django projects",
author='Gareth Rushgrove',
author_email='gareth@morethanseven.net',
url='http://github.com/garethr/django-project-template... |
# -*- coding: UTF-8 -*-
# Copyright 2014-2015 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""
For each client who has a non-empty `card_number` we create a
corresponding image file in the local media directory in order to
avoid runtime error when printing documents who include this picture
(`eid_conten... |
from __future__ import unicode_literals
def _(text):
return text.strip('\n')
USAGE = _("""
Usage: rock [--help] [--env=ENV] [--path=PATH] [--runtime=RUNTIME] command
""")
HELP = _("""
--help show help message
--verbose show script while running
--dry-run show script without r... |
import unittest2
from unittest2 import TestCase
from rational.rational import gcd
from rational.rational import Rational
__author__ = 'Daniel Dinu'
class TestRational(TestCase):
def setUp(self):
self.known_values = [(1, 2, 1, 2),
(-1, 2, -1, 2),
... |
# -*- coding: utf-8 -*-
# [HARPIA PROJECT]
#
#
# S2i - Intelligent Industrial Systems
# DAS - Automation and Systems Department
# UFSC - Federal University of Santa Catarina
# Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org),
# Guilh... |
# -*- coding: utf-8 -*-
import six
from django.conf import settings
from django.core import validators
from django.db import models
from django.utils.translation import gettext_lazy
from modeltranslation.manager import MultilingualManager
class TestModel(models.Model):
title = models.CharField(gettext_lazy('titl... |
#
# Copyright (c) 2015-2017 EpiData, Inc.
#
from datetime import datetime, timedelta
from epidata.context import ec
from epidata.sensor_measurement import SensorMeasurement
from epidata.utils import ConvertUtils
from epidata.analytics import *
import numpy
from pyspark.sql import Row
from pyspark.sql import Column
fro... |
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: pool.py
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
import tensorflow as tf
import numpy
from ._common import *
from ..tfutils.symbolic_functions import *
__all__ = ['MaxPooling', 'FixedUnPooling', 'AvgPooling', 'GlobalAvgPooling',
'BilinearUpSample']
@la... |
# -*- coding: utf-8 -*-
"""
SwarmOps.config
~~~~~~~~~~~~~~
The program configuration file, the preferred configuration item, reads the system environment variable first.
:copyright: (c) 2018 by staugur.
:license: MIT, see LICENSE for more details.
"""
from os import getenv
GLOBAL = {
"Proce... |
#def create_sliced_iter_funcs_train2(model, X_unshared, y_unshared):
# """
# WIP: NEW IMPLEMENTATION WITH PRELOADING GPU DATA
# build the Theano functions (symbolic expressions) that will be used in the
# optimization refer to this link for info on tensor types:
# References:
# http://deeplearni... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Thu Jul 23 16:26:35 2015
# by: The Resource Compiler for PyQt (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x0e\x0d\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x... |
from json.encoder import encode_basestring
from slimit import ast as js
from ..types import NamedArgMeta, VarArgsMeta, VarNamedArgsMeta
from ..utils import split_args, normalize_args
from ..nodes import Tuple, Symbol, Placeholder, String, Number
from ..utils import Environ
from ..compat import text_type
from ..checke... |
from sympy import (
Abs, acos, acosh, Add, And, asin, asinh, atan, Ci, cos, sinh, cosh,
tanh, Derivative, diff, DiracDelta, E, Ei, Eq, exp, erf, erfc, erfi,
EulerGamma, Expr, factor, Function, gamma, gammasimp, I, Idx, im, IndexedBase,
integrate, Interval, Lambda, LambertW, log, Matrix, Max, meijerg, Mi... |
# -*- coding: utf_8 -*-
"""Generate Zipped downloads."""
import logging
import os
import re
import shutil
from django.conf import settings
from django.shortcuts import redirect
from MobSF.utils import print_n_send_error_response
logger = logging.getLogger(__name__)
def run(request):
"""Generate downloads for ... |
# -*- coding: UTF-8 -*-
# =============================================================================
# Copyright (C) 2012 Brad Hards <bradh@frogmouth.net>
#
# Based on wms.py, which has the following copyright statement:
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2005 Nuxeo SARL <http://nuxeo.com>
#
... |
"""Base admin models."""
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.utils import timezone
from modoboa.core import models as core_models
from modoboa.lib.permissions import (
grant_access_to_object, ungrant_access_to_object
)
class AdminObjectManager(... |
# 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 ... |
import stat
import os
import click
import requests
BOTTLENOSE_API_URL = 'http://127.0.0.1:8000/api/'
def has_valid_permissions(path):
perm = oct(stat.S_IMODE(os.lstat(path).st_mode))
return perm == oct(0o600)
def get_token():
try:
tokenfile = os.path.join(os.environ['HOME'], '.bnose')
... |
#!/usr/bin/env python
# encoding: utf-8
# Written by Minh Nguyen and CBIG under MIT license:
# https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
from __future__ import print_function, division
import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
import numpy as np
import... |
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2015 Mozilla Corporation
# Author: jvehent@mozilla.com
# Requires:
# mozlibldap
f... |
#!/usr/bin/env python
from signal import *
import os
import time
import math
import logging as L
import sys
import MySQLdb
import RPi.GPIO as GPIO
import Adafruit_MAX31855.MAX31855 as MAX31855
import RPi.GPIO as GPIO
from RPLCD import CharLCD
#Set up LCD
lcd = CharLCD(pin_rs=17, pin_rw=None, pin_e=27, pins_data=[12, ... |
# A LXD inventory that idempotently provisions LXD containers. You could
# probably do something similar with cloud APIs if so inclined.
import json
import os
from subprocess import check_output, check_call, CalledProcessError
containers=['hkp1', 'hkp2']
addrs=[]
def ensure_container(name):
try:
check_ou... |
# -*- coding: utf-8 -*-
from typing import cast, Any, Dict
import mock
import json
import requests
from zerver.lib.outgoing_webhook import (
get_service_interface_class,
process_success_response,
)
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.topic import TOPIC_NAME
from zerver.models imp... |
import re, difflib
def merge_group(list, func, start=True, end=True):
l, r, s = list[0]
first = ['',' class="first"'][start]
last = ['',' class="last"'][end]
if len(list) == 1:
if start and end:
return LINE_FORMAT % func(' class="first last"', l, r)
else:
retur... |
#!/usr/env python
#BMDLVIEW: Views Microsoft 3D Movie Maker models (BMDLs)
#Copyright (C) 2004-2015 Foone Turing
#
#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 ... |
#!/usr/bin/python
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# 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 opti... |
import unittest
from monitor.metrics.DMIDecode import bios,system, chassis,cache, portConnector,\
systemSlot, onBoardDevice, oemString, systemConfigurationOptions,\
physicalMemoryArray, memoryDevice, memoryError32Bit,\
memoryArrayMappedAddress, memoryDeviceMappedAddress, voltageProbe,\
coolingDevice, ... |
from urllib.parse import quote
import json
import os
from src import log_entry
from .obfuscation import transform
from .exceptions import KeysDirectoryNotFound, KeysFileNotFound
user_index = os.path.join(os.path.dirname(__file__), "keys_loc.json")
default_context = "OGS"
obfuscated = "_obfuscated_"
plaintext = "_pla... |
import urllib2
import json
files = '''blataget-gtfs.csv
blekingetrafiken-gtfs.csv
dalatrafik-gtfs.csv
gotlandskommun-gtfs.csv
hallandstrafiken-gtfs.csv
jonkopingslanstrafik-gtfs.csv
kalmarlanstrafik-gtfs.csv
lanstrafikenkronoberg-gtfs.csv
localdata-gtfs.csv
masexpressen.csv
nettbuss-gtfs.csv
nsb-gtfs.csv
o... |
#!/usr/bin/env python
import os
from struct import Struct
from .dtypes import *
UNICODE_BLANK = ''
class DBCRecord(object):
"""A simple object to convert a dict to an object."""
def __init__(self, d=None):
self.data = d
def __repr__(self):
return "<DBCRecord %r>" % self.data
def _... |
"""
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
distributed under the Li... |
# -*- test-case-name: twisted.web2.dav.test.test_report_expand -*-
##
# Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without ... |
# Copyright 2012 OpenStack LLC
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
#
# 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... |
"""
Dict with the emojis of osm tyles
"""
typeemoji = {
'aerialway:cable_car': '\xF0\x9F\x9A\xA1',
'aerialway:station': '\xF0\x9F\x9A\xA1',
'aeroway:aerodrome': '\xE2\x9C\x88',
'aeroway:terminal': '\xE2\x9C\x88',
'amenity:ambulance_station': '\xF0\x9F\x9A\x91',
'amenity:atm': '\xF0\x9F\x92\xB3'... |
'''Ensure non-immutable constants are copied to prevent
mutation affecting constant in future uses
'''
from ..runtime.builtins import get_builtin_symbol
from ..runtime.immutable import immutablep
from .walk import IRWalker, propigate_location
from . import ir as I
from .bind import Binding, BindingUse
copy_binding... |
"""
Plotting functions.
"""
from __future__ import absolute_import
import matplotlib.pyplot as plt
import numpy as np
def hhist(items, title=None, axislabel=None, color=None, height=None, width=None, reverse=False):
"""
Plots a horizontal histogram of values and frequencies.
Arguments:
items (it... |
# -*- coding: utf-8 -*-
#!/bin/python
def codegen(paratype, paraname):
string_code_raw = '''
private {0} m_{1};
public {0} {1}
{{
get
{{
return m_{1};
}}
set
{{
m_{1} = value;
if (PropertyC... |
"""
Optional Settings:
TEST_EXCLUDE: A list of apps to exclude by default from testing
RUN_ALL_TESTS: Overrides exclude and runs all tests (default: False - which uses the TEST_EXCLUDE)
TEST_FIXTURES: A list of fixtures to load when testing.
"""
import unittest
from django.core.management import call_comma... |
# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>
#
# 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, modif... |
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
from Products.UWOshOIE.tests.uwoshoietestcase import UWOshOIETestCase
from Products.CMFCore.WorkflowCore import WorkflowException
class TestTransitionDeclineFromFacultyReview(UWOshOIETestCase):
"""Ensure product is p... |
#!/usr/bin/python
__author__ = "Ryan Plyler"
__version__ = 0.2
import sys
import json
import os
########################################################################
# Config
########################################################################
TODO_FILENAME = os.path.join(os.getcwd(), '.todo.list')
########... |
from functools import partial
from django.conf import settings
from django.core.cache import cache
from django.db.models import Prefetch as _Prefetch
from django.urls import reverse
from pythonpro.cohorts.models import Cohort as _Cohort, CohortStudent, LiveClass as _LiveClass, Webinar as _Webinar
__all__ = [
'ge... |
# encoding: utf-8
#
# Run snmp_temper.py as a pass-persist module for NetSNMP.
# See README.md for instructions.
#
# Copyright 2012-2014 Philipp Adelt <info@philipp.adelt.net>
#
# This code is licensed under the GNU public license (GPL). See LICENSE.md for details.
import os
import sys
import syslog
import threading
... |
from pathlib import Path
from qgis.PyQt import uic
from qgis.PyQt.QtWidgets import QAbstractItemView
from qgis.PyQt.QtWidgets import QDialog
from qgis.PyQt.QtWidgets import QPushButton
from qgis.PyQt.QtWidgets import QTableWidget
from qgis.PyQt.QtWidgets import QTableWidgetItem
from qgis.PyQt.QtWidgets import QVBoxLayo... |
#!/usr/bin/env python
import itertools as it
import sys
import progressbar as pb
from time import time, ctime
# The generator itself
def generator(string,minLen,maxLen,prevCount):
count = 0
bar = pb.ProgressBar(maxval = prevCount).start()
# This for loops from the min length to the max
for length in range(minLen,... |
"""
raven.transport.builtins
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import logging
import sys
import urllib2
from raven.utils import all
try:
# Google App Engine blacklists parts of the socket module, ... |
""" Cisco_IOS_XR_aaa_locald_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR aaa\-locald package configuration.
This YANG module augments the
Cisco\-IOS\-XR\-aaa\-lib\-cfg
module with configuration data.
Copyright (c) 2013\-2015 by Cisco Systems, Inc.
All rights reserved.
"""
import ... |
import datetime
from copy import copy
from syscore.objects import missing_order
from sysexecution.order_stacks.order_stack import orderStackData, missingOrder
from sysexecution.trade_qty import tradeQuantity
from sysexecution.orders.contract_orders import contractOrder
class contractOrderStackData(orderStackData):
... |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyrig... |
#!/usr/bin/env python
#
# Features.py
#
# This program 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; ... |
# Generated from java-escape by ANTLR 4.5
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO
def serializedATN():
with StringIO() as buf:
buf.write(u"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2")
buf.write(u"\27\u00a4\b\1\4\2\t\2\4\3\t\3\4... |
#
#
# bignum.py
#
# This file is copied from python-vcoinlib.
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
"""Bignum routines"""
from __future__ import absolute_import, division, print_function, unicode_literals
impor... |
# 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 agreed to in writing, ... |
import sys
import os
import logging
import numpy as np
from click.testing import CliRunner
import rasterio
from rasterio.rio.main import main_group
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
TEST_BBOX = [-11850000, 4804000, -11840000, 4808000]
def bbox(*args):
return ' '.join([str(x) for x in... |
#!/usr/bin/env python
# encoding: utf-8
from t import T
import requests,urllib2,json,urlparse
class P(T):
def __init__(self):
T.__init__(self)
def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''):
target_url = "http://"+ip+":"+str(port)+"/cacti.sql"
r... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... |
#!/usr/bin/env python
# coding: utf8
#
# Copyright 2016 hdd
#
# 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 applicabl... |
# -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... |
'''These are a collection of build variants.
'''
import logging, sys
logger = logging.getLogger('bygg.variant')
class Variant(object):
def __init__(self, name):
self.name = name
def configure(self, env):
pass
class DebugVariant(Variant):
def __init__(self, name='debug'):
sup... |
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Andrew Kerr. All rights reserved.
# Copyright (c) 2015 Tom Barron. All rights reserved.
# Copyright (c) 2015 Goutham Pacha Ravi. All rights reserved.
# All Rights Reserved.
#
# Lic... |
# Copyright (c) 2012 Intel
# Copyright (c) 2012 OpenStack, LLC.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LI... |
#!env python3
import ipdb
import sys
import petsc4py
petsc4py.init(sys.argv)
from petsc4py import PETSc
from mpi4py import MPI
import numpy as np
from phelper import *
eMesh = {1: [np.linspace(0, 1, 4) ],
2: [np.linspace(0, 0.5, 5, False), # False == Do no include endpoint in range
np.linspace(0... |
from runtests.mpi import MPITest
from nbodykit import setup_logging
from nbodykit.binned_statistic import BinnedStatistic
import pytest
import tempfile
import numpy.testing as testing
import numpy
import os
data_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'data')
setup_logging("debug")
@MPITest(... |
##################################################################################
# The MIT License - turboengine
#
# Copyright (c) Oct 2010 Luis C. Cruz <carlitos.kyo@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cyborg_identity', '0002_iscontactemailaddress_iscontactphonenumber_phonenumber'),
]
operations = [
migrations.RemoveField(
... |
import re
import time
import urllib2
import os
import sys
import datetime
import urllib
import simplejson
import calendar
import commands
import math
from datetime import datetime
def getMementos(uri):
uri = uri.replace(' ', '')
orginalExpression = re.compile( r"<http://[A-Za-z0-9.:=/%-_ ]*>; rel=\"original\"... |
from .Optimize import Optimize
from ..Function import *
class ContrastiveDivergence(Optimize):
def __init__(self, network, environment, **kwargs):
# Default parameters
settings = {**{
'batch_size': 1,
# step size
"learn_step": 0.01,
"learn_anneal"... |
import re
class ResponseRouter(object):
"""Handles the passing of control from a conversation to a client app's
routes.
For read requests and write requests, ResponseRouter maintains two lists of
rules, where each rule is a tuple is of the form(filename pattern, action).
When a request comes in, ... |
"""
homepage.py
A Flask Blueprint module for the homepage.
"""
from flask import Blueprint, render_template, current_app, g
from flask import request, make_response, redirect, flash, abort
from flask_babel import gettext
from meerkat_frontend import app, auth
from meerkat_frontend import common as c
from meerkat_front... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
###music.py
###Created by Joseph Rollinson, JTRollinson@gmail.com
###Last Modified: 12/07/11
###Requires: pyo
###Turns pyo into a note class that is very easy to run.
###Also contains functions to run pyo music server.
import pyo
class note(object):
'''creates a note that can be played'''
def __ini... |
#------------------------------------------------------------------------------
# File: xml_store.py
# Purpose: Store and Retrieve data from XML files
# Author: Jim Storch
# License: GPLv3 see LICENSE.TXT
#------------------------------------------------------------------------------
import... |
from yowsup.layers import YowLayer, YowLayerEvent, YowProtocolLayer
from .protocolentities import *
from yowsup.layers.protocol_acks.protocolentities import OutgoingAckProtocolEntity
class YowNotificationsProtocolLayer(YowProtocolLayer):
def __init__(self):
handleMap = {
"notification": (self.r... |
# http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
import logging
import numpy as num
import hashlib
import base64
from pyrocko import util, moment_tensor
from pyrocko.guts import Float, String, Timestamp, Unic... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from os.path import abspath, dirname, join, normpath
from setuptools import find_packages, setup
import sys
INSTALL_PYTHON_REQUIRES = []
# We are intending to keep up to date with the supported Django versions.
# For the official suppor... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def hide_environment_none(apps, schema_editor):
"""
Hide environments that are named none, since they're blacklisted and no longer can be created.
We should iterate over each environment row individua... |
# -*- coding: utf-8 -*-
#
# (c) Copyright 2001-2008 Hewlett-Packard Development Company, L.P.
#
# 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 opt... |
from contextlib import contextmanager
from functools import partial
import inspect
from itertools import chain, compress
import re
import shutil
from subprocess import check_call, CalledProcessError, DEVNULL
from types import MappingProxyType
from coalib.bears.LocalBear import LocalBear
from coalib.misc.ContextManager... |
"""Runs all tests."""
import os
import sys
import glob
import unittest
import pandas as pd
import time
def main():
"""Runs the tests."""
r = {"test": [], "time": []}
failurestrings = []
for test in glob.glob('test_*.py'):
s = time.time()
sys.stderr.write('\nRunning tests in {0}...\n'... |
##############################################################
# Date: 20/01/16
# Name: calc_multi_atm.py
# Author: Alek Petty
# Description: Main script to calculate sea ice topography from IB ATM data
# Input requirements: ATM data, PosAV data (for geolocation)
# Output: topography datasets
import matplotlib
matplo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.