text stringlengths 475 200k |
|---|
#!/usr/bin/env python
#
# Copyright 2013 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 fnmatch
import optparse
import os
import sys
from util import build_utils
from util import md5_check
def DoJavac(options):
... |
# sublimelint.py
# SublimeLint is a code checking framework for Sublime Text
#
# Project: https://github.com/lunixbochs/sublimelint
# License: MIT
import sublime
import sublime_plugin
import os
from threading import Thread
import time
import json
from .lint.edit import apply_sublimelint_edit
from .lint.edit import E... |
import platform
import _winreg
import re
arch = platform.architecture()[0]
if arch == '64bit':
arch_keys ={_winreg.KEY_WOW64_32KEY, _winreg.KEY_WOW64_64KEY}
elif arch == '32bit':
arch_keys = {0}
else:
raise Exception("Unhandled architecture: %s" % arch)
def findEiBotBoards():
hReg = _winreg.ConnectRe... |
# Copyright 2012 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.
"""Presubmit script for Chromium WebUI resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the pre... |
# -*- 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... |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... |
import unittest
import json
import copy
from hopkin.app import flask_app
from hopkin.models.items import Item
from hopkin.models.users import User
from hopkin.models.ratings import Rating
class TestItemRoute(unittest.TestCase):
__test_item_data_1 = {
'name': 'Test Item',
'description': 'This is ju... |
'''
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
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 ... |
# Community Almanac - A place for your stories.
# Copyright (C) 2009 Douglas Mayle, Robert Marianski,
# Andy Cochran, Chris Patterson
# This file is part of Community Almanac.
# Community Almanac is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
... |
# -*- coding: utf-8 -*-
from cStringIO import StringIO
from struct import pack
from struct import unpack
from datetime import datetime
import time
def _calcCRC(crc, byte):
table = [0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401,
0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801,... |
import requests
import json
import sys
import re
import os
import getpass
import datetime
import ast
from requests import Session
from robobrowser import RoboBrowser
from bs4 import BeautifulSoup
from re import findall
global data
def check_friends(uid_one, uid_two):
"""
uid_one: int
uid_two: int
"""... |
# 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... |
from django.contrib import admin
from oscar.apps.promotions.models import (
AutomaticProductList, HandPickedProductList, Image,
KeywordPromotion, MultiImage, OrderedProduct, PagePromotion,
RawHTML, SingleProduct, TabbedBlock)
class OrderProductInline(admin.TabularInline):
model = OrderedProduct
cla... |
##
# Copyright (c) 2010-2017 Apple 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 l... |
'''Feedbacks.VisualSpeller.HexShape
# Copyright (C) 2010 "Nico Schmidt"
#
# 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 versio... |
from django.shortcuts import render, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
# Needed for Google Maps API
import requests, json
from .models import Rider, Ride, RideForm... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
#
# GRIPY - Geofísica de Reservatório Interativa em Python
#
# ----------------------------------------------------------------------------
#
# Author: Fernando Vizeu Santos
# Company: Grupo de Inferência de Reservat... |
# The MIT License (MIT)
#
# Copyright (c) 2013 Stefan Reiterer - [EMAIL]
#
# 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 u... |
from ajenti.com import *
from ajenti.apis import API
from ajenti.api import *
from ajenti.utils import *
from ajenti.ui import UI
from ajenti import apis
class Bacula(API):
@staticmethod
def parse_config(file):
cfg = []
sec = None
for l in open(file, 'r'):
l = l.strip(... |
# This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.
import datetime
import json
import sys
from mldb import mldb
# create a mutable beh dataset
def test_dataset(config):
dataset = mldb.create_dataset(config)
# non-empty row name and column name
dataset.record_rows([["row_name"... |
'''
Created on 7 Jul 2017
@author: Andy Zhang
'''
import pyautogui
from subprocess import Popen
from time import sleep
import time
import os
import logging
import datetime
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# create a file handler
handler = logging.FileHandler('log_ex... |
#
# 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 ... |
"""
Summary: Data structure relay class
Purpose: This class handles management of data model sub-division and relaying sets/gets.
Python Version: QA'd on Python 3.4.1
"""
from Record import Record
__author__ = "Michael Rais"
__version__ = "0.7-beta"
__maintainer__ = "Michael Rais"
__email_... |
# CHIPSEC: Platform Security Assessment Framework
# Copyright (c) 2017, Intel Security
#
# 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; Version 2.
#
# This program is distributed in the hope th... |
import ctypes
import windows.generated_def as gdef
from ..apiproxy import ApiProxy, NeededParameter
from ..error import succeed_on_zero
class IphlpapiProxy(ApiProxy):
APIDLL = "iphlpapi"
default_error_check = staticmethod(succeed_on_zero)
@IphlpapiProxy()
def SetTcpEntry(pTcpRow):
return SetTcpEntry.ctyp... |
"""The search engine backend registry."""
from __future__ import unicode_literals
from djblets.siteconfig.models import SiteConfiguration
from reviewboard.registries.registry import Registry
from reviewboard.search.search_backends.elasticsearch import \
ElasticsearchBackend
from reviewboard.search.search_backend... |
from setuptools import setup, find_packages
install_requires = [
"jupyter",
"ipykernel",
"ipython",
"notebook",
"networkx==2.4",
"jsonpath-rw>=1.4.0",
"requests>=2.21.0",
"graphviz>=0.11.1",
"aiohttp",
"pandas",
"pyyaml",
"nest_asyncio",
]
from os import path
this_dir... |
"""
:class:`ZoomBar` is a class that *appoximatively* mimics the behaviour of the Mac Dock,
inside a :class:`Panel`.
Description
===========
:class:`ZoomBar` is a class that *appoximatively* mimics the behaviour of the Mac Dock,
inside a :class:`Panel`.
Once you hover mouse over the :class:`ZoomBar` correct button ... |
# encoding: utf-8
"""
Step implementations for table-related features
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from behave import given, then, when
from docx import Document
from docx.enum.table import WD_TABLE_ALIGNMENT
from docx.shared import Inches
from docx.... |
# 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... |
#!/usr/bin/python
import unittest, time, sys, random, datetime
sys.path.extend(['.','..','py','../h2o/py','../../h2o/py'])
import h2o, h2o_hosts, h2o_cmd, h2o_browse as h2b
import h2o_print as h2p
beginning = time.time()
def log(msg):
print "\033[92m[0xdata] \033[0m", msg
CHECK_WHILE_SLEEPING = False
print "Don'... |
#-*-coding=utf-8-*-
RC_ENV = {
"username": "username",
"password": "password",
"tenant_name": "tenant_name",
"auth_url": "auth_url",
}
def _create_rc(obj=None):
rc = RC_ENV.copy()
rc["username"] = obj.user_data_center.keystone_user
rc["password"] = obj.user_data_center.keystone_password
... |
"""
Set-like manipulation of weights matrices.
"""
__author__ = "Sergio J. Rey <[EMAIL]>, Charles Schmidt <[EMAIL]>, David Folch <[EMAIL]>, Dani Arribas-Bel <[EMAIL]>"
import pysal
import copy
from scipy.sparse import isspmatrix_csr
from numpy import ones
__all__ = ['w_union', 'w_intersection', 'w_difference',
... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import unittest
from pants.option.parser_hierarchy import InvalidScopeError, all_enclosing_scopes, enclosing_scope
from pants.option.scope import GLOBAL_SCOPE
class TestEnclosingScopeTr... |
# Copyright 2018 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... |
#!/usr/bin/env python
import pygame
from game_class import Game
#---------------------
# Screen dimensions:
SCREEN_WIDTH = 700
SCREEN_HEIGHT = 500
#---------------------
def main():
pygame.mixer.pre_init(44100, -16, 2, 2048)
pygame.init()
# Set the width and height of the screen [width, height]
screen =... |
from p2pool.bitcoin import networks
from p2pool.util import math
# CHAIN_LENGTH = number of shares back client keeps
# REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout
# REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH
# REAL_CHAIN_LENGTH must be changed in sync with all other clients
# ... |
# -*- 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 sys
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'replacethiswithsomethingsecret'
USING_NOTIFICATIONS = False
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'councilmatic',
'USER': '',
... |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class StretchInternetIE(InfoExtractor):
_VALID_URL = r'https?://portal\.stretchinternet\.com/[^/]+/portal\.htm\?.*?\beventId=(?P<id>\d+)'
_TEST = {
'url': 'https://portal.stretchinternet.com/umary/portal.htm... |
from . import base
from grow.pods import env
from grow.pods.storage import storage as storage_lib
from protorpc import messages
import git
import logging
import os
import shutil
import tempfile
import webapp2
class Config(messages.Message):
env = messages.MessageField(env.EnvConfig, 1)
repo = messages.StringField... |
from django.conf.urls import *
from corehq.apps.domain.urls import domain_settings
from corehq.apps.cloudcare.urls import settings_urls as cloudcare_settings
from corehq.apps.commtrack.urls import settings_urls as commtrack_settings
from corehq.apps.products.urls import settings_urls as product_settings
from corehq.ap... |
"""Test the Profiler config flow."""
from unittest.mock import patch
from homeassistant import config_entries, setup
from homeassistant.components.profiler.const import DOMAIN
from tests.common import MockConfigEntry
async def test_form_user(hass):
"""Test we can setup by the user."""
await setup.async_setu... |
import numpy as np
from pyprobml_utils import save_fig
import matplotlib.pyplot as plt
from scipy.special import betaln
theta = 0.7
N = 5
alpha = 1
alphaH = alpha
alphaT = alpha
# instantiate a number of datastructures
flips = np.zeros((2**N, N))
Nh = np.zeros(2**N)
Nt = np.zeros(2**N)
marginal_lik = np.zeros(2**N)
l... |
# Copyright (C) 2016 EMC 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/licenses/LICENSE-2.0
#
# Unless requ... |
#!/usr/bin/env python
# Author: Henry Bruce <[EMAIL]>
# Copyright (c) 2016 Intel Corporation.
#
# 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 limit... |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, merge, publish,
... |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 TurboCoin
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test activation of the first version bits soft fork.
This soft fork will activate the following BIPS:
BIP 68 - nSequenc... |
import json
from boto.sqs.message import Message
import logging
import boto.ec2
import boto.sqs
import collections
import masterdirac.models.worker as wkr_mdl
import time
import masterdirac.models.server as svr_mdl
class ServerInterface(object):
def __init__(self, init_message,master_name):
self.name = in... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... |
# -*- coding: utf-8 -*-
# Aula sobre composição de objetos e uso do teclado.
from math import cos
from math import pi
from math import sin
import timeit
#import numpy
import ctypes
import random
from sys import argv
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
global esqdir
global cim... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) Rooms For (Hong Kong) Limited T/A OSCG (<http://www.openerp-asia.net>).
#
# This program is free software: you can redistribute it and/or modify
# ... |
# -*- coding: utf-8 -*-
#
# Unix SMB/CIFS implementation.
# Copyright © Jelmer Vernooij <[EMAIL]> 2008
#
# 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... |
# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
# Test that different configurations can use different EnvFactories without interference, i.e,
# there is no unintended static information in the envs module
# pylint: disable=E0611
from ... |
"""
DEPRECATED
#;+
#; NAME:
#; io (used to be readwrite)
#; Version 1.0
#;
#; PURPOSE:
#; Module for read/write of Spectra
#; 07-Sep-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_l... |
"""Access Ansible Core CI remote services."""
from __future__ import absolute_import, print_function
import pipes
from time import sleep
import lib.pytar
from lib.util import (
SubprocessError,
ApplicationError,
run_command,
)
from lib.core_ci import (
AnsibleCoreCI,
)
from lib.ansible_util impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... |
import numpy as np
import taichi as ti
from taichi import approx
@ti.require(ti.extension.data64)
@ti.all_archs_with(fast_math=False)
def test_precision():
u = ti.field(ti.f64, shape=())
v = ti.field(ti.f64, shape=())
w = ti.field(ti.f64, shape=())
@ti.kernel
def forward():
v[None] = ti.... |
__copyright__ = """Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved.
"""
__usage__ = """
CheckOutlines v1.26 Sep 4 2015
Outline checking program for OpenType/CFF fonts.
Usage: checkOutlines [-h] [-u] [-he] -g <glyph list>] [-gf <glyphNameList>][-e] [-v] [-s] [-x] [-3] [-4] [-5... |
from collections import defaultdict
# List of the standard launch parameters for an LTI launch
LAUNCH_DATA_PARAMETERS = [
'context_id',
'context_label',
'context_title',
'context_type',
'launch_presentation_css_url',
'launch_presentation_document_target',
'launch_presentation_height',
'... |
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
import json
import os.path
# Load the HSTS list from disk
__dirname = os.path.abspath(os.path.dirname(__file__))
__filename = os.path.join(__dirname, '..', '..', 'conf', 'hsts-preload.json')
with open(__filename, 'r') as f:
hsts = json.load(f)
def is_hpkp_preloaded(hostname):
# Just see if the hostname is ... |
#!/usr/bin/env python
#
# Data manager for reference data for the MetaPhlAn Galaxy tools
import argparse
import json
import subprocess
from datetime import date
from pathlib import Path
# Utility functions for interacting with Galaxy JSON
def read_input_json(json_fp):
"""Read the JSON supplied from the data manag... |
import logging
import numpy
import os
import tuna
import unittest
class unit_test_io_can(unittest.TestCase):
def setUp(self):
self.here = os.getcwd()
self.home = os.path.expanduser("~")
tuna.log.set_path(self.home + "/nose.log")
def test_add(self):
z1 = numpy.zeros(shape = (1, ... |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa 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... |
import urllib2
import requests
import csv
import re
import time
import argparse
import json
from bs4 import BeautifulSoup
from pprint import pprint
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from elasticsearch import Elast... |
from influxdb import InfluxDBClient
client = InfluxDBClient('localhost', 8086, 'root', 'root', 'picasso')
client.create_database('picasso')
#result = client.query('select cpuUsage from pi_status;')
#print("Result: {0}".format(result))
#
# result = client.query('select memUsage from pi_status;')
# print("R... |
# -*- coding: utf-8 -*-
import stomp
from beaver.transports.base_transport import BaseTransport
from beaver.transports.exception import TransportException
class StompTransport(BaseTransport):
def __init__(self, beaver_config, logger=None):
"""
Mosquitto client initilization. Once this this trans... |
#!/usr/bin/env python
from ivy.std_api import *
import socket
import struct
import os
import logging
import sys
import threading
import time
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python")
import messages_xml_map
PING_PERIOD = 5.0
STATUS_PERIOD = 1.0
STX = 0x99
STX_TS = 0x98
DATALINK_PORT = 4243
D... |
# This script tests all non-eyetracker functions of PyGaze; run it to see if
# your installation is working as it is supposed to. Remember to adjust the
# constants in the attached constants.py script to the relevant values for
# your system and preference!
#
# contents of the directory in which this script should come... |
import struct
normals = []
points = []
triangles = []
triangle_number = 0
def load_binary_stl(fp):
'''
二位元 STL 檔案格式如下:
檔案標頭共有 80 個字元(bytes), 內容通常省略, 但是內容不可使用 solid, 以免與文字檔案 STL 混淆
UINT8[80] – Header
UINT32 – Number of triangles (I:佔 4 bytes 的 unsigned integer)
foreach triangle
REAL32[... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# filename: upref.py
# Copyright 2019 Stefano Costa <[EMAIL]>
# Copyright 2010 Luca Bianconi <[EMAIL]>
#
# This file is part of Total Open Station.
#
# Total Open Station is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public... |
import cs
def getClosureScript(specification):
script = ""
for thisRecord in specification.records:
if thisRecord.parentKeyColumns is not None:
if len(thisRecord.parentKeyColumns)>0:
script = script + "CREATE TABLE ctree.%s_%s_closure (\n" %(thisRecord.table, cs.delimited... |
#!/usr/bin/env python
# Copyright 2017 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 base64
from writers import adml_writer
from writers.admx_writer import AdmxElementType
def GetWriter(config):
'''Factory me... |
from core.himesis import Himesis
import uuid
class HMapModule(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule MapModule.
"""
# Flag this instance as compiled now
self.is_compiled = True
super(HMapModule, ... |
# Copyright (C) 2006-2007 Red Hat, Inc.
# Copyright (C) 2009 Aleksey Lim
#
# 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 versio... |
#!/usr/bin/env python3
# Copyright (c) 2015, Marco Molteni.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ... |
import math
from param import *
class RobotLocation:
def __init__(self,timestamp = 0, x = 0.0, y = 0.0, theta = 0.0, magnitude = 0.0, angle = 0.0):
self.timestamp = timestamp
self.x = x
self.y = y
self.theta = theta
# self.magnitude = magnitude
# self.angle = angle
class BallLocation:
... |
# 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 ... |
#
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... |
"""
Django settings for nri project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... |
"""
Classes for the history API.
.. currentmodule:: asyncqlio.orm.schema.history
"""
import abc
from typing import Any, Callable, Tuple
from asyncqlio.orm.operators import OperatorResponse
from asyncqlio.orm.schema import column as md_column
class ColumnChange(abc.ABC):
"""
Represents a column change. This ... |
#!/usr/bin/env python
#
# @file swigdoc.py
# @brief Creates documentation for C#, Java, Python, and Perl.
# @author Ben Bornstein
# @author Christoph Flamm
# @author Akiya Jouraku
# @author Michael Hucka
# @author Frank Bergmann
#
# $Id: swigdoc.py 10124 2009-08-28 12:04:51Z sarahkeating $
# $HeadURL: https://sbml.s... |
# This function analyses the global forest watch forest loss dataset to provide
# forest loss time series at a given spatial resolution. Forest loss is
# calculated based on the fractional area of each pixel for which forest loss
# occurs in a specified timestep. Initial estimates will be annual, but
# subsequently w... |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 2 22:49:21 2016
@author: Manojkumar Parmar
"""
class AdoptionCenter:
"""
The AdoptionCenter class stores the important information that a
client would need to know about, such as the different numbers of
species stored, the location, and the n... |
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import sys
from mixbox.binding_utils import *
from . import cybox_common
from . import gui_object
class GUIWindowObjectType(gui_object.GUIObjectType):
"""The GUIWindowObjectType is intended to characterize GU... |
# -*- 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
#... |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... |
# Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 ... |
SLIPPAGE = 10
price = 0
stock = "000001.XSHE"
def init(context):
context.count = 0
subscribe_event(EVENT.TRADE, on_trade)
def on_trade(event):
global price
trade = event.trade
assert trade.last_price == price + instruments(stock).tick_size() * SLIPPAGE
def before_trading(context):
pass
d... |
import asyncio
import asynctest
from stig.client.errors import AuthError, ConnectionError
from stig.client.poll import RequestPoller
class TestRequestPoller(asynctest.ClockedTestCase):
def setUp(self):
self.mock_request_args = None
self.mock_request_kwargs = None
self.mock_request_calls ... |
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without ... |
from test_convert import fixture, parse_file, raises
from knittingpattern.convert.SVGBuilder import SVGBuilder
import io
BBOX = (-1, -2, 5, 10)
@fixture
def file():
return io.StringIO()
@fixture
def builder():
builder = SVGBuilder()
builder.bounding_box = BBOX
return builder
@fixture
def svg(buil... |
# © 2020 James R. Barlow: github.com/jbarlow83
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import threading
from abc import ABC, abstractmethod
from typing import... |
# -*- coding: utf-8 -*-
from decimal import Decimal
from collections import defaultdict
from shaibos.util.currency import amount_to_words
from shaibos.util.currency import currency_decimal_places
from shaibos.util.currency import round_to_decimal_places
from shaibos.util.currency import lb_exchange_rate
from shaibos.... |
#!/usr/bin/env python3
import multiprocessing
import random
import zmq
def compute():
return sum([random.randint(1, 100) for i in range(1000000)])
def worker():
context = zmq.Context()
work_receiver = context.socket(zmq.PULL)
work_receiver.connect("tcp://0.0.0.0:7139")
result_sender = context.sock... |
#-*- coding: utf-8 -*-
import urllib2
import simplejson as json
title = ['iTélé']
img = ['itele']
readyForUse = True
def list_shows(channel,folder):
shows = []
urls = {'http://service.itele.fr/iphone/topnews':'A la une',
'http://service.itele.fr/iphone/categorie_news?query=france'... |
#!/usr/bin/python
# Copyright(C) 2012-2020 Open Information Security Foundation
# 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, version 2 of the License.
#
# This program is distributed in the ... |
# Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Angle to Direction
==================
Demonstrate how to convert angles to direction strings.
The code below shows how to convert angles into directional text.
It als... |
"""
Django settings for finances project.
Generated by 'django-admin startproject' using Django 1.11.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.