gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import pygame
from engine import *
from eventManager import *
class Label(Engine.GUI.Widget):
def __init__(self, text, textColor = None, backgroundColor = None, fontSize = None, padding = None, width = None, height = None, transparentBackground = True):
super().__init__()
self.textColor = textColo... | |
from collections import Counter
import math
import os
import pickle
import re
import string
import pysrt
import nltk
import numpy as np
from sklearn.feature_extraction import DictVectorizer
from sklearn.decomposition import PCA
from sklearn.feature_selection import VarianceThreshold
import sklearn.cross_validation
imp... | |
# -*- 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 o... | |
# -*- coding: utf-8 -*-
'''
Support for MacPorts under Mac OSX.
This module has some caveats.
1. Updating the database of available ports is quite resource-intensive.
However, `refresh=True` is the default for all operations that need an
up-to-date copy of available ports. Consider `refresh=False` when you are
sure ... | |
#
# Logger class
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import sys
import numpy as np
import collections
# Value types
_COUNTER = 0
_FLOAT = 1
_INT = 2
_TIME... | |
import cProfile
import datetime
import enum
import json
import logging
import os
import random
import re
import time
import itertools
import csv
class SetType(enum.Enum):
""" Types of set, i.e. training set
"""
ALL = "all"
QUERY = "query"
TEST = "test"
TRAIN = "train"
def get_session(gpu... | |
# Copyright (c) 2010-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 required by applicable law or agreed to ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding: utf-8
# Copyright 2014 Orange
#
# 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
#
# Un... | |
from flask import jsonify
import jsonrpclib
import socket
import struct
import urllib
from Maraschino import app
from maraschino.noneditable import *
from maraschino.tools import *
from maraschino import logger
xbmc_error = 'There was a problem connecting to the XBMC server'
@app.route('/xhr/play/<file_type>/<media_... | |
#! /usr/bin/env python
# Make sure that the script "sinfit_mod.py" is in the same directory as the data since it contains the fitting function.
# The script "multiple.py" is run by the command "python multiple.py datafile.txt". For running all output files from rvel, run the script "runall.py".
import sys
# from p... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
"""
Handles a single chunk of data (16x16x128 blocks) from a Minecraft save.
For more information about the chunck format:
https://minecraft.gamepedia.com/Chunk_format
"""
from io import BytesIO
from struct import pack
from math import ceil
import array
# Legacy numeric block identifiers
# mapped to alpha identifie... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# 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 L... | |
# Copyright 2014 LinkedIn Corp.
#
# 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.... | |
# coding=utf-8
# Copyright 2022 The Edward2 Authors.
#
# 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 o... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sub... | |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# 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 appl... | |
#!/usr/bin/python
"""
Copyright 2013 The Trustees of Princeton University
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 r... | |
import numpy as np
import matplotlib.pyplot as plt
import pylab
import joblib
import cPickle as cp
# t = np.arange(0, 5, 0.2)
# t2 = np.arange(0, 5, 0.02)
# def f(t):
# return np.exp(-t)*np.cos(2*np.pi*t)
def dice_np(y_true, y_pred):
y_true = y_true.reshape(y_true.shape[0], -1)
y_pred = y_pred.reshape(y_pred.s... | |
# http://docs.python.org/2/library/multiprocessing.html
from __future__ import print_function, division
import __common__
(print, print_, print_on, print_off,
rrr, profile, printDBG) = __common__.init(__name__, '[parallel]', DEBUG=False)
# Python
from itertools import izip
from os.path import exists, dirname, split
im... | |
# -*- coding: utf-8 -*-
# Copyright 2016 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 require... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Metaswitch Networks
# 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/LIC... | |
"""Query subclass used by Manager as default session query class.
"""
from math import ceil
from sqlalchemy import orm, and_, or_, inspect
from sqlalchemy.orm.strategy_options import Load
from pydash import py_
from ._compat import iteritems
__all__ = [
'Query',
'QueryModel',
'QueryProperty',
'Pagi... | |
# Copyright 2015 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... | |
import xml.dom.minidom
from PyQt5 import QtWidgets, QtCore, QtGui
from functions import button_functions
from ui.Ui_aboutwindow import Ui_aboutWindow
import logging
def create_eufar_xml(self, out_file_name):
logging.debug('eufar_metadata_xml.py - create_eufar_xml - starting...')
NAMESPACE_URI1 = "http://www.i... | |
from __future__ import print_function
from imblearn.under_sampling import RandomUnderSampler
from imblearn.over_sampling import SMOTE
from sklearn.model_selection import GroupShuffleSplit
from pyAudioAnalysis import audioBasicIO
from pyAudioAnalysis import MidTermFeatures as aF
import sys
import numpy as np
import os
i... | |
"""
Tests for Chandrasekhar recursions
Author: Chad Fulton
License: Simplified-BSD
"""
import numpy as np
import pandas as pd
from .results import results_varmax
from statsmodels.tsa.statespace import sarimax, varmax
from statsmodels.tsa.statespace.kalman_filter import (
MEMORY_CONSERVE, MEMORY_NO_LIKELIHOOD)
fro... | |
import numpy as np
from pymoab import core
from pymoab import types
from pymoab import topo_util
class StructuredMultiscaleMesh:
""" Defines a structured multiscale mesh representation.
Parameters
----------
coarse_ratio: List or array of integers
List or array containing three values indicat... | |
## @file
# This file is used to define common parser functions for meta-data
#
# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution.... | |
import json
import socket
import docker
import falcon
class CreateR(object):
"""
This endpoint is for creating a new filter
"""
def on_post(self, req, resp):
"""
Send a POST request with id/nic/interval/filter/iters and it will start
a container for collection with those spec... | |
import random
#I don't remember what these are doing...
card_color = lambda c: c[0]
card_value = lambda c: int(c[1])
tile_kind = lambda t: t[0]
tile_cost = lambda t: int(t[1],16)
tile_wall = lambda t: int(t[2],16) #1 = north, 2 = east, 4 = south, 8 = west
#'f' = fountain = starting tile, no scoring)
scoring = [{'f':[... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
A script that adds claims to Wikidata items based on a list of pages.
------------------------------------------------------------------------------
Usage:
python pwb.py claimit [pagegenerators] P1 Q2 P123 Q456
You can use any typical pagegenerator (like categories)... | |
"""
ui.turn.menu
Defines helper functions to build up the turn editor menu.
:author: Brandon Arrendondo
:license: MIT, see LICENSE.txt for more details.
"""
from PySide.QtGui import QAction
from PySide.QtGui import QActionGroup
def build_action_map(main_window):
action_map = {}
action_table... | |
#!/usr/bin/env python3
# Copyright 2016 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.
"""protoc plugin to create C++ reader/writer for JSON-encoded protobufs
The reader/writer use Chrome's base::Values.
"""
import os
i... | |
# Copyright 2015 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
#!/usr/bin/env vpython
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import datetime
import hashlib
import logging
import sys
import unittest
from parameterized import parameterized
import t... | |
# Copyright 2014 Ahmed El-Hassany
#
# 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 wri... | |
"""Implements actions used by doit tasks
"""
import subprocess, sys
import six
from six import StringIO
import inspect
from threading import Thread
from .exceptions import InvalidTask, TaskFailed, TaskError
def normalize_callable(ref):
"""return a list with (callabe, *args, **kwargs)
ref can be a simple cal... | |
#!/usr/bin/env python
import re
import struct
import logging
try:
import hashlib as md5
except ImportError:
import md5
try:
from Crypto.Cipher import ARC4
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
except ImportError:
AES = SHA256 = None
from . import arcfour as ARC4
from .... | |
"""
Technical Analysis Factors
--------------------------
"""
from __future__ import division
from numpy import (
abs,
average,
clip,
diff,
dstack,
inf,
)
from numexpr import evaluate
from zipline.pipeline.data import EquityPricing
from zipline.pipeline.factors import CustomFactor
from zipline... | |
#!/usr/bin/env python
#
# 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 "Lic... | |
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget
import sys, os, re
import traceback, platform
from PyQt4 import QtCore
from PyQt4 import QtGui
from electrum_arg import util
if platform.system() == 'Windows':
MONOSPACE_FONT = 'Lucida Console'
elif platform.s... | |
import os
import shutil
import tempfile
import warnings
import numpy as np
from vtk.numpy_interface import dataset_adapter as dsa
# VTK imports:
from vtk.util import numpy_support as nps
import PVGeo
from base import TestBase
# Functionality to test:
from PVGeo.ubc import (
GravObsReader,
TensorMeshAppender... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import o... | |
"""Graphviz's dot language parser.
The dotparser parses graphviz files in
dot and dot files and transforms them
into a class representation defined by pydot.
Author: Michael Krause <[email protected]>
Fixes by: Ero Carrera <[email protected]>
"""
from __future__ import division
from __future__ import print_funct... | |
"""Support for Google Calendar event device sensors."""
from __future__ import annotations
from datetime import timedelta
import logging
import re
from typing import cast, final
from aiohttp import web
from homeassistant.components import http
from homeassistant.const import HTTP_BAD_REQUEST, STATE_OFF, STATE_ON
fro... | |
import math
import re
import api.fake
from fuzzywuzzy import process
from flask import Blueprint, request, jsonify, render_template
from flask_weasyprint import HTML, render_pdf
from api.core import db
from api.utils import get_part_by_id, build_part_properties, is_number,\
check_addtl_info, get_items, get_item, de... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from bs4 import BeautifulSoup
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.http import QueryDict
from cms.api import add_plugin
from cms.toolbar.toolbar import CMSToolbar
from cms.uti... | |
"""
Functions for identifying peaks in signals.
"""
import numpy as np
from scipy.signal.wavelets import cwt, ricker
from scipy.stats import scoreatpercentile
def _boolrelextrema(data, comparator,
axis=0, order=1, mode='clip'):
"""
Calculate the relative extrema of `data`.
Relative ex... | |
#!/usr/bin/env python
# Copyright 2014 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.
"""Generate a spatial analysis against an arbitrary library.
To use, build the 'binary_size_tool' target. Then run this tool, passing
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create the data for the LSTM.
"""
import os
import sys
import argparse
import numpy as np
import h5py
import itertools
from collections import defaultdict
class Indexer:
def __init__(self, symbols = ["<pad>","<unk>","<s>","</s>"]):
self.vocab = defaultdict... | |
data = (
' ', # 0x00
', ', # 0x01
'. ', # 0x02
'"', # 0x03
'[JIS]', # 0x04
'"', # 0x05
'/', # 0x06
'0', # 0x07
'<', # 0x08
'> ', # 0x09
'<<', # 0x0a
'>> ', # 0x0b
'[', # 0x0c
'] ', # 0x0d
'{', # 0x0e
'} ', # 0x0f
'[(', # 0x10
')] ', # 0x11
'@', # 0x12
'X ', # ... | |
# 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:utf8 -*-
from __future__ import print_function
import os
import shutil
import android_tools
from build_commands import CompileCommand, IncAaptCommand, IncJavacCommand, IncDexCommand
from builder import IncrementalBuilder, Builder
from gradle_tools import get_project_info, GradleDirectoryFinder, GradleSyn... | |
"""
Module for a subscription object, which manages a podcast URL, name, and information about how
many episodes of the podcast we have.
"""
import collections
import datetime
import enum
import logging
import os
import platform
import time
from typing import Any, Dict, List, Mapping, Optional, Tuple, MutableSequence
... | |
# Authors: Alexandre Gramfort <[email protected]>
# Martin Luessi <[email protected]>
# Daniel Strohmeier <[email protected]>
#
# License: BSD (3-clause)
import numpy as np
from ..source_estimate import SourceEstimate, VolSourceEstimate
from ..source_spa... | |
"""
Implement the random and np.random module functions.
"""
from __future__ import print_function, absolute_import, division
import math
import os
import random
import numpy as np
from llvmlite import ir
from numba.extending import overload
from numba.targets.imputils import (Registry, impl_ret_untracked,
... | |
import database_hotel
import time
from date_type import *
import os
from prettytable import PrettyTable
import clients
clear = lambda: os.system('cls')
def menu(username):
"""
This function is what makes the actual reservations.
It searches for free rooms during a given period,
calculates every adde... | |
import redis
import simplejson
import time
import operator
from cryptokit import bits_to_difficulty
from gevent.event import Event
from powerpool.lib import loop
from powerpool.jobmanagers import Jobmanager
from binascii import hexlify
class MonitorNetworkMulti(Jobmanager):
defaults = config = dict(jobmanagers=N... | |
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = '[email protected] (Wesley Chun)'
from datetime import datetime, timedelta, time as timed
import j... | |
import json
import pytest
import os
from typing import ClassVar, Dict, List, Sequence, Tuple, Union
from kat.harness import sanitize, variants, Query, Runner
from abstract_tests import AmbassadorTest, HTTP, AHTTP
from abstract_tests import MappingTest, OptionTest, ServiceType, Node, Test
# The phase that we should ... | |
#!/usr/bin/env python
# a bar plot with errorbars
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse, Polygon
width = 0.97 # the width of the bars
font = {'family' : 'sans-serif',
'variant' : 'normal',
'weight' : 'light',
'size' : 13}
... | |
# Copyright 2012 Managed I.T.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <[email protected]>
#
# 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
#
# ... | |
# Copyright 2015 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 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... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from website.models import Question
from website.views.data_migration import migrate_organizationMember
class Migration(SchemaMigration):
def forwards(self, orm):
migrate_organ... | |
"""
Copyright 2015 Paul T. Grogan, Massachusetts Institute of Technology
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 applicabl... | |
#!/usr/bin/python
import numpy as np
from numpy import sin, cos, deg2rad, rad2deg
from numpy.linalg import norm
from kepler import julian_date, rvToElements, mu_sun, mu_earth
def dmsToDeg(dms):
"""Converts from deg:min:sec to decimal degree
:dms: list or tuple with degree, minute, second
:returns: angle... | |
# Copyright (C) 2014 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 agreed to ... | |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | |
from __future__ import absolute_import, division, print_function
import math
import itertools
import operator
import pytest
from datetime import datetime, date
import datashape
from collections import Iterator, Iterable
import blaze
from blaze.compute.python import (nunique, mean, rrowfunc, rowfunc,
... | |
# coding=UTF-8
'''
Copyright (c) 2010 openpyxl
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, di... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath,... | |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
# Copyright (C) 2013-2015 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... | |
from types import SimpleNamespace
from typing import Dict
from unittest.mock import MagicMock, patch
from django.http import HttpRequest
from django.http.response import HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.actions import do_rename_stream
from zerver.lib.exceptions import InvalidJSON... | |
#!/usr/bin/python
import datetime
import math
import os
import shutil
import sys
import time
import gpxpy
import numpy as np
try:
import pyexiv2
from pyexiv2.utils import make_fraction
except ImportError as e:
# pyexiv2 is not available in python 3. We catch the error
# so that py.test can load this m... | |
'''
Testing class for database API's archive related functions.
Authors: Ari Kairala, Petteri Ponsimaa
Originally adopted from Ivan's exercise 1 test class.
'''
import unittest, hashlib
import re, base64, copy, json, server
from database_api_test_common import BaseTestCase, db
from flask import json, jsonify
from exa... | |
#
# 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
# ... | |
# Copyright 2009-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005-2006 Christopher Lenz <[email protected]>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://... | |
# -*- coding: utf-8 -*-
"""
Global menus
"""
# Language Menu (available in all screens)
s3.menu_lang = [ T("Language"), True, "#"]
_menu_lang = []
for language in s3.l10n_languages.keys():
_menu_lang.append([s3.l10n_languages[language], False,
URL(r=request, args=request.args,
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import subprocess
import logging
VALID_TYPES = ['image/jpeg', 'image/gif', 'image/tiff', 'image/png', 'image/jp2', 'image/jpx', 'image/jpm']
INVALID_TYPES = ['application/pdf']
# Settings recommended as a starting point by Jon Stroop.
# See https://gr... | |
# Copyright 2014 The Oppia 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 applicable ... | |
# -*- coding: utf-8 -*-
"""
Written by Daniel M. Aukes
Email: danaukes<at>gmail.com
Please see LICENSE for full license.
"""
import pynamics
from pynamics.frame import Frame
from pynamics.variable_types import Differentiable,Constant
from pynamics.system import System
from pynamics.body import Body
from pynamics.dyadi... | |
# Copyright 2013 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... | |
#!/usr/bin/env python
# Authors:
# Trevor Perrin
# Marcelo Fernandez - bugfix and NPN support
# Martin von Loewis - python 3 port
#
# See the LICENSE file for legal information regarding use of this file.
from __future__ import print_function
import sys
import os
import os.path
import socket
import time
import ... | |
import json
import os
import sys
import unittest
if sys.version_info.major >= 3:
from io import StringIO
else:
from StringIO import StringIO
try:
import pathlib
except ImportError:
pass
import picogeojson as pico
from picogeojson import Serializer, Deserializer, DEFAULTCRS
from picogeojson.transforma... | |
#!/usr/bin/python
#======================================================================
#
# Project : hpp_IOStressTest
# File : Libs/IOST_Basic/__init__.py
# Date : Nov 05, 2016
# Author : HuuHoang Nguyen
# Contact : [email protected]
# : [email protected]
# License : MIT License
# Copyright ... | |
"""An interface for extending pandas with custom arrays.
.. warning::
This is an experimental API and subject to breaking changes
without warning.
"""
import operator
from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Union
import numpy as np
from pandas.compat import set_function_name
from pa... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time, os, tempfile
# from SimpleCV import Image, Color, Camera, ImageSet
from SimpleCV import *
from operator import add
import cv2
nbComponents = 0
dir_tmp = "static/test/treated/cam/"
def generateId():
global nbComponents
nbComponents += 1
return nbC... | |
# -*- 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This ... | |
#!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test addr relay
"""
from test_framework.messages import (
CAddress,
NODE_NETWORK,
NODE_WITNESS... | |
# 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... | |
"""
Application view.
"""
from datetime import datetime
from django.http import Http404
from django.shortcuts import render, redirect
from django.views.generic import View
from application.models import Application
from .forms import Step1RateForm, Step2RateForm, TerminateForm, ApproveForm
from .models import User
... | |
"""Git interface module for 'git-cvs'."""
import os
import time
import types
import shutil
import sys
from signal import signal, SIGHUP, SIGINT, SIGTERM, SIG_IGN
from subprocess import Popen, PIPE
from cvsgit.changeset import FILE_DELETED
from cvsgit.i18n import _
from cvsgit.error import Error
from cvsgit.utils imp... | |
# -*- coding: utf-8 -*-
"""
Enrich BEL graphs
=================
In the current build it is possible to enrich BEL graphs containing metabolites with associated
disease or protein information and to enrich BEL graphs containing disease or protein information with associated metabolites.
This can be done with the functi... | |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.