text stringlengths 475 200k |
|---|
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ["BoxLeastSquares", "BoxLeastSquaresResults"]
import numpy as np
from astropy import units
from astropy.time import Time, TimeDelta
from astropy.timeseries.periodograms.lombscargle.core import has_units, strip_units
fro... |
# -*- coding: utf-8 -*-
"""
Request Management
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index():
""" Module'... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from operator import itemgetter
from flask import session
from m... |
import threading
import os
from System.Core.Global import *
from System.Core.Colors import *
from System.Lib.scapy.all import sniff,ARP
class Module:
info = {
'Name': 'ARP Watcher',
'Author': ['@enddo'],
'Description': ("ARP Watcher"),
}
options = {
'Output' :[True ,False ,'The stdout save in ou... |
"""
Local project settings for openiv project.
Do not modify this file.
"""
try:
from .project_settings_defaults import *
except ImportError as e:
pass
SECRET_KEY = 'aFiftyCh@racterRandom$tring0fLettersDigits&symbo1s'
# Set to True on a live production server.
# If True, then API keys to switch to live values.
... |
# coding=utf-8
"""
The NfsCollector collects nfs utilization metrics using /proc/net/rpc/nfs.
#### Dependencies
* /proc/net/rpc/nfs
"""
import diamond.collector
import os
class NfsCollector(diamond.collector.Collector):
PROC = '/proc/net/rpc/nfs'
def get_default_config_help(self):
config_help ... |
# Copyright (c) 2009-2010, Cloud Matrix Pty. Ltd.
# All rights reserved; available under the terms of the BSD License.
"""
esky.sudo.sudo_win32: win32 platform-specific functionality for esky.sudo
This module implements the esky.sudo interface using ctypes bindings to the
native win32 API. In particular, it us... |
"""
Support for controlling GPIO pins of a Raspberry Pi.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/rpi_gpio/
"""
# pylint: disable=import-error
import logging
from homeassistant.const import (
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP... |
from django import forms
from django.utils.translation import ugettext
from django.conf.urls import url
import django_filters
from django_filters.filters import OrderingFilter
from currencies.models import Currency
from filters.views import FilterMixin
ORDER_BY_FIELD = 'o'
class CurrencyFilterForm(forms.Form):
... |
from autotest.client.shared import error
from virttest import virsh, libvirt_vm
def run_virsh_vcpuinfo(test, params, env):
"""
Test command: virsh vcpuinfo.
The command can get domain vcpu information
1.Prepare test environment.
2.When the ibvirtd == "off", stop the libvirtd service.
3.Perform... |
from __future__ import with_statement
from collections import defaultdict
import codecs
from chatterbox import chatterbox
import thread, time
import xml.sax.saxutils as sx
#import perverted as perv
import userinfowindow as uiw
user_info_window = None
from guimporter import *
langdict = {}
countries = {}
import ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Script Name : app.py
# Author : Jagadeesan
# Author Email : [EMAIL]
# Created : April 2016
# Version : 1.0
# Description : Online Direct transfer of images from google drive to google photos using Openshift
import httplib2
import os
import sys
import io
import oaut... |
from sympy.solvers.decompogen import decompogen
from sympy import sin, cos, sqrt, Abs
from sympy import symbols
from sympy.utilities.pytest import XFAIL
x, y = symbols('x y')
def test_decompogen():
assert decompogen(sin(cos(x)), x) == [sin(x), cos(x)]
assert decompogen(sin(x)**2 + sin(x) + 1, x) == [x**2 + x ... |
"""
Example of using the standard logging facility to send events to udplog.
"""
import logging
import socket
import warnings
from udplog.udplog import UDPLogger, UDPLogHandler
# Get a logger in the idiomatic way.
logger = logging.getLogger(__name__)
# Set up logging to stdout
logging.basicConfig(level=logging.DEBU... |
from django import template
from django.template import Library, Node, resolve_variable, TemplateSyntaxError
from django.template import Context, Template, Node, resolve_variable, TemplateSyntaxError, Variable
register = template.Library()
"""
This is custom tag I wrote for myself for solving situations when you ha... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import sc2reader
from sc2reader.factories.plugins.replay import toJSON
def main():
import argparse
parser = argparse.ArgumentParser(description="Prints replay data to a json strin... |
# comment
def init():
global colorList
colorList = [
(0,0,0),
(255,0,0),
(0,255,0),
(0,0,255),
(255,255,0),
(0,255,255),
(255,0,255),
(128,0,0),
(128,128,0),
(0,128,0),
(128,0,128),
(0,128,128),
(0,0,128),
(165,42,42),
(178,34,34),
(220,20,60),
(255,0,0),
(255,99,... |
#!/usr/bin/python
import os
import psycopg2
import sys
import django_content_type_mapping
file = open("/home/" + os.getlogin() + "/.pgpass", "r")
pgpasses = []
for line in file:
pgpasses.append(line.rstrip("\n").split(":"))
file.close()
for pgpass in pgpasses:
#print str(pgpass)
if pgpass[0] == "54.236.235.110"... |
#!/usr/bin/env python
import os
import shutil
import subprocess
from gerblook import create_app
from gerblook.utils import *
from gerblook.models import *
from gerblook.gerber import *
color_silver = '#a0a0a0ff'
color_drills = '#111111dd'
color_black = '#000000ff'
color_white = '#ffffffff'
color_outline = '#000000'
... |
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ImproperlyConfigured
from notification.backends.base import NotificationBackend
try:
from txtlocal.utils import sendSMS
except ImportError:
raise ImproperlyConfigured('notifications.back... |
import random
while True:
# 컴퓨터의 숫자를 만들어줄 temp list생성
temp = [i for i in range(10)]
user_choice_randnum = 0
# 랜덤으로 뽑을 숫자를 받아 뽑음
while user_choice_randnum < 1 or user_choice_randnum > 7:
user_choice_randnum = int(input("숫자야구에서 몇 자리(2~7)를 할지 선택해주세요: "))
com_num = []
while len(temp) >... |
import token
import ast
class ParserError(Exception):
pass
class ParserResult(object):
def __init__(self, ast, keep):
self.ast = ast
self.keep = keep
class BaseParser(object):
def __init__(self, lexer):
self.lexer = lexer
self.offset = 0
self.injected = []
def get_token(self):
if len(self.injected) ... |
from django.utils import simplejson as json
from django.core import mail
from django.core.urlresolvers import NoReverseMatch, reverse
from gargoyle.testutils import switches
from mock import ANY, patch
from identityprovider.models import (
Account,
AuthToken,
EmailAddress,
)
from identityprovider.models.c... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012-2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it a... |
# GNU Enterprise Common Library - Base Module
#
# Copyright 2001-2006 Free Software Foundation
#
# This file is part of GNU Enterprise
#
# GNU Enterprise 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
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Adriano Monteiro Marques
#
# Author: Francesco Piccinno <[EMAIL]>
#
# 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 vers... |
#!/usr/bin/python
## Copyright (c) 2011, Aldebaran Robotics
## 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
## not... |
# coding: utf-8
"""
Deals with generating the per-page table of contents.
For the sake of simplicity we use an existing markdown extension to generate
an HTML table of contents, and then parse that into the underlying data.
The steps we take to generate a table of contents are:
* Pre-process the markdown, injecting... |
import os
import sys
import warnings
from itertools import takewhile
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from django.db.migrations import Migration
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.loader import Migr... |
# Copyright 2015 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.
import atexit
import datetime
import email.utils
import errno
import hashlib
import logging
import math
import os.path
import socket
import subprocess
import... |
""" Tests gist3.models.Gist
"""
# TODO:
# How do I perform tests on what an authorized Gist object is supposed to do?
# Tests needed for: iter_files(), clone(), fork() (with auth), star stuff
# (with auth), updated_at, create()
import datetime
import os
import tempfile
import requests
import pytest
from gist... |
################################################################
# Analysis post MSMBuilder #
# Author: Saurabh Shukla <[EMAIL]> #
# Orginally built for ShuklaGroup@illinois <shuklagroup.org> #
################################################################
#---... |
# Copyright 2016 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... |
# Copyright 2015-2017 ARM Limited
#
# 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 w... |
"""Test module for rotamer predictor and interface"""
import os
import math
from nose.tools import assert_almost_equals
from lightdock.scoring.dfire.driver import DFIRE, DFIREAdapter
from lightdock.pdbutil.PDBIO import parse_complex_from_file
from lightdock.structure.complex import Complex
from lightdock.rotamer.predi... |
# 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"); you may not u... |
# -*- coding: utf-8 -*-
#
# Author: Pearu Peterson, March 2002
#
# additions by Travis Oliphant, March 2002
# additions by Eric Jones, June 2002
# additions by Johannes Loehnert, June 2006
# additions by Bart Vandereycken, June 2006
# additions by Andrew D Straw, May 2007
# additions by Tiziano Zito, November 2008... |
"""Misc operator module tests
Made for Jython.
"""
import collections
import operator
import sys
import unittest
from test import test_support
class OperatorTestCase(unittest.TestCase):
class NewStyle(object):
pass
class OldStyle:
pass
class HasGetitem(object):
def __getitem__(sel... |
import sys, os
import subprocess
import traceback
import urllib
import zipfile
WORKING_DIR = os.path.dirname(os.path.realpath(__file__))
annotation_tools = os.path.join(WORKING_DIR, "annotation-tools")
def find_or_download_tools():
if not os.path.isdir(annotation_tools):
annotation_tools_zip = annotation_... |
# mock.py
# Test tools for mocking and patching.
# Maintained by Michael Foord
# Backport for other versions of Python available from
# http://pypi.python.org/pypi/mock
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
... |
#!/usr/bin/env python
########################################################################
# File : dirac-jobexec
# Author : Stuart Paterson
########################################################################
""" The dirac-jobexec script is equipped to execute workflows that
are specified via their XML... |
#!/usr/bin/env python3
'''
cca_command.py
Copyright 2012-2021 Codinuum Software Lab <https://codinuum.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/l... |
import gzip
import argparse
import itertools
import paddle.v2 as paddle
import network_conf
from train import dnn_layer_dims
import reader
from utils import logger, ModelType
parser = argparse.ArgumentParser(description="PaddlePaddle CTR example")
parser.add_argument(
'--model_gz_path',
type=str,
required... |
# Copyright 2011 NaN Projectes de Programari Lliure, S.L.
# Copyright 2014 Ángel Moya (Domatix)
# Copyright 2014 Roberto Lizana (Trey)
# Copyright 2013-2016 Pedro M. Baeza
from odoo import models, fields, api
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
number = fields.Char(related=False... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from lxml import etree # For XML parsing
import os
import sys
import urllib2
import urllib
import urlparse
import astar
import shutil
import gtk
from common import ensure_dir, LM_CACHE_PATH
def check_images(img_list) :
new_img = set()
for img in img_list :
path = LM_CACHE... |
import logging
from coilsnake.modules.eb.EbModule import EbModule
from coilsnake.model.eb.pointers import EbPointer
from coilsnake.util.eb.pointer import from_snes_address
log = logging.getLogger(__name__)
class CccInterfaceModule(EbModule):
NAME = "CCScript Labels"
SUMMARY_RESOURCE_NAME = 'ccscript/summa... |
##
# Copyright 2009-2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
import attr
from dateutil.parser import parse as parse_date
import requests
from lxml import etree
__all__ = [
"get_current_tournaments",
"get_status",
"WEBSITE_URL",
"TOURNAMENTS_XML_URL",
"STATUS_URL",
]
WEBSITE_URL = "http://www.pokerstars.eu"
TOURNAMENTS_XML_URL = WEBSITE_URL + "/datafeed_gl... |
"""Tests for the object inspection functionality.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team.
#
# Distributed under the terms of the BSD License.
#
# The full license is in the file COPYING.txt, distributed with this softw... |
# baselineTeam.py
# ---------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley... |
# Copyright (c) 2010-2013 OpenStack Foundation
#
# 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... |
from GenericRequest import GenericRequest
from kol.manager import PatternManager
from kol.database import ItemDatabase
class CurrentEquipmentRequest(GenericRequest):
"""
Gets info on all equipment currently equipped.
Returns a lookup from the item database for each item equipped.
For accessories, two p... |
#!/usr/bin/python
from __future__ import print_function
import RPi.GPIO as GPIO
import time
import pigpio
#------------------------------------------------------------------------
# use the raspi board pin number
#GPIO.setmode(GPIO.BOARD)
# use the gpio number
GPIO.setmode(GPIO.BCM)
# only one of following for GPIO.I... |
import utm
import yaml
import rospy
import random
import numpy as np
from map_coords import MapCoords
from kriging_exploration.srv import GetTsp
import matplotlib.pyplot as plt
def line_intersection(l1, l2):
# line1 = [l1[0].coord.northing, l1[0].coord.easting, l1[1].coord.northing, l1[1].coord.easting]
# line... |
# Copyright (c) 2018 PaddlePaddle 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 app... |
from __future__ import unicode_literals
import json
from django.contrib.gis.geos import LinearRing, Point, Polygon
from django.core import serializers
from django.test import TestCase, skipUnlessDBFeature
from .models import City, MultiFields, PennsylvaniaCity
@skipUnlessDBFeature("gis_enabled")
class GeoJSONSeria... |
from threading import Event
from time import sleep, time
from py3status.core import Common, Module
class MockPy3statusWrapper:
class EventThread:
def process_event(self, *arg, **kw):
pass
def __init__(self, config):
self.config = {
'py3_config': config,
'... |
#!/usr/bin/env python2
#------------------------------------------------------------------------
# Copyright (c) 1998 by Total Control Software
# All Rights Reserved
#------------------------------------------------------------------------
#
# Module Name: fcgi.py
#
# Description:... |
import logging
import time
from collections import deque
from threading import Thread, Lock
logger = logging.getLogger(__name__)
class QueueJob(object):
def __init__(self, method, *args, **kwargs):
self.method = method
self.args = args
self.kwargs = kwargs
class QueueExecutor(Thread):... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.evaporative_coolers import EvaporativeCoolerIndirectResearchSpecial
log = logging.getLogger(__name__)
class TestEvaporativeCoolerIndirectResearchSpecial(unittest.TestCase):
... |
#!/usr/bin/env python -tt
import copy
import _gdbm
import itertools
import json
import os
import re
import requests
import time
from urllib.error import HTTPError
from urllib.parse import parse_qs, urlencode, urljoin, urlparse, urlunparse
import bottlenose
import lxml
import scrapy.http
import scrapy.selector
import ... |
from pyramid.view import view_config
from clld.web.util.pager import Pager
@view_config(route_name='lexicalia', renderer='lexicalia.mako')
def lexicalia(request):
params = dict(q=request.params.get('q') or '*')
q = request.solr.query(text=params['q']).query(dataset='wold').query(rscname='Parameter')
fo... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Copyright (c) 2017-2019 The Mincoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framewor... |
"""
Read fibermap and cframe files for all exposures of a single night and update or create brick files.
"""
import argparse
import os.path
import numpy as np
import desispec.io
from desispec.log import get_logger, DEBUG
def parse(options=None):
parser = argparse.ArgumentParser(description="Update or create b... |
# Flowtools - a suite of tools for handling and drawing flow data
# Copyright (C) 2013 Petter Johansson
#
# 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
# (a... |
# Copyright 2016 Google LLC All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
"""
Sublime Text Scheme template.
Converts scheme to CSS provides templating for
additional so that they can access the colors.
Licensed under MIT
Copyright (c) 2015 - 2020 Isaac Muse <[EMAIL]>
----------------------
TextMate theme to CSS.
https://manual.macromates.com/en/language_grammars#naming_conventions
"""
i... |
from __future__ import absolute_import, division, print_function
from datetime import datetime
from collections import defaultdict
from toolz import merge
import bisect
import numpy as np
import pandas as pd
from .core import new_dd_object, Series
from . import methods
from ..base import tokenize
class _LocIndexer... |
__author__ = 'LiGuangyu'
'''通用客户端组件'''
import aiohttp
from common.comm import singleton
import json
import urllib
import asyncio
@singleton
class HttpClient:
headers={'content-type':'appliction/json'}
def __init__(self, loop):
self.client = aiohttp.ClientSession(loop=loop)
@classmethod
def ... |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the :data:`iris.analysis.STD_DEV` aggregator."""
# Import iris.tests first so that some things can be initia... |
"""Support for monitoring OctoPrint binary sensors."""
import logging
import requests
from homeassistant.components.binary_sensor import BinarySensorDevice
from . import BINARY_SENSOR_TYPES, DOMAIN as COMPONENT_DOMAIN
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_i... |
# -*- coding: utf-8 -*-
import sys
import time
import inspect
from . import misc, excepts
def state(self):
"""
Состояние ККМ в коротком виде.
"""
return self.protocol.command(
0x10,
self.password
)
state.cmd = 0x10
def full_state(self):
"""
Состояние ККМ.
"""
... |
#!/usr/bin/env python3
# -*- coding, utf-8 -*-
# Оценка параметров гамма-распределения методом МП
# Estimation of gamma distributions by ML method
# Copyright © 2013–2014 Василий Горохов-Апельсинов
# This file is part of code for my bachelor's thesis.
#
# Code for my bachelor's thesis is free software: you can redis... |
import importlib
import os
import unittest
import mock
import numpy
from chainer.dataset import download
from chainer.datasets import get_fashion_mnist
from chainer.datasets import get_fashion_mnist_labels
from chainer.datasets import get_kuzushiji_mnist
from chainer.datasets import get_kuzushiji_mnist_labels
from ch... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN.
#
# Invenio 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... |
# -*- coding: utf-8 -*-
import logging
log = logging.getLogger(__name__)
from enum import Enum
import math
import os
from shutil import copy2
import re
from subprocess import call
import contextlib
import logging
log = logging.getLogger(__name__)
import warnings
import jinja2
import pandas as pd
import numpy as np
... |
# !/usr/bin/env python3
# Copyright (C) 2017 Qrama
#
# 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 License, or
# (at your option) any later version.
#
# This pr... |
# Django Imports
from django.conf import settings
from django.contrib.auth.models import User
# Rest Imports
from rest_framework import status
from rest_framework.test import APITestCase
# Local Imports
from ava_core.notify.models import NotificationEmail
# Implementation
class AvaCoreTest(APITestCase):
"""
T... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2018 Florian Bruhin (The Compiler) <[EMAIL]>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 Found... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_psync
----------------------------------
Tests for `psync` module.
"""
# from click.testing import CliRunner
from psync import psync
# from psync import cli
def test_load_config(tmpdir):
proj_root = tmpdir.mkdir("proj_root")
proj_root.join(".psync").w... |
'''springs'''
import numpy as np
from PyQt5 import QtGui, QtCore, QtWidgets
from .misc import length_
DRAW_FORCE_SCALE = 400e3
class Spring(object):
def __init__(self, sim=None, name=""):
if(sim):
self.sim = sim
self.name = name
self.idx = len(sim.springs)
... |
from PyQt5 import QtCore, QtWidgets
import peacock
import mooseutils
class AxisSettingsWidget(peacock.base.MooseWidget, QtWidgets.QWidget):
"""
Widget for axis settings.
"""
axesModified = QtCore.pyqtSignal()
def __init__(self, name, index):
super(AxisSettingsWidget, self).__init__()
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2021 Python-geotiepoints developers
#
# 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... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'Katharsis'
__copyright__ = 'Copyright 2014, Piotr Tynecki'
__license__ = 'BSD'
__version__ = '1.0'
import os
import sys
import shutil
import re
import zipfile
from common import uncompyle_decompilation
from common import unpyc3
from common import is_compresse... |
import sys, string
import Config
import datetime
class Lookups( ) :
"""Functions for building quick lookup data-structures to save on Database query times"""
def __init__( self, db ) :
self.db = db
self.cursor = self.db.cursor( )
def buildSGRNAHash( self ) :
"""Build a set of sgRNAs mapped to sgRNA ID... |
# coding=utf-8
"""Tests for monkeypatches/workarounds from medusa/init/*.py."""
from __future__ import unicode_literals
from bencodepy import BencodeDecodeError, DEFAULT as BENCODE
from medusa import init # noqa: F401 [unused]
import pytest
TEST_TORRENT_CONTENT = (
b'd8:announce23:udp://explodie.org:696913:a... |
"""
Define some constants to use
"""
DB_OPERATION_SUCCESS = 100
DB_OPERATION_SUCCESS_MSG = "Very Good! Wirte database success ($_$)"
DB_OPERATION_FAILED = -100
DB_OPERATION_FAILED_MSG = "Terrible!!! Failed to write database >_< "
RETRY_TIMES = 5
BBC_WEBSITE = "http://www.bbc.com"
RSS_SOURCES = {
"Home": 'http:... |
"""
Support for Clementine Music Player as media player.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.clementine/
"""
import asyncio
from datetime import timedelta
import logging
import time
import voluptuous as vol
import homeassistant... |
import subprocess
import sys
import os
import setup_util
def start(args, logfile, errfile):
setup_util.replace_text("go/src/hello/hello.go", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
if os.name == 'nt':
#subprocess.call("rmdir /s /q pkg\\windows_amd64", shell=True, cwd="go")
#subprocess.cal... |
#!/usr/bin/env python
import json
def pretty_json(obj):
return json.dumps(obj, sort_keys=True, indent=4, separators=(',', ': '))
def scan_then_insert():
query_scan = {
'opType' : 'TableScan',
'opId' : 'Scan',
'relationKey' : {
'userName' : 'jwang',
'programName... |
#!/usr/bin/env python2
#***************************************************************************
#
# Copyright (c) 2015-2016 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 CERN.
##
## Invenio 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 ... |
#!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run fuzz test targets.
"""
import argparse
import configparser
import os
import sys
import subprocess
impor... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
#
# 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
#
# Unle... |
import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
import db
import seaborn as sns
import pandas as pd
import numpy as np
# takes data (that should come from the backend) and creates the output we would like to have
# on the front end.
def follower_botness(userna... |
# -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as locale
from django.dispatch import receiver
from django.db.models.signals import post_save
from . import managers
# Create your models here.
class Profile(models.Model):
#Re... |
{
'repo_type' : 'archive',
'download_locations' : [
{ 'url' : 'https://download.gnome.org/sources/glib/2.58/glib-2.58.3.tar.xz', 'hashes' : [ { 'type' : 'sha256', 'sum' : '8f43c31767e88a25da72b52a40f3301fefc49a665b56dc10ee7cc9565cbe7481' }, ], },
{ 'url' : 'https://fossies.org/linux/misc/glib-2.58.3.tar.xz', 'has... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.