src stringlengths 721 1.04M |
|---|
# Author: Jose G Perez
# Version 1.0
# Last Modified: January 31, 2018
import numpy as np
import pylab as plt
from skimage import color
from util_im import imshow_matches
from util_sm import load_sm, norm_sm, norm_prob_sm
from util_sift import precompute_sift, load_sift
precompute_sift('S_BB_V4', 'PW_BB_V4')
s_im, s_l... |
from lxml import objectify
import argparse
import eagle_lbr
import eagle_brd
#import helper
import sys
import lint_framework
#TODO: state contains a list of issues structured like that: $object_name(str), $object_type(component, symbol, package, library, schematic, board, etc.), $issue_type(E1, E2, E3, W1...)
pars... |
# Python Qt4 bindings for GUI objects
from PyQt4 import QtGui
# import the Qt4Agg FigureCanvas object, that binds Figure to
# Qt4Agg backend. It also inherits from QWidget
from matplotlib.backends.backend_qt4agg \
import FigureCanvasQTAgg as FigureCanvas
# Matplotlib Figure object
from matplotlib.figure import Figure
... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'AptOfflineQtAbout.ui'
#
# Created: Sun Nov 7 20:54:52 2010
# by: PyQt4 UI code generator 4.7.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_AboutAptOffline(object):
def setupUi... |
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
## \package pts.magic.pl... |
"""
proteintools.py
"""
import re
import string
from mhc.data import *
from mhc.biomart import *
from mhc.hmmer2 import *
from mungolite.fasta import FastaFile
class Protein:
"""
Container for protein data.
"""
def __init__(self, ensembl_protein_id=None, ensembl_transcript_id=None,
... |
import logging
import pandas as pd
import numpy as np
import pyprind
import six
from joblib import Parallel, delayed
import py_entitymatching.catalog.catalog_manager as cm
from py_entitymatching.blocker.blocker import Blocker
from py_entitymatching.utils.catalog_helper import log_info, get_name_for_key, add_key_colum... |
from __future__ import absolute_import, print_function, division
import copy
import numpy
import logging
import pdb
from six.moves import xrange
import theano
from theano import tensor, scalar, gof, config
from theano.compile import optdb
from theano.compile.ops import shape_i
from theano.gof import (local_optimizer, ... |
# -*- encoding: utf-8 -*-
import itertools
import random
import datetime
from collections import defaultdict
from flask import g
from sankarit import itemclasses, adventureclasses
from sankarit.models.item import Item
class Adventure(object):
@classmethod
def create(cls, adventureclass, heroes):
c =... |
# 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 ... |
# -*- coding: utf-8 -*-
u"""
see readme.md
"""
import os
import sys
import time
from naoqi import ALBroker
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')
from qibluemix import STTProxy, get_logger
from qibluemix.pepper import SpeechRecognitionMemory, StreamingAudioRecorder
from qibluemix.wats... |
#
# 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
# ... |
from collections import namedtuple
from datetime import date
from itertools import dropwhile, takewhile
from regparser.grammar.delays import tokenizer as delay_tokenizer
from regparser.grammar.delays import Delayed, EffectiveDate, Notice
class FRDelay(namedtuple('FRDelay', ['volume', 'page', 'delayed_until'])):
... |
import json
import urllib
from django.db.models import Q
from django.http import HttpResponse
from django.views.generic import ListView
#============================================================================
class BaseDataTablesDataSource(ListView):
"""This view serves a page with a pre-rendered data tabl... |
# Copyright 2017 DataCentred Ltd
#
# 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 ag... |
import logging
from subprocess import run, PIPE
from module import Module
from utils import break_lines, show_message
__author__ = 'Ion Agorria'
class Smart(Module):
name = "SMART"
def __init__(self, modules):
super().__init__(modules)
self.update_notified = []
def run(self):
""... |
from unittest import TestCase
from ensure import ensure
from path import path
from fuzzy.map import load_game_map
from fuzzy.rooms import Room
from fuzzy.exits import Exit
PATH = path(__file__).abspath().dirname()
class MapLoaderTests(TestCase):
def setUp(self):
self.filename = PATH / 'rooms.yaml'
... |
"""
Contains POST and GET web operations for
ArcREST Python Package.
"""
from __future__ import absolute_import
from __future__ import print_function
import io
import os
import re
import ssl
import sys
import json
import uuid
import zlib
from inspect import getargspec
import shutil
import tempfile
import mimetype... |
import unittest
import sic_assembler.assembler as assembler
import sic_assembler.instructions as instructions
from sic_assembler.assembler import Assembler, SourceLine
from sic_assembler.instructions import Format
from sic_assembler.instructions import Format1, Format2, Format3, Format4
import sic_assembler.records a... |
import time
import argparse
from urllib.parse import urljoin
from bs4 import BeautifulSoup
from crawler.page_request import PageRequest
from crawler.page_report import PageReport
from crawler.report_builder import ReportBuilder
class Crawler(object):
'''
The main crawler object that the user interacts with
... |
#!/usr/bin/python
from ansible.module_utils.basic import AnsibleModule
from ansible.errors import AnsibleError
try:
import luna
except ImportError:
raise AnsibleError("luna is not installed")
from luna_ansible.helpers import StreamStringLogger
import logging
if luna.__version__ != '1.2':
raise AnsibleEr... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import subprocess
import sys
import tempfile
import time
import ray
def _pid_alive(pid):
"""Check if the process with this PID is alive or not.
Args:
pid: The pid to check.
Re... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
# Configuration, please edit
# Data about this site
BLOG_AUTHOR = "Dje"
BLOG_TITLE = "Write it before forget it!"
# This is the main URL for your site. It will be used
# in a prominent link
SITE_URL = "http://wibfi.virtua-peanuts.net/"
# Thi... |
#-*- coding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.exceptions import Warning
from urlparse import urlparse
class database(models.Model):
_inherit = "infrastructure.database"
contract_id = fields.Many2one(
'account.analytic.account',
string='Contract',
doma... |
from scipy.linalg import eig, inv
from gensei.base import np, Object, pause
class Intersector(Object):
"""
Base class defining the intersector interface.
An intersector is a generalization of the concept of bounding box. Its
purpose is to quickly decide that two objects do not intersect. False
po... |
#!/usr/bin/env python
# coding: utf-8
"""
Twitter関連のユーティリティモジュール
"""
import re
import time
import calendar
import HTMLParser
# html special charsをアンエスケープするためのパーサ
parser = HTMLParser.HTMLParser()
def get_text_and_entities(tw):
"""
ツイートを渡すと,エンティティ除外文書とエンティティリストを返す
"""
if 'entities' in tw:
return... |
# 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 t... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2017-12-19 14:51
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('images', '0005_image_tags'... |
import sys
import getopt
import platform
import os
import traceback
import csversion
try:
import argparse
except:
pass
class Options:
help_text = """
Usage: {0} [OPTION]... [FOLDER LIST]
A digital comic media server.
The FOLDER_LIST is a list of folders that will be scanned recursively
for comics to a... |
# Start, stop, query, or configure TPV logging on a set of servers
# Example: wsadmin -username wsadmin -password wsadmin -lang jython -f tpvlogging.py -userprefs wsadmin -action start -server server1
def usage():
print "usage: wsadmin -lang jython -f tpvlogging.py -action [start|stop|list|setlevel] -userprefs USER [... |
# observation.py
#
# Copyright (C) 2016-2017
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it
# and/or modify it under the terms of the GNU General ... |
import math
import numpy as np
from beprof.profile import Profile
class LateralProfile(Profile):
def penumbra_right(self):
"""
In case of good data returns floating-point number
In case of corrupted data returns nan
"""
return self.x_at_y(0.1, True) - self.x_at_y(0.9, Tru... |
#!/usr/bin/env python
import sys
import math
import struct
import serial
import signal
import os
import time
import struct
SerialPath="/dev/ttyUSB0"
class SoilSensor():
def __init__(self, path):
self.path = path
self.__tty = serial.Serial(port=self.path,
baudrate=960... |
#------------------------------------------------------
# $Date: 2014-06-23 08:03:15 +0000 (21 Aug 2014) $
# $Revision: 1 $
# $Author: rikih.gunawan $
#------------------------------------------------------
#
# /var/lib/zabbix/scripts/discover-s... |
# -*- coding: utf-8 -*-
import base64
import re
import time
from pyload.plugin.internal.SimpleCrypter import SimpleCrypter
class DlProtectCom(SimpleCrypter):
__name = "DlProtectCom"
__type = "crypter"
__version = "0.03"
__pattern = r'https?://(?:www\.)?dl-protect\.com/((en|fr)/)?\w+'
__co... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import rsa
import base64
import math
import xml.etree.ElementTree as ET
# Utility functions
def bytes_to_int(byte_data):
return int.from_bytes(byte_data, 'big')
def bytes_from_int(integer):
byte_length = math.ceil(integer.bit_length() / 8)
return integer.to_bytes(byte_length, 'big')
class RSA():
d... |
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from tqdm import tqdm
import mmap
def whetherEmotion(word, threshold):
analyzer = SentimentIntensityAnalyzer()
sentiment_result = analyzer.polarity_scores(word)
if abs(sentiment_result['compound']) > threshold:
return True
ret... |
# Copyright 2016 Jamie Cressey
#
# 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... |
#
# Hessian protocol implementation
# This file contains simple RPC server code.
#
# Protocol specification can be found here:
# http://www.caucho.com/resin-3.0/protocols/hessian-1.0-spec.xtp
#
# Copyright 2006-2007 Petr Gladkikh (batyi at users sourceforge net)
#
# Licensed under the Apache License, Version 2.0 (the... |
#!/usr/bin/python
from muxlib.scapy import *
import sys
from twisted.internet import base, fdesc, reactor, protocol
import socket
import iptables
class ScapyLink(base.BasePort):
def __init__(self, interface=None, plusIPs=[]):
base.BasePort.__init__(self, reactor)
self.protocols = []
self.... |
import copy
import re
import sys
import tempfile
from test.support import ALWAYS_EQ
import unittest
from unittest.test.testmock.support import is_instance
from unittest import mock
from unittest.mock import (
call, DEFAULT, patch, sentinel,
MagicMock, Mock, NonCallableMock,
NonCallableMagicMock, AsyncMock,... |
# Sebastian Raschka 2014
#
# Aligns multiple mol2 files to a reference mol2 files and
# writes the aligned targets to the hard drive.
#
# USAGE from command shell command line:
# %> python3 multimol2_rmsd_align.py input_dir/ output_dir/ ref.mol2 smiles_string
import subprocess
import os
import sys
RMSD_TOOL = "/soft/... |
from django.conf.urls import url
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.forms import ModelForm
from django.http import HttpResponseRedirect
from livinglots import get_owner_contact_model
from .admin_views import MakeAliasesView
from .models import Alias
class Owner... |
"""
https://leetcode.com/problems/sum-of-even-numbers-after-queries/
https://leetcode.com/submissions/detail/215582833/
"""
from typing import List
class Solution:
def sumEvenAfterQueries(self, A: List[int], queries: List[List[int]]) -> List[int]:
ANS = []
ans = 0
for a in A:
... |
import pandas as pd
data = pd.read_csv("development_times_exp1and2.csv", sep="\t")
# Add all parameters (Taylor coefficients) as 0 in rows following the data:
for i in range(data.shape[0]):
for j in range(10, 42):
data.set_value(i, j, 0)
data.rename(columns={10: "a", 11: "a1", 12: "a2", 13: "... |
import unittest
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
from sklearn.metrics.pairwise import pairwise_distances
from graphs.construction import neighbors
def ngraph(*a, **k):
return neighbors.neighbor_graph(*a,**k).matrix('dense')
class TestNeighbo... |
import json
import sys
from pathlib import Path
from typing import List, Optional, Set, Tuple
from dtags import style
from dtags.commons import (
dtags_command,
get_argparser,
normalize_tags,
prompt_user,
reverse_map,
)
from dtags.files import get_new_config, load_config_file, save_config_file
USA... |
"""
Django settings for CryptoKnocker 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, .... |
#!/usr/bin/env python
# -*- coding:utf8 -*-
'''
#两种方法获取函数名称:
#1.通过系统函数
#2.通过inspect模块
获取当前文件名:
'''
import os
import sys
import inspect
from datetime import *
##############################1.
def a():
print sys._getframe().f_code.co_name
################################# 2. inspect模块
def get__function_name():
... |
from __future__ import absolute_import
from functools import wraps
from splash.exceptions import DOMError
from splash.jsutils import escape_js
from splash.casperjs_utils import (
VISIBLE_JS_FUNC,
ELEMENT_INFO_JS,
FIELD_VALUE_JS,
FORM_VALUES_JS,
SET_FIELD_VALUE_JS
)
DIMENSIONS_JS_FUNC = """
(funct... |
import inspect
import pkgutil
from spiderpig import msg
def register_submodule_command(subparsers, submodule, namespace=None):
if 'command_name' in dir(submodule):
command_name = submodule.command_name()
else:
command_name = submodule.__name__.split('.')[-1].replace('_', '-')
command_name ... |
import os
import sys
import time
from email.utils import parsedate
import config
from helpers import get_resource, get_hash, get_account_info, uid_exists
from dropbox import client
from workflow import Workflow, PasswordNotFound, ICON_TRASH
from workflow.background import run_in_background
def main(wf):
if wf.u... |
# - coding: utf-8 -*-
##############################################################################
#
# This program 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
# ... |
from builtins import str
import os
import re
import math
from string import Template
# from datetime import timedelta
from .mycluster import check_output
from .mycluster import get_timedelta
from .mycluster import get_data
from .mycluster import load_template
from jinja2 import Environment, FileSystemLoader
"""
sa... |
#-*- coding:utf-8 -*-
from django.db import models
class College(models.Model):
number = models.CharField(max_length=4)
name = models.CharField(max_length=50)
CHOICES_CAMPUS = (
('A', u'안암'),
('S', u'세종'),
('G', u'대학원'),
('E', u'기타'),
)
campus = models.CharField(ma... |
from nose.tools import eq_, ok_
from path import path
from pyavrutils import support, arduino
from pyavrutils.arduino import Arduino, ArduinoCompileError
import logging
root = path(__file__).parent.parent
examples = support.find_examples(root)
fails = [
('PWM.pde', 'atmega8'),
]
# def check_build(ex, hwpack, bo... |
#!/usr/bin/env python
# -*- Mode: Python; tab-width: 4 -*-
#
# Netfarm Mail Archiver - release 2
#
# Copyright (C) 2005-2007 Gianluigi Tiesi <sherpya@netfarm.it>
# Copyright (C) 2005-2007 NetFarm S.r.l. [http://www.netfarm.it]
#
# This program is free software; you can redistribute it and/or modify
# it under the term... |
import os.path
import json
import re
from urlparse import urlparse, urlunparse
import logging
from werkzeug.wsgi import get_current_url
from werkzeug.utils import redirect
_logger = logging.getLogger(__name__)
class BadMatchPattern(Exception):
pass
def build_url_regex(pattern):
regex = "^"
# Build ... |
#!/usr/bin/env python
import biplist
import os
import requests
import tempfile
import sys
import git
testflight_api_url = "http://testflightapp.com/api/builds.json"
def upload_app_to_testflight(archive_path, testflight_api_token, testflight_team_token, testflight_distro_lists=[], notify=True):
plist_path = "%s/... |
# coding=utf-8
# Copyright 2021 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 ... |
import unittest
from mozurestsdk import mozuclient;
from mozurestsdk.security.userauthenticator import UserAuthenticator;
from mozurestsdk import util;
class UserAuthenticator_Test(unittest.TestCase):
def setUp(self):
self.config = util.readConfigFile("c:\projects\mozuconfig.txt");
mozuclient.configure(config="c... |
"""
Module for storing static data structures
"""
import os
import sys
VERSION = 0.9999
PID = os.getpid()
S3SITE_CFG_DIR = os.path.join(os.path.expanduser('~'), '.s3site')
S3SITE_CFG_FILE = os.path.join(S3SITE_CFG_DIR, 'config')
S3SITE_LOG_DIR = os.path.join(S3SITE_CFG_DIR, 'logs')
S3SITE_META_FILE = '__s3site.cfg'
... |
from django.conf import settings
"""
Configuration options for the ``simple_email_verification`` package:
All options reside in a dictionary, ``SIMPLE_EMAIL_VERIFICATION`` within your project's ``settings.py``. The options
are as follows:
VERIFICATION_FORM_TEMPLATE Used for overriding the def... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostDiskPartitionBlockRange(vim, *args, **kwargs):
'''A BlockRange data object type d... |
from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.12"
class CMakeModuleCommonConan(ConanFile):
name = "cmake-module-common"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
url = "http://github.com/polysquare/cmake-module-co... |
from __future__ import absolute_import, print_function, unicode_literals
import os
"""
Deployment based configuration
When deploying topology specify a deployment to match with a settings key.
-o "'topology.deployment=\"local\"'"
Spouts / Bolts in the topolgoy will then pull the settings then need from this modu... |
#!/usr/bin/python
# Combat Simulator Project
# Copyright (C) 2002-2009 The Combat Simulator Project
# http://csp.sourceforge.net
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version... |
#!bin/evn python
# -*-coding:utf8-*-
import base64
import sys
import os
import logging
import datetime
import re
import multiprocessing
# from pylab import *
from PIL import Image
import cv2
from bceocrapi import BceOCRAPI
from bin.python.models.images import Images
from nude import Nude
import imagehash
from bin.py... |
import sys
def find_smallest_sub_matrix_size_with_equal_number_of_ones(grid):
for length in range(1, len(grid)):
previous_one_count = -1
success = True
for i in range(0, len(grid) + 1 - length):
for j in range(0, len(grid) + 1 - length):
one_count = 0
... |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: Mcl_Cmd_Banner_Tasking.py
def TaskingMain(namespace):
import mcl.imports
import mcl.target
import mcl.tasking
from mcl.object.Messa... |
#***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014-2016 Jeff Wurzbach
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 ... |
import hashlib
import json
import logging
import os
import re
import gzip
import warnings
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
import mimetypes
from collections import defaultdict
import boto3
import boto3.exceptions
from botocore.exceptions import ClientError
from... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/data/raid/raid_info.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impo... |
"""
Django settings for mobileinterest 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 mock
import pytest
import logging
import tryagain
import functools
class Namespace:
pass
def _return_true():
return True
def _raise_exception():
raise Exception()
def test_call_once():
assert tryagain.call(_return_true) is True
def test_call_twice():
assert tryagain.call(_return_tru... |
# -*- coding: utf-8 -*-
# -*- Channel BlogHorror -*-
# -*- Created for Alfa-addon -*-
# -*- By the Alfa Develop Group -*-
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
import os
import re
from bs4 import BeautifulSoup
from core import httptools
from core impor... |
from __future__ import division
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import wx
import traceback
import sys
import os
import time
from wx import glcanvas
import OpenGL
OpenGL.ERROR_CHECKING = False
from OpenGL.GL import *
from Cura.util import version
from Cura... |
"""Library used by other scripts under tools/ directory."""
# Author: Zhang Huangbin <zhb@iredmail.org>
import os
import sys
import logging
import web
debug = False
# Set True to print SQL queries.
web.config.debug = debug
os.environ['LC_ALL'] = 'C'
rootdir = os.path.abspath(os.path.dirname(__file__)) + '/../'
sy... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Badge.assignment_badge'
db.add_column(u'badger_badge', 'a... |
#!/usr/bin/python -u
# -*- coding: UTF-8 -*-
# napiprojekt.pl API is used with napiproject administration consent
import re
import os
import os.path
import sys
import dmnapim
def get_all(file, supplement):
rex = re.compile('.*\\.%s$' % file[-3:], re.I)
(dir, fname) = os.path.split(file)
for f in os.listdir(dir):... |
#!/usr/bin/env python
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE = 'sqlite3',
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
),
MIDDLEW... |
# -*- coding: utf-8 -*-
#
# This tool helps you to rebase package to the latest version
# Copyright (C) 2013-2014 Red Hat, 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
# he Free Software Foundation; either version 2 ... |
import collections
from weakref import proxy
class Link(object):
__slots__ = 'prev', 'next', 'key', '__weakref__'
class OrderedSet(collections.MutableSet):
'Set the remembers the order elements were added'
# Big-O running times for all methods are the same as for regular sets.
# The internal self.__ma... |
#! /usr/bin/env python
import rospy
import actionlib
from riptide_msgs.msg import Dvl, LinearCommand
from geometry_msgs.msg import Vector3
from darknet_ros_msgs.msg import BoundingBoxes
from stereo_msgs.msg import DisparityImage
from cv_bridge import CvBridge, CvBridgeError
import riptide_controllers.msg
import math
... |
from django.db.models import Q
from le_utils.constants import content_kinds
from kolibri.core.content.hooks import ContentRendererHook
from kolibri.core.content.models import ContentNode
# Start with an empty queryset, as we'll be using OR to add conditions
renderable_contentnodes_without_topics_q_filter = ContentNod... |
from direct.distributed.ClockDelta import *
from direct.showbase import DirectObject
from direct.directnotify import DirectNotifyGlobal
from direct.task import Task
import random
import TreasurePlannerAI
class RegenTreasurePlannerAI(TreasurePlannerAI.TreasurePlannerAI):
notify = DirectNotifyGlobal.directNotify.new... |
# Copyright 2020 kubeflow.org.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import sys
import six
from . import util
# TODO: Some verification of the config values
class Config(object)... |
# -*- coding: utf-8 -*-
import itertools
import numpy as np
import tensorflow as tf
from tensorpack.models import Conv2D, FixedUnPooling, MaxPooling, layer_register
from tensorpack.tfutils.argscope import argscope
from tensorpack.tfutils.scope_utils import under_name_scope
from tensorpack.tfutils.summary import add_m... |
# -*- coding: utf-8 -*-
#
# 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
#... |
# Copyright (c) 2013 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 writ... |
from geotrans import *
System=dict2obj(dict(\
#########################################
#SYSTEM PRIMARY PARAMETERS
#########################################
#//////////////////////////////
#DETECTOR
#//////////////////////////////
Ddet=0.5,#Aperture, m
qeff=1.0,#Quantum efficiency
#//////////////////////////////
#STAR... |
#!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] tags will be kept. ... |
# Copyright 2014 Rackspace, 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... |
# !/usr/bin/env python
''' YapDi Example - Demonstrate basic YapDi functionality.
Author - Kasun Herath <kasunh01@gmail.com>
USAGE - python basic.py start|stop|restart
python basic.py start would execute count() in daemon mode
if there is no instance already running.
count() prints a counting n... |
"""The Django url to handler mappings for mDS.
:Authors: Sana dev team
:Version: 2.0
"""
from django.conf import settings
from django.conf.urls.defaults import patterns, url, include
from django.views.generic.simple import redirect_to
from django.contrib import admin
#from piston.authentication import HttpBasicAuthe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.