src stringlengths 721 1.04M |
|---|
from django.contrib.auth.models import User
from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db.models.signals import pre_save, post_save, pre_delete, post_delete
from django.core.cache import cache
from django.dispatch i... |
#
# Copyright (C) 2006-2014 Wyplay, All Rights Reserved.
# This file is part of xintegtools.
#
# xintegtools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your optio... |
# coding=utf-8
from __future__ import absolute_import
"""
This module bundles commonly used utility methods or helper classes that are used in multiple places withing
OctoPrint's source code.
"""
from __future__ import absolute_import, division, print_function
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ =... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-10-03 14:17
from __future__ import unicode_literals
from django.db import migrations, models
import registers.models
class Migration(migrations.Migration):
dependencies = [
('registers', '0002_auto_20160919_1303'),
]
operations = [
... |
########
# Copyright (c) 2018 Cloudify Platform Ltd. 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... |
__author__ = 'rcj1492'
__created__ = '2016.12'
__license__ = 'MIT'
from labpack.events.meetup import *
if __name__ == '__main__':
# import dependencies & configs
from pprint import pprint
from time import time
from labpack.records.settings import load_settings
from labpack.handlers.reques... |
# 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 ... |
"""
Fetch Build IDs from ELF core
In --list mode, print two names for each file,
one from the file note, and the other from the link map.
The first file (the executable) is not in the link map.
The names can differ because of symbolic links.
"""
from argparse import ArgumentParser
from . import memmap
from .elf impor... |
# coding: utf8
from __future__ import unicode_literals
class AttributeDescription(object):
def __init__(self, text, value=None, *args, **kwargs):
self.name = None
self.text = text
self.value = value
def __call__(self, attr, model):
self.name = attr
def __get__(self, obj, ... |
import json
from corehq.apps.domain.decorators import cls_require_superuser_or_developer
from corehq.apps.domain.views import DomainViewMixin
from django.http import Http404
from dimagi.utils.web import json_response
from django.views.generic import TemplateView
from corehq.apps.case_search.models import case_search_e... |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 agree... |
#!/usr/bin/env vpython3
# Copyright 2020 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.
"""Integration test for branch.py"""
import json
import os
import subprocess
import tempfile
import textwrap
import unittest
INFRA_C... |
#!/usr/bin/env python
import random
import argparse
import sys
parser = argparse.ArgumentParser(description='Return random lines of file')
parser.add_argument('file', type=argparse.FileType('r'), help='the input file')
parser.add_argument('-n', '--num', type=int, help='number of lines to return')
parser.add_argument('... |
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... |
#!/usr/bin/env python
# ===============================================================================
# Copyright 2015 Geoscience Australia
#
# 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
... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import imp
import subprocess
## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill!
if 'check_output' not in dir(subprocess):
def check_output(cmd_args, *args, **kwargs):
proc = subprocess.Popen(
... |
# coding=utf-8
# Copyright 2018 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 t... |
# -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of mozaik_mandate, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# mozaik_mandate is free software:
# you can redistribute it and/or
# modify it u... |
"""Classes used for tracking game state.
The game state is defined as all the data which is being used by the game
itself. This excludes things like the package listing, the logging class, and
various other bits defined in the rpg.app.Game class.
"""
from enum import IntEnum, unique
from rpg.data import actor, resour... |
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2019 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
#
# Authors: Salim Fadhley <salimfadhley@gmail.com>
# Matteo Dell'Amico <matteodellamico@gmail.com>
"... |
from pymudclient.escape_parser import EscapeParser, InvalidInput, InvalidEscape
class TestEscapes(object):
def setUp(self):
self.eparser = EscapeParser()
tests = [('foo\n', #basic.
['foo']),
('\n',
['']),
('foo\\nbar\n', #multipl... |
# -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse_lazy
from django.views.generic import (ListView, DetailView, CreateView,
DeleteView, UpdateView)
from . import forms
from . import models
__all__ = (
'CategoryIndexView',
'CategoryDetailView',
'Category... |
# encoding: utf-8
import os
import subprocess
import mongoengine as db
try:
from itertools import izip as zip
except ImportError: # pragma: no cover
pass
class CPUDetail(db.EmbeddedDocument):
user = db.FloatField(db_field='u', verbose_name="Userspace Percentage")
nice = db.FloatField(db_field='n',... |
"""This module abstracts all vospace activities. Including a switch to using username/password pairs."""
from getpass import getpass
from requests.auth import HTTPBasicAuth
from vos.vos import Client, Connection
import sys
import types
import netrc
import logging
logging.getLogger('vos').setLevel(logging.ERROR)
VOSP... |
# Copyright 2017-2018 Capital One Services, 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 ... |
# -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. 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... |
import dilap.core.context as dgc
import dilap.generate.landscape as dls
import dilap.generate.lot as dlt
import dilap.primitive.road as dr
import dp_vector as dpv
import dp_quaternion as dpq
class street(dgc.context):
def generate(self,worn = 0):
start = dpv.vector(-100,-300, 20)
end = dpv.vect... |
#!/usr/bin/python
#Audio Tools, a module and set of tools for manipulating audio data
#Copyright (C) 2007-2012 Brian Langenberger
#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... |
#!/bin/python
# This script will parse and reformat all of the race and profession modifiers in the RoE files.
# Modules.
import argparse
import os
import pprint
import re
import sys
import time
# Set up command line arguments.
parser = argparse.ArgumentParser(description='This script will parse and reformat all of t... |
# Peerz - P2P python library using ZeroMQ sockets and gevent
# Copyright (C) 2014-2015 Steve Henderson
#
# 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... |
#!/usr/bin/env python
from distutils.core import setup
try:
with open('README.rst') as f:
long_description = f.read()
except IOError:
long_description = ''
setup(
name='rpqueue',
version=open('VERSION').read(),
description='Use Redis as a priority-enabled and time-based task queue.',
... |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
PFLog: OpenBSD PF packet filter logging.
"""
from kamene.packet import *
from kamene.fields import *
from kamene.lay... |
from pandac.PandaModules import *
from direct.distributed import DistributedObject
from direct.interval.ProjectileInterval import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from toontown.racing.DistributedVehicle import DistributedVehicle
from DroppedGag import *
class D... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Tests for CouncilAgenda object
from django.test import TestCase
import logging
from raw.docs import agenda
# We use fixtures which are raw HTML versions of the agendas to test the parser
# Each test case works with one source.
logging.disable(logging.CRITICAL)
class Agen... |
"""
Tests to make sure deepchem models can overfit on tiny datasets.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import os
import tempfile
im... |
import os, sys, re, json
import platform
import shutil
from datetime import datetime
from i18n import _
class NotEnoughFunds(Exception): pass
class InvalidPassword(Exception):
def __str__(self):
return _("Incorrect password")
class MyEncoder(json.JSONEncoder):
def default(self, obj):
from tra... |
# This file is part of audioread.
# Copyright 2011, Adrian Sampson.
#
# 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, co... |
import json
import os
import urllib
from datetime import datetime
from OIPA import settings
class PostmanAPIImport(object):
fields_to_remove = ["event", "response"]
file_path = os.environ.get(
'OIPA_STATIC_ROOT',
os.path.join(
os.path.dirname(settings.BASE_DIR),
'publi... |
#!/usr/bin/env python
"""The setup script to generate dist files for PyPi.
To upload the release to PyPi:
$ ./setup.py sdist bdist_wheel --universal
$ twine upload dist/*
"""
from setuptools import setup
from cppdep import cppdep
setup(
name="cppdep",
version=cppdep.VERSION,
maintainer="Olzhas R... |
# coding: utf-8
import logging
import MySQLdb
from warnings import filterwarnings
class DbConnector(object):
"""
Connect with mysql DB
"""
RECORDS_M_TABLE = 'records_minute'
RECORDS_H_TABLE = 'records_hour'
RECORDS_D_TABLE = 'records_day'
RECORDS_O_TABLE = 'records_month'
RECORDS_Y_TAB... |
#!/usr/bin/python
"""
Dialog for general graph appearance
This software was developed by Institut Laue-Langevin as part of
Distributed Data Analysis of Neutron Scattering Experiments (DANSE).
Copyright 2012 Institut Laue-Langevin
"""
import wx
from sas.sasgui.plottools.SimpleFont import SimpleFont
COLOR = ['black... |
import re
import logging
from json import loads, dumps
from xml.etree import ElementTree
from unittest import TestCase
import tornado.web
from tornado.testing import AsyncHTTPTestCase
from tapioca import TornadoRESTful, ResourceHandler, \
ResourceDoesNotExist, JsonEncoder, JsonpEncoder, HtmlEncoder
from test... |
# this file is part of SDB.
#
# SDB 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.
#
# SDB is distributed in the hope that it will be ... |
#pylint: disable=too-many-arguments
def inject_value(
input_data,
output_data,
from_path,
to_path,
filter_function,
from_index=0,
to_index=0
):
"""
injects parts of output_data into input_data
based on from_path and to_path
"""
if from_index < len(from_path):
ne... |
import threading
import Queue
import traceback
from functools import wraps
class Worker(threading.Thread):
stopevent = False
def __init__(self, *args, **kw):
threading.Thread.__init__(self, *args, **kw)
self.q = Queue.Queue()
self.start()
def run(self):
o = self.q.get()
while not self.stopevent:
fct, ... |
#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... |
# -*- coding: utf-8 -*-
# This file is based upon the file generated by sphinx-quickstart. However,
# where sphinx-quickstart hardcodes values in this file that you input, this
# file has been changed to pull from your module's metadata module.
#
# This file is execfile()d with the current directory set to its contain... |
# Copyright 2012 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... |
import os
import io
import sys
import dill
import copy
from datetime import datetime
from .evaluator import Evaluator
from .utils import (
post_to_platform,
get_current_notebook,
strip_output,
get_current_notebook,
mkdir_p,
)
class DataScienceFramework(object):
def __init__(
self,
... |
import pytest
from pandas._libs.tslibs import frequencies as libfrequencies, resolution
from pandas._libs.tslibs.frequencies import (
FreqGroup, _period_code_map, get_freq, get_freq_code)
import pandas.compat as compat
import pandas.tseries.offsets as offsets
@pytest.fixture(params=list(compat.iteritems(_period... |
# -*- coding: utf-8 -*-
#
# blueberry documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 23 00:00:07 2016.
#
# 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.
#
#... |
# Maildir folder support
# Copyright (C) 2002 - 2007 John Goerzen
# <jgoerzen@complete.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 2 of the License, or
# (a... |
# -*- coding: utf-8 -*-
#########################################################################
## Customize your APP title, subtitle and menus here
#########################################################################
response.title = request.application
response.subtitle = T('UPnP ControlPoint')
###########... |
import io
import unittest
import steel
class IOTest(unittest.TestCase):
data = b'\x2a\x42'
def setUp(self):
self.input = io.BytesIO(b'\x2a\x42')
self.output = io.BytesIO()
def test_read(self):
field = steel.Field(size=2)
data = field.read(self.input)
... |
from .Action import Action
from .Settings import getSettings
from .SwitchProfileAction import createSwitchProfileAction
class UpdateProfileAction(Action):
def __init__(self, settings, switchProfileAction):
Action.__init__(self)
self.settings = settings
self.switchProfileAction = switchProf... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
inkscapeSymbolGenerator: A inkscape symbol library generator
Copyright (C) 2015 Xavi Julián Olmos
See the file LICENSE for copying permission.
"""
import sys, os
import logging
from optparse import OptionParser
####Objetivo
#If select all merge all files... |
#!/usr/bin/env python
# ----------------------------------------------------------------------- #
# Copyright 2008-2010, Gregor von Laszewski #
# Copyright 2010-2013, Indiana University #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); ... |
# Basic vector maths class
import math
class V(object):
def __init__(self, x=0, y=0):
self.x = float(x)
self.y = float(y)
def __unicode__(self):
return "(%s, %s)" % (self.x, self.y)
__repr__ = __unicode__
@classmethod
def from_tuple(cls, coordinates):
x, y = coord... |
class BagOfWords(object):
"""
Implementing a bag of words, words corresponding with their frequency of usages in a "document"
for usage by the Document class, DocumentClass class and the Pool class.
"""
def __init__(self):
self.__number_of_words = 0
self.__bag_of_words = {}
de... |
"""Description of data model.
Reference: https://en.wikipedia.org/wiki/Data_modeling
"""
from __future__ import annotations
import copy
import datetime
import gettext
import typing
import uuid
from nion.swift.model import Schema
_ = gettext.gettext
# TODO: description of physical schema
# TODO: created and modifi... |
'''
Created on 8 mai 2014
@author: Francois Belletti
'''
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from surrogate.Markov_model import Markov_model
from HMM_algos import Proba_computer
initial = [0.1, 0.1, 0.1]
A = [[0.3, 0.5, 0.3], [0.3, 0.3, 0.5], [0.5, 0.3, 0.3]]
alphabet = ... |
from __future__ import print_function
import os, sys
# we assume (and assert) that this script is running from the virus directory, i.e. inside H7N9 or zika
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
import base.process
from base.process import process
import argparse
import numpy as np
from deng... |
# Copyright 2014-2020 Scalyr 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 writin... |
"""
This script is used to benchmark neural network performance to determine which optimisations are useful.
"""
from neural_network import *
from data import *
from neural_network import get_index_of_maximum_value
import time
def print_intro():
print "Benchmarking neural network implementation"
def get_neural_n... |
import os, re
from config import PCIConfigSpace, PCIConfigSpaceAccess
class PCIDeviceAddress:
def __init__(self, domain=None, bus=None, device=None, func=None):
self.domain = domain
self.bus = bus
self.device = device
self.func = func
def __str__(self):
return "%04x:%02... |
"""Provides moderation commands for Dozer."""
import asyncio
import datetime
import logging
import re
import time
import typing
from logging import getLogger
from typing import Union
import discord
from discord import Forbidden
from discord.ext.commands import BadArgument, has_permissions, RoleConverter, guild_only
f... |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import sys
from more_itertools import grouper
from phash import cross_correlation, image_digest
def main():
parser = argparse.ArgumentParser()
parser.add_argument('files', metava... |
#!/usr/bin/env python
import json
import logging
import os
import re
import sys
"""Helper functions which can recursively traverse or visit couchbase
REST / management data, driven by metadata. Users can change
behavior by passing in different visitor callback functions."""
def visit_dict(root, parents, data... |
import collections
import functools
import sys
from numba.core import utils
from numba.core.ir import Loc
from numba.core.errors import UnsupportedError
# List of bytecodes creating a new block in the control flow graph
# (in addition to explicit jump labels).
NEW_BLOCKERS = frozenset(['SETUP_LOOP', 'FOR_ITER', 'SETU... |
#! /usr/bin/python
# Run this to generate Makefile, then run 'make'
EXAMPLES = {
'minimum' : {'minimum'},
'copy' : {'copy'},
'loop' : {'loop', 'example_common'},
'xorshift' : {'xorshift', 'example_common'},
}
EXAMPLE_OBJS = ['example_common', 'copy', 'loop',
'minimum', 'xorshift']
OUTPU... |
import multiprocessing
import tensorflow as tf
from tensorflow.contrib.data import Dataset
# from TensorFlow 1.4
import collections
import threading
from tensorflow.python.ops import script_ops
from tensorflow.python.util import nest
from tensorflow.python.framework import tensor_shape
# from TensorFlow 1.4
class _G... |
# -*- coding: utf-8 -*-
import os
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
from sklearn import datasets
from sklearn.svm import l1_min_c
iris = datasets.load_i... |
import heapq
class Solution:
def trapRainWater(self, heightMap: List[List[int]]) -> int:
m = len(heightMap)
if m == 0:
return 0
n = len(heightMap[0])
if n == 0:
return 0
visited = [[False]*n for _ in range(m)]
pq = []
for i in range(m):... |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 02 12:36:55 2016
@author: DIP
"""
from sklearn import metrics
import numpy as np
import pandas as pd
from collections import Counter
actual_labels = ['spam', 'ham', 'spam', 'spam', 'spam',
'ham', 'ham', 'spam', 'ham', 'spam',
'spam', 'ham',... |
import datetime
import ssl
import warnings
from requests.adapters import HTTPAdapter
try:
from requests.packages import urllib3
from requests.packages.urllib3.util import ssl_
from requests.packages.urllib3.exceptions import (
SystemTimeWarning,
SecurityWarning,
)
from requests.pac... |
# */
# * 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... |
"""
Useful pickle-type stuff
@license: GPL-3+
@author: Paul Tagliamonte <paultag@gmail.com>
@date: August 6th, 2011, 01:50 -0000
Uses a JsonBfile to store package info
"""
import Syn.Log as l
import Syn.JsonBfile as flatfile
import Syn.Policy.PackageRegistry as R
import Syn.Policy.Universal as U
fro... |
#!/usr/bin/env python3
"""
script -- A widget displaying output of a script that lets you interact with it.
"""
import gi.repository, subprocess, sys
gi.require_version('Budgie', '1.0')
gi.require_version('Wnck', '3.0')
from gi.repository import Budgie, GObject, Wnck, Gtk, Gio, GLib
class ScriptPlugin(GObject.GObje... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
e-Science database model
@author: e-science Dev-team
"""
import logging
import datetime
import binascii
import os
from django.db import models
from djorm_pgarray.fields import IntegerArrayField, TextArrayField
from django.utils import timezone
from dj... |
# -*- coding: utf-8 -*-
import sys
import os
import os.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib"))
import _ast
import pep8
import pyflakes.checker as pyflakes
pyflakes.messages.Message.__str__ = (
lambda self: self.message % self.message_args
)
class PyflakesLoc:
""" Error lo... |
#!/usr/bin/python
import sys
import re
line = sys.stdin.readline()
while(line != ""):
line = re.sub(r' {', r':', line)
line = re.sub(r'}\s*', r'', line)
line = re.sub(r'->', r'.', line)
line = re.sub(r'sub', r'def', line)
line = re.sub(r'elsif', r'elif', line)
line = re.sub(r'\$(\d)', r'reS.mat... |
'''
Main entry point for our text summarization using our baseline algorithm.
The baseline algorithm consists of assigning a weight to each sentence.
We define the weight of the
Copyright, 2015.
Authors:
Luis Perez (luis.perez.live@gmail.com)
Kevin Eskici (keskici@college.harvard.edu)
'''
from . import utils
import... |
#!/usr/bin/env python
import argparse, subprocess, json, os, sys, base64, binascii, time, hashlib, re, copy, textwrap, logging
try:
from urllib.request import urlopen # Python 3
except ImportError:
from urllib2 import urlopen # Python 2
#DEFAULT_CA = "https://acme-staging.api.letsencrypt.org"
DEFAULT_CA = "htt... |
import func
from var import var
import sys
import pf
class NodeBranchPart(object):
def __init__(self):
self.rMatrixNum = -1
self.gdasrvNum = -1
#self.bigP = None
class NodeBranch(object):
def __init__(self):
self.len = 0.1
# self.textDrawSymbol = '-' # See var.mode... |
#!/bin/env python
# UrbanFootprint v1.5
# Copyright (C) 2017 Calthorpe Analytics
#
# This file is part of UrbanFootprint version 1.5
#
# UrbanFootprint is distributed under the terms of the GNU General
# Public License version 3, as published by the Free Software Foundation. This
# code is distributed WITHOUT ANY WARR... |
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE
VARCHAR2 = VARCHAR
class AShareStockRating(BaseModel):
"""
4.75 中国A股投资评级明细
Attributes
----------
object_id: VARCHAR2(100)
对象ID
s_info_windcode: VARCHAR2(40)
Wind代码 ... |
# -*- coding: utf-8 -*-
# Copyright 2017 Interstellar Technologies Inc. All Rights Reserved.
from __future__ import print_function
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
from OpenGoddard.optimize import Problem, Guess, Condition, Dynamics
class Rocket:
# Atmosphere Param... |
import urllib
import urllib2
import json
import pdb
import sys
import time
import csv
import tokens
from models import *
class GithubListener:
def get_all_repos(self,org):
url = "https://api.github.com/orgs/" + org + "/repos?client_id=" + tokens.GITHUB_ID + "&client_secret=" + tokens.GITHUB_SECRET ... |
import asyncio
import tempfile
import unittest
from electrum import constants
from electrum.simple_config import SimpleConfig
from electrum import blockchain
from electrum.interface import Interface
class MockTaskGroup:
async def spawn(self, x): return
class MockNetwork:
main_taskgroup = MockTaskGroup()
... |
'''
Created on Aug 27, 2014
@author: Max Zwiessele
'''
import numpy as np
class _Norm(object):
def __init__(self):
pass
def scale_by(self, Y):
"""
Use data matrix Y as normalization space to work in.
"""
raise NotImplementedError
def normalize(self, Y):
"... |
# The MIT License (MIT)
#
# Copyright (c) 2016 invisiblearts
#
# 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, mod... |
#!/usr/bin/python3
"""
Главный файл для запуска
Решение шифрограмм из книги "Дневник Гравити Фоллз 3"
"""
import atbash_chiper, caesar_cipher, vigenere_cipher
print('='*80)
print('Зашифровано шифром Цезаря, см. коментарии к строкам выше (место в книге)')
print('='*80)
for line in open('caesar.txt'):
if line[0] ==... |
#!/usr/bin/env python
#Copyright (C) 2012 Niklas Thorne.
#This file is part of XMPPMote.
#
#XMPPMote 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 ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from vocabularies import createSubjectsVocab
from vocabularies import createThemesVocab
from vocabularies import createFormatsVocab
from vocabularies import createDataTypesVocab
from utility import stringToTags
from utility import loadArray
from ut... |
" analytical test problem to validate 2D and 3D solvers "
import math
from dolfin import *
from nanopores import *
from nanopores.physics.simplepnps import *
# --- define parameters ---
bV = -0.05 # [V]
rho = -0.025 # [C/m**2]
initialh = .1
Nmax = 1e4
# --- create 2D geometry ---
Rz = 2. # [nm] length in z direction ... |
# -*- coding: utf-8 -*-
"""
Adapt QKan-Layers to QKan-Standard
==============
Für ein bestehendes Projekt werden alle oder ausgewählte Layer auf den QKan-Standard
(zurück-) gesetzt. Dabei können optional der Layerstil, die Werteanbindungen, die
Formularverknüpfung sowie die Datenbankanbindung bearbeitet we... |
# -*- coding: utf-8 -*-
from bda.plone.cart import get_object_by_uid
from bda.plone.orders import message_factory as _
from bda.plone.orders.common import acquire_vendor_or_shop_root
from bda.plone.orders.common import calculate_order_salaried
from bda.plone.orders.common import calculate_order_state
from bda.plone.ord... |
import sys
if sys.version_info < (3, 7):
from ._zsrc import ZsrcValidator
from ._zmin import ZminValidator
from ._zmid import ZmidValidator
from ._zmax import ZmaxValidator
from ._zauto import ZautoValidator
from ._z import ZValidator
from ._visible import VisibleValidator
from ._uirevi... |
branding = {
"toolsName" : "Citrix XenServer Tools",
"installerProductName" : "Citrix XenServer Tools Installer",
"manufacturer" : "Citrix",
"installerKeyWords" : "Citrix XenServer Windows Installer",
"shortTools" : "XenTools",
"installerServiceName" : "Citrix Xen... |
from __future__ import absolute_import
import os
import sys
####
# Change per project
####
from django.urls import reverse_lazy
from django.utils.text import slugify
PROJECT_NAME = 'unpp_api'
# project root and add "apps" to the path
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.