src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8
from woo import utils,pack,export,qt
import gts,os,random,itertools
from numpy import *
import woo.log
#woo.log.setLevel('NewtonIntegrator',woo.log.TRACE)
# Parameters
tc=0.001# collision time
en=.3 # normal restitution coefficient
es=.3 # tangential restitution coefficient
frictionAngle=radi... |
from libvmcli import *
class Guest:
def __init__(self, all_opt, global_cluster_options, cluster_options):
self.global_cluster_options = global_cluster_options
self.cluster_options = cluster_options
self.all_opt = all_opt
self.opt = self.parse_opt(all_opt)
self.host_name = No... |
# -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2016 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More 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 Foundat... |
import pyparsing
literals = lambda literallist: pyparsing.Or([pyparsing.Literal(literal) for literal in literallist])
times = literals(['breve', 'breves', 'semibreve','semibreves', 'minim', 'minims', 'crotchets', 'crotchet', 'quavers', 'quaver', 'semiquaver','semiquavers', 'demisemiquaver', 'demisemiquavers'])
augment... |
"""Mission Pinball Framework (mpf) setup.py."""
import re
from setuptools import setup
# http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
VERSIONFILE = "mpf/_version.py"
VERSION_STRING_LONG = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
_MO = r... |
#-*- coding: utf-8 -*-
import module
from module import use_module
import fields
class COSensor(module.Base):
update_rate = 1000
public_name = 'Capteur CO'
alarm = use_module('Alarm')
class co(fields.sensor.CO,
fields.syntax.Numeric,
fields.io.Graphable,
fields.pe... |
import datetime
import logging
logger = logging.getLogger(__name__)
import ckan
import ckan.model as model
from ckan.logic.action.create import package_create as _package_create, user_create, group_create
from ckan.logic.action.update import package_update as _package_update, resource_update
from ckan.logic.action.upd... |
import sys
from datetime import date, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
from django.utils import unittest... |
# -*- coding: utf-8 -*-
import time
import os
# local imports
import settings
import submission
import LikedSavedDatabase
from utils import logger, utilities
from downloaders import imageSaver
from downloaders import redditScraper
from downloaders import tumblrScraper
from downloaders import pinterestScraper
from dow... |
import os
import tempfile
import unittest
from autobump.handlers import java_ast
from autobump.handlers import java_native
class TestJavaHandlerBase(unittest.TestCase):
"""Used to set up a simple Java codebase in a temporary
location.
Does not contain any actual tests. Test cases
are meant to inheri... |
from ironplot_windows import *
import clr
import System
import System.Windows.Controls
from System.Windows.Controls import *
clr.AddReferenceByPartialName("System.Windows.Forms.DataVisualization")
clr.AddReferenceByPartialName("System.Drawing")
clr.AddReferenceToFile("IronPlot.dll")
import System.Windows.Forms... |
# -*- coding: utf-8 -*-
from tkinter.ttk import Separator
from tkinter import messagebox as msg
from thermocepstrum_gui.utils.custom_widgets import *
from thermocepstrum_gui.assets import LANGUAGES
class OtherVariables(Frame):
def __init__(self, parent, main):
Frame.__init__(self, parent)
self.... |
from datetime import datetime
import json
import logging
import os
from os.path import join
from random import randint
from subprocess import check_output
# pylint: disable-msg=import-error
from unittest2 import TestCase
from buildercore.command import settings
from buildercore import config, project
from buildercore i... |
# blaplay, Copyright (C) 2012-2013 Niklas Koep
# 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 option) any later version.
# This program is dist... |
# Copyright (c) [2021] Alessio Russo [alessior@kth.se]. All rights reserved.
# This file is part of PythonVRFT.
# PythonVRFT is free software: you can redistribute it and/or modify
# it under the terms of the MIT License. You should have received a copy of
# the MIT License along with PythonVRFT.
# If not, see <https:/... |
#!/usr/bin/env python
from __future__ import with_statement
import os
from setuptools import setup, find_packages
import simiki
entry_points = {
"console_scripts": [
"simiki = simiki.cli:main",
]
}
with open("requirements.txt") as f:
requires = [l for l in f.read().splitlines() if l]
readme = "R... |
import functools
import random
import string
import unittest
from timeit import Timer
from task3.task3_resolve import get_unique_offers
class MyTestCase(unittest.TestCase):
def test_something(self):
fid_1 = {"offers": [{"offer_id": "offer1", "market_sku": 10846332, "price": 1490},
... |
from . import fasta
class SeqRecords:
"""Object representing an ordered collection of sequence records.
Attributes:
id_list (list) : List of sequence record identifiers
seq_list (list) : List of sequence strings
count (int) : Number of sequence records
"""
def __init__(... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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 copyright notice, this
# ... |
from sklearn.ensemble import RandomForestClassifier
from sklearn.decomposition import PCA
from sklearn.externals import joblib
from time import time
import numpy as np
import os.path
import random
import cv2
import os
TRAIN_DATA_PATH = 'auto_data/temp/train'
TEST_DATA_PATH = 'auto_data/temp/test'
class_name = {'cat':... |
# Xlib.keysymdef -- X keysym defs
#
# Copyright (C) 2001 Peter Liljenberg <petli@ctrl-c.liu.se>
#
# 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
... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Tue Jul 2 13:23:21 2013
# by: The Resource Compiler for PyQt (Qt v4.8.3)
#
# WARNING! All changes made in this file will be lost!
# this line manually edited
from enaml.qt import QtCore
qt_resource_data = "\
\x00\x00\x02\x61\
\x89\
\x50\x4e\x47\x0d\x0a... |
# -*- coding: utf-8 -*-
#
# TGiT, Music Tagger for Professionals
# Copyright (C) 2013 Iconoclaste Musique Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License... |
"""
Parse DAT files blocks and traverse block chains.
"""
from binascii import hexlify
from struct import unpack_from
from DAT.Header import Header
class Block:
"""
A block making up a chunk of a Directory in a DAT file.
"""
def __init__(self, filename=None, offset=None, size=None, next_block_offse... |
"""
Test collection used only for testing purpose
"""
from booby import fields
from ot_api.base import OpentopicModel
from .parsers import test_parser
def _generate_test_object(i):
"""
:return: dist with test object
"""
return {
'id': i,
'name': 'test_name{0}'.format(str(i))
}
d... |
import random
from collections import defaultdict
"""
这里设计python数据结构基本操作的(时间复杂度)[http://www.orangecube.net/python-time-complexity#comment-1018],
以上可以看到,List中append, pop方法平均时间复杂度为O(1),而remove时间复杂度为O(n),那么这里重点在remove方法的写法。为了达到O(1),即无需遍历得到要删除val的位置,并只用pop方法达到O(1)的删除速度。只好空间换时间的方法。需要借助dict,set标记每个插入元素的位置,在删除时从字典中获取对应元素的位置,... |
import pytest
from djamo.base import Client
from djamo import Collection, Document
from djamo.serializers import *
class Car(Document):
fields = {
"model": String(min_length=3, max_length=15, required=True),
"cost": Float(min_value=7.0, max_value=40000.50),
"owners": List(),
"acc"... |
from sfepy.base.testing import TestCommon, assert_, debug
class Test(TestCommon):
@staticmethod
def from_conf(conf, options):
return Test(conf=conf, options=options)
def test_tensors(self):
import numpy as nm
from sfepy.mechanics.matcoefs import ElasticConstants
ok = True... |
## @file
## @brief schedule implementation
import ConfigParser
import Queue
import logging
import threading
import uuid
from multiprocessing import Pool
from time import sleep, time
from pubsub import pub
## @class Schedule
## @brief Schedule for periodic task
## @details Allow creation start periodic tasks
## @warn... |
# -*- coding: utf-8 -*-
'''
Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis on Heroku
- Use sentry for error logging
'''
from __future__ import absolute_import, unicode_literals
from boto.s3.connection import Ordinar... |
import re
from lxml import etree, isoschematron
import django.utils.copycompat as copy
from django.core.exceptions import ValidationError
from django.utils.encoding import force_unicode
from .descriptors import ImmutableFieldBase, XPathFieldBase, XsltFieldBase
from .exceptions import XmlSchemaValidationError
from .... |
import intern
from intern.remote.dvid import DVIDRemote
from intern.resource.dvid.resource import DataInstanceResource
from intern.resource.dvid.resource import RepositoryResource
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
########### NOTE ###########
# This test requires an accessible DV... |
# Generated by Django 3.0.2 on 2020-02-21 10:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.CreateMode... |
#!/usr/bin/env python
#
# cppcheck addon for naming conventions
#
# Example usage (variable name must start with lowercase, function name must start with uppercase):
# $ cppcheck --dump path-to-src/
# $ python addons/naming.py --var='[a-z].*' --function='[A-Z].*' path-to-src/*.dump
#
import cppcheckdata
import sys
imp... |
"""Tests for certificates views. """
import json
import ddt
from uuid import uuid4
from nose.plugins.attrib import attr
from mock import patch
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client impo... |
#!/usr/bin/env python3
"""
Script to analyze the Jira Build Baron Queue
"""
import argparse
import binascii
import datetime
import dateutil
import dateutil.relativedelta
import hashlib
import json
import os
import pprint
import re
import requests
import stat
import sys
if __name__ == "__main__" and __package__ is None... |
from ...address_translator import AT
from .. import register_backend
from ..elf import ELF
from ...patched_stream import PatchedStream
ELF_HEADER = bytes.fromhex("7f454c46010101000000000000000000")
CGC_HEADER = bytes.fromhex("7f43474301010143014d6572696e6f00")
class CGC(ELF):
"""
Backend to support the CGC e... |
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib.admin import autodiscover as django_autodiscover
from django.utils.translation import ugettext_lazy as _
import contentstore.views
import openedx.core.djangoapps.common_views.xblock... |
# Copyright (c) 2013 NTT DOCOMO, INC.
# Copyright 2014 IBM Corporation.
# 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/licen... |
import unittest
from wpull.item import LinkType
from wpull.scraper.util import clean_link_soup, parse_refresh, is_likely_link, \
is_unlikely_link, identify_link_type
class TestUtil(unittest.TestCase):
def test_clean_link_soup(self):
self.assertEqual(
'http://example.com',
clea... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import sys
if not (sys.version_info.major == 3 and sys.version_info.minor > 5):
print("Python version %s.%s not supported version 3.6 or above required - exiting" % (sys.version_info.major,sys.version_info.minor))
sys.exit(1)
import os
import argparse
for path in ... |
from collections import defaultdict
import pandas as pd
from prophet.portfolio import Portfolio
from prophet.exceptions import ProphetException
from six import iteritems
class BackTest(pd.Series):
""" Timeseries data representing portfolio value over the backtest period.
Note:
Subclasses :class:`pd.... |
#!/usr/bin/python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requir... |
#!/usr/bin/env python
# coding: utf-8
from os import path
from distutils.core import setup
PROJECT_DIR = path.dirname(__file__)
extension = [
('/usr/share/nautilus-python/extensions',
[path.join(PROJECT_DIR, 'extension', 'nautilus-archive.py')]),
('/usr/share/icons/hicolor/48x48/emblems',
[path.joi... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, json
from frappe.website.doctype.website_settings.website_settings import get_website_settings
from frappe.website.router import get_page_context
from frappe.m... |
#!/usr/bin/env python
import unittest
# Be able to find service python file
import sys, os
sys.path.insert(0, "{srcdir}/../src/scripts".format(**os.environ))
import generate_globalfs_locations as ggl
from lofar.parameterset import PyParameterSet
class ReplaceHost(unittest.TestCase):
def test_replace(self):
#... |
# -*- coding: utf-8 -*-
# Copyright 2013-2014 Victor Amin, http://vamin.net/
"""MESS.DB utilities module
This module contains helper functions and classes that are used by many mess
modules.
"""
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import hashlib
import json
... |
import matplotlib.pyplot as plt
import numpy as np
import sys
sys.path.append('../../')
import pyterpol
import time
# create the grid - custom does nothing
sygri = pyterpol.SyntheticGrid('POLLUX', debug=True)
# interpolate at
keys_0 = ['Z', 'LOGG', 'TEFF']
values = [[1.0, 4.0, 12000],[1.0, 4.0, 12200],[1.0, 3.8, 1220... |
""" Module to hold classes for various test statistics that can be used
for fitting.
.. note:: All forms of chi-squared are as defined in:
* S. Baker & R. D. Cousins, Nucl. Inst. and Meth. in Phys. Res. 211,
437-442 (1984)
"""
import numpy
import abc
class TestStatistic(object):
""" Base class for the cal... |
#!python3
def hidden_digits(in_str):
'''(string) -> string
Finds all visible and hidden digits in the in_str string
and return them out in order of their appearance as one string.
>>> hidden_digits('abcdefghik')
'012345678'
>>> hidden_digits('Xa,}A#5N}{xOBwYBHIlH,#W')
'05'
>... |
"""Monitor the latest model checkpoint and compute embedding stores.
This library is a helper method for the loop to monitor checkpoints
when they get available. Once a new checkpoint appears, it gets copied over
to a temporary directory, then the embeddings are computed for the theorem
database. Finally, the checkpoi... |
# 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... |
#!/usr/bin/python
#
# Copyright 2017 Google 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 a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is a part of EM Media Handler
# Copyright (c) 2014-2021 Erin Morelli
#
# 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 rest... |
# coding: utf-8
""" Create and submit a job to the cluster given a streams config file. """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
import logging
from subprocess import Popen, PIPE
import cStringIO as StringIO
import yaml
# Cr... |
from eve.auth import requires_auth
from flask import Blueprint, request, render_template, Response, make_response
from flask_weasyprint import HTML, render_pdf
from pydash import identity
from ereuse_devicehub.exceptions import WrongQueryParam
from ereuse_devicehub.header_cache import header_cache
from ereuse_devicehu... |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
#coding=utf-8
import sys, re
from handlers import *
from util import *
from rules import *
class Parser:
"""语法分析器读取文本文件、应用规则并且控制处理程序"""
def __init__(self, handler):
self.handler = handler
self.rules = []
self.filters = []
def addRule(self, rule):
self.rules.append(rule)
... |
# -*- coding: utf-8 -*-
"""Model unit tests."""
import datetime as dt
import pytest
from rymate_blog.user.models import User, Role
from .factories import UserFactory
@pytest.mark.usefixtures('db')
class TestUser:
def test_get_by_id(self):
user = User('foo', 'foo@bar.com')
user.save()
re... |
#!/usr/bin/python
#
# Script to upload an OpenStack release to Launchpad
#
# Copyright 2011-2013 Thierry Carrez <thierry@openstack.org>
# 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
# ... |
# -*- coding: UTF-8 -*-
# Build customizations
# Change this file instead of sconstruct or manifest files, whenever possible.
# Full getext (please don't change)
_ = lambda x : x
# Add-on information variables
addon_info = {
# for previously unpublished addons, please follow the community guidelines at:
... |
#!/usr/bin/env python
# coding=utf-8
# Stan 2013-04-24
from __future__ import ( division, absolute_import,
print_function, unicode_literals )
import importlib, multiprocessing, logging
from tkrequest.lib.info import __pkgname__, __description__, __version__
from tkrequest.lib.backwardcompat ... |
class chatFilters:
def __init__(self, fileName="filters.txt"):
"""
Initialize chat filters
:param fileName: name of the file containing filters. Default: filters.txt
"""
self.filters = {}
self.loadFilters(fileName)
def loadFilters(self, fileName="filters.txt"):
"""
Load filters from a file
:param... |
# -*- coding: UTF-8 -*-
# Copyright (C) 2016 Sylvain Taverne <taverne.sylvain@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... |
from __future__ import with_statement
import distribute_setup
distribute_setup.use_setuptools()
from setuptools import setup
import os
with open(os.path.join(os.path.dirname(__file__),"README.rst"), 'r') as fh:
long_desc = fh.read()
VERSION = "0.1.2"
setup(name="dedupe",
version=VERSION,
descriptio... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext... |
#! /usr/bin/env python3
# Copyright 2017 John Hanley.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, m... |
#/###################/#
# Import modules
#
#ImportModules
import ShareYourSystem as SYS
import scipy.stats
import numpy
numpy.random.seed(4)
#/###################/#
# Build the model
#
#Simulation time
SimulationTimeFloat=1000.
#set
AgentUnitsInt = 100
#SimulationTimeFloat=0.2
BrianingDebugVariable=0.1 if Simulati... |
#!/usr/bin/python
"""
BACnet Streaming Link Layer Module
"""
import hashlib
from .errors import EncodingError, DecodingError
from .debugging import ModuleLogger, DebugContents, bacpypes_debugging
from .pdu import LocalStation, PCI, PDUData
# some debugging
_debug = 0
_log = ModuleLogger(globals())
# a dictionary ... |
import glob
import contextlib
import os
#import filecmp
import difflib
import re
import subprocess
import time
import argparse
import sys
@contextlib.contextmanager
def Chdir(directory):
cwd = os.getcwd()
os.chdir(directory)
yield
os.chdir(cwd)
rawRegTests = open('regTests').readlines()
#Ignore comme... |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to us... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 Rackspace Hosting 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
#... |
# UploadElasticsearchStats
import warnings
import pprint
warnings.simplefilter(action="ignore", category=Warning)
import methods_upload_elasticsearch_sumrydicts
import time
import datetime
print("############################################")
print("Elastic Search Session Info Upload (UTC): " + str(datetime.datetime... |
from inspect import cleandoc, isclass
import pluginmanager
from requests import ConnectionError
# Constants
# platform
MACOS = "MACOS"
LINUX = "LINUX"
WINDOWS = "WINDOWS"
# Shortcut for MACOS + LINUX
UNIX = "UNIX"
def plugin(name):
"""
Convert function in Plugin Class
@python(platform=LINUX, native="a... |
# Copyright 2018-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... |
# This file is part of django-xmpp-server-list
# (https://github.com/mathiasertl/django-xmpp-server-list).
#
# django-xmpp-server-list is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... |
from __future__ import print_function
from __future__ import absolute_import
import websocket
try:
import six.moves._thread
except ImportError: # TODO use Threading instead of _thread in python3
import _thread as thread
import time
import sys
def on_message(ws, message):
print(message)
def on_error(ws,... |
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from numpy.core.multiarray import ndarray
__author__ = "mhbashari"
class LinearRegression:
def __init__(self, train_X: ndarray, train_Y: ndarray, learning_rate=0.001, training_epochs=100):
self.train_X = train_X
self.train... |
import pybullet as p
import time
useMaximalCoordinates = False
flags = p.URDF_ENABLE_SLEEPING
import pybullet_data
p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.configureDebugVisualizer(p.COV_ENABLE_RENDERING, 0)
p.loadURDF("plane100.urdf", flags=flags, useMaximalCoordinates=useMaximalCo... |
# -*- coding: utf-8 -*-
import random
import re
import time
import urlparse
from module.plugins.internal.Hoster import Hoster
from module.plugins.internal.misc import json
class ZbigzCom(Hoster):
__name__ = "ZbigzCom"
__type__ = "hoster"
__version__ = "0.02"
__status__ = "testing"
__pattern__ =... |
# -*- coding: utf-8 -*-
# Copyright 2016 The Switch-Chile Authors. All rights reserved.
# Licensed under the Apache License, Version 2, which is in the LICENSE file.
# Operations, Control and Markets laboratory at Pontificia Universidad
# Católica de Chile.
import pandas, os, re, datetime, sys
from unidecode import un... |
# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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 ... |
import os
from unittest import TestCase
from unittest.mock import patch
from RatS.trakt.trakt_ratings_inserter import TraktRatingsInserter
TESTDATA_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'assets'))
class TraktRatingsInserterTest(TestCase):
def setUp(self):
i... |
import django
from django.conf import settings
from django.template.response import TemplateResponse
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from oioioi.base.main_page import register_main_page_view
from oioioi.contests.controllers import submission_template_context
from ... |
from copy import deepcopy
from uuid import uuid4
from time import strftime, gmtime
from threading import Lock, Timer
from typing import List, Dict, Callable
import atexit
try:
from contextvars import ContextVar
_session_info = ContextVar('bugsnag-session', default={}) # type: ignore
except ImportError:
fr... |
import itertools
import plotly
import plotly.graph_objs as go
from plotly import tools
from .layout import ElementBuilder
from .plot import AtomBuilder
from .subplot import SubPlotSpec, PlotCanvas
class FigureHolder(object):
def __init__(self, figure):
self.figure = figure
def plot(self, mode='offl... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-11-23 22:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("erudit", "0056_auto_20161111_1125"),
]
operations =... |
"""
Django settings for ursa-django project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... |
##
# Copyright (C) 2014 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen 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, o... |
#! /usr/bin/env python
# Licensed to Big Data Genomics (BDG) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The BDG licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you... |
# Copyright 2008 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by applicable law or a... |
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
#
# MAUS 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.
#
# MAUS... |
"""
This file contains scripts that are not part of the main production server. But that reads/exports/manipulates things on a one-to-one basis.
"""
from images.models import Point, Image, Source, Robot
from annotations.models import Annotation
import os
import numpy as np
from django.conf import settings
from datetim... |
# -*- coding: utf-8 -*-
import logging
from xml.sax import handler
from moxie.places.importers.helpers import prepare_document, format_uk_telephone
logger = logging.getLogger(__name__)
DEFAULT_SHOP = '/amenities/shop'
SHOPS = {'supermarket': '/amenities/supermarket',
'department_store': '/amenities/superm... |
#python 2.7
#coding=utf-8
__author__ = "Terry.Ren"
#try:
# import Image
#except ImportError:
# from PIL import Image
from PIL import Image
from PIL import ImageDraw
import ImageEnhance
import os
import urllib
import StringIO
import uuid
import pytesseract #open source
class Captcha(object):
def __init... |
from MLE import *
data_path = '../Data/BOJ/'
output = '../Paper/Result/ModelResult/JP/'
#peer only
N = number_banks = 25
file_name = data_path+"BOJ data.csv"
dat = pd.read_csv(file_name)
year = dat['Year']
dat = dat.iloc[:,1]
y=dat.iloc[1:]
y=y.reset_index(drop=True)
x0=dat.iloc[:-1]
x0=x0.reset_inde... |
# -*- 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
#... |
from chainer.backends import cuda
from chainer import function
from chainer import variable
class _DummyFunction(function.Function):
def __init__(self, grads):
self.grads = grads
def forward(self, inputs):
xp = cuda.get_array_module(*inputs)
return xp.array(0),
def backward(self... |
import dsz
import dsz.ui
import dsz.script
SELF = int(dsz.script.Env['script_command_id'])
def get(env, cmdid=0, addr=dsz.script.Env['target_address']):
if (not dsz.env.Check(env, cmdid, addr)):
return None
else:
return unicode(dsz.env.Get(env, cmdid, addr), 'utf_8')
def set(env, value, cmdid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.