gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding:utf-8 -*-
# --
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
from nagare.i18n import _
from nagare import ajax, component, presentation... | |
"""
FlexGet build and development utilities - unfortunately this file is somewhat messy
"""
import os
import sys
from paver.easy import *
import paver.virtual
import paver.setuputils
from paver.setuputils import setup, find_package_data, find_packages
sphinxcontrib = False
try:
from sphinxcontrib import paverutil... | |
"""
Create a GUID for all non-GUID database records. If record already has a GUID,
skip; if record has an ID but not a GUID, create a GUID matching the ID. Newly
created records will have optimistically generated GUIDs.
"""
import time
import collections
from framework.mongo import StoredObject
from website import m... | |
# Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
#
# This is a thin wrapper for native LD. This is not meant to be
# used by the user, but is called from pnacl-translate.
# This ... | |
"""Tests the singleton class of pyexperiment
Written by Peter Duerr
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import unittest
from itertools import count as count_up
from pyexperiment.utils.Singleton impor... | |
"""
Adapters for the cheat sheets from the Learn X in Y project
Configuration parameters:
log.level
"""
# pylint: disable=relative-import
from __future__ import print_function
import os
import re
from config import CONFIG
from .git_adapter import GitRepositoryAdapter
class LearnXinY(GitRepositoryAdapter):
... | |
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Literal,
Sequence,
TypeVar,
overload,
)
import warnings
import numpy as np
from pandas._libs import (
lib,
missing as libmissing,
)
from pandas._typing import (
ArrayLike,
AstypeArg,
DtypeObj,
... | |
'''
ModernGL extension
'''
import logging
import struct
import ModernGL
import numpy as np
import PIL as Pillow
__all__ = [
'set_default_context',
'load',
'image',
'show',
]
__version__ = '0.2.0'
log = logging.getLogger('ModernGL.ext.textools')
lookup_components = {
'L': 1,
'RGB': 3,
... | |
# encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import operator
import warnings
from django.utils import six
from haystack import connection_router, connections
from haystack.backends import SQ
from haystack.constants import DEFAULT_OPERATOR, ITERATOR_LOAD_PER_QU... | |
#
#
#
from __future__ import absolute_import, print_function, unicode_literals
from base64 import b64encode
from datetime import datetime, timedelta
from django.core.paginator import Page
from django.test import TestCase
from performant_pagination.pagination import PerformantPaginator
from performant_pagination.tests... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Submission', fields ['title']
db.delete_unique('challenges_submission', [... | |
# 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 required by applicable law or ... | |
# 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... | |
from flask import Blueprint
from CTFd.models import (
ChallengeFiles,
Challenges,
Fails,
Flags,
Hints,
Solves,
Tags,
db,
)
from CTFd.plugins import register_plugin_assets_directory
from CTFd.plugins.flags import FlagException, get_flag_class
from CTFd.utils.uploads import delete_file
fr... | |
import base64
import json
import os
import platform
from tempfile import NamedTemporaryFile
from unittest import TestCase, mock
import pytest
import responses
from semantic_release.errors import ImproperConfigurationError
from semantic_release.hvcs import (
Gitea,
Github,
Gitlab,
check_build_status,
... | |
"""
The MIT License (MIT)
Copyright (c) 2012-2014 Alexander Turkin
Copyright (c) 2014 William Hallatt
Copyright (c) 2015 Jacob Dawid
Copyright (c) 2016 Luca Weiss
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
... | |
# From https://github.com/magical/nlzss
# used http://code.google.com/p/u-lzss/source/browse/trunk/js/lib/ulzss.js as
# a guide
from sys import stderr
from collections import defaultdict
from operator import itemgetter
from struct import pack, unpack
class SlidingWindow:
# The size of the sliding window
size... | |
#gameheart.entities.forms
from django import forms
from django.contrib.admin import widgets
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from gameheart.entities.models import *
from gameheart.entities.... | |
"""
This module contains code for detection of doors.
"""
import freenect
import cv2
import numpy as np
import time
import serial
import math
import matplotlib.mlab as mlab
from matplotlib import pyplot as plt
import sys
sys.path.append('/usr/lib/python2.7/dist-packages')
__name__ = "Kinect"
DOOR_FLAG = False
DOOR_COU... | |
import turbogears
from ecrm.model import *
from turbogears import controllers, expose, flash,redirect,paginate,identity,widgets
import re
import logging,os,random,traceback,zipfile,shutil
from datetime import datetime
from ecrm.util.excel_helper import *
from cherrypy.lib.cptools import serveFile
import zlib
def expor... | |
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect, Http404, HttpResponse
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.exceptions ... | |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | |
# -*- coding: utf-8 -*-
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Neurongrouper
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Specials.Simulaters.Simulater"
DecorationModuleStr="ShareYourSystem.Standards.Classors.C... | |
# Copyright (c) 2014 Cisco Systems, 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 r... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.logger._legacy}.
"""
from time import time
import logging as py_logging
from zope.interface.verify import verifyObject, BrokenMethodImplementation
from twisted.trial import unittest
from twisted.python import conte... | |
"""
Module containing analysis functions for raster datasets.
"""
import itertools, operator
from .data import *
from . import manager
from .. import vector
import PIL.Image, PIL.ImageMath, PIL.ImageStat, PIL.ImageMorph
import math
# Zonal aggregation
def zonal_statistics(zonaldata, valuedata, zonalband=0, valueb... | |
#!/usr/bin/env python
# -*- coding: ascii -*-
u"""
==============
CSS Minifier
==============
CSS Minifier.
The minifier is based on the semantics of the `YUI compressor`_\\, which
itself is based on `the rule list by Isaac Schlueter`_\\.
:Copyright:
Copyright 2011 - 2021
Andr\xe9 Malo or his licensors, as appli... | |
#!/usr/bin/env python
#=============================================================================#
# #
# NAME: util_DB.py #
# ... | |
# Copyright 2017 Sunkari Preetham Paul. 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 applicab... | |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
Copyright (c) 2011 Tyler Kenendy <tk@tkte.ch>
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... | |
'''
Created on May 3, 2017
@author: jesper
'''
import itertools
import yaml
from symbol import comparison
from multiprocessing.forking import duplicate
from sqlalchemy.sql.functions import next_value
class AuditModule():
@staticmethod
def read(file):
pass
@staticmethod
def evaluate(info, yaml... | |
import time
from collections import OrderedDict
from cassandra.util import sortedset
from cassandra.query import SimpleStatement
from cassandra import ConsistencyLevel
from dtest import Tester
from tools import since
from assertions import (
assert_all,
assert_none,
assert_row_count,
assert_almost_equal... | |
import mock
from django.db import transaction
from django.test import RequestFactory
from django.http import Http404
from nose import tools as nt
from datetime import datetime, timedelta
from website.project.model import Comment
from admin.common_auth.logs import OSFLogEntry
from admin.spam.forms import ConfirmForm,... | |
# Copyright (c) 2013 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... | |
from unittest import TestCase
import threading
import time
import mock
from twitter_monitor import DynamicTwitterStream
class TestDynamicTwitterStream(TestCase):
def setUp(self):
# Mock tweepy.Stream
self.stream_patcher = mock.patch('tweepy.Stream')
self.MockTweepyStream = self.stream_pa... | |
# Copyright (c) 2010 Chris Moyer http://coredumped.org/
#
# 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, ... | |
from __future__ import absolute_import
from django.contrib.auth import authenticate
from django.contrib.sites.models import Site
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import PermissionDenied
from django.db import models
from django.utils.crypto import get_random_string... | |
# coding=utf-8
# Copyright 2022 The Tensor2Tensor 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... | |
"""
MIT License
Copyright (c) 2018 Chad Rosenquist
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, publis... | |
# Author: Kun Xi <kunxi@kunxi.org>
# License: Python Software Foundation License
"""
A Python wrapper to access Amazon Web Service(AWS) E-Commerce Serive APIs,
based upon pyamazon (http://www.josephson.org/projects/pyamazon/), enhanced
to meet the latest AWS specification(http://www.amazon.com/webservices).
This modu... | |
import pandas as pd
# If you'd like to try this lab with PCA instead of Isomap,
# as the dimensionality reduction technique:
Test_PCA = True
Test_K = True
Test_weights = True
def plotDecisionBoundary(model, X, y):
print("Plotting...")
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggp... | |
# 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... | |
# Copyright 2014 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 agre... | |
# -*- coding: utf-8 -*-
# Copyright 2014 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from __future__ import with_statement
import os.path
import re
import time
import sys
import lxml.html
from lxml.cssselect import CSSSe... | |
"""Support for interfacing with Monoprice Blackbird 4k 8x8 HDBaseT Matrix."""
import logging
import socket
from pyblackbird import get_blackbird
from serial import SerialException
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.component... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.robotframework
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for Robot Framework.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Copyright 2012 Nokia Siemens Networks Oyj
#
# Licensed under the ... | |
# Copyright 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 ... | |
# 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... | |
"""Helper methods to handle the time in Home Assistant."""
from __future__ import annotations
from contextlib import suppress
import datetime as dt
import re
from typing import Any, cast
import ciso8601
import pytz
import pytz.exceptions as pytzexceptions
import pytz.tzinfo as pytzinfo
from homeassistant.const impor... | |
"""
PRIMEDesigner15.py
A SOLUZION problem formulation
It is important that COMMON_CODE come
before all the other sections (except METADATA), including COMMON_DATA.
"""
# <METADATA>
SOLUZION_VERSION = "0.01"
PROBLEM_NAME = "PRIME Designer 2015"
PROBLEM_VERSION = "0.1"
PROBLEM_AUTHORS = ["S. Tanimoto", "Dennis Orzikh", ... | |
from __future__ import absolute_import
import os
import re
from OpenSSL import SSL
from netlib import http_auth, certutils, tcp
from .. import utils, platform, version
from .primitives import RegularProxyMode, SpoofMode, SSLSpoofMode, TransparentProxyMode, UpstreamProxyMode, ReverseProxyMode, Socks5ProxyMode
TRANSPARE... | |
# -*- coding: utf-8 -*-
import httplib as http
import logging
from bs4 import BeautifulSoup
from flask import request
from framework.mongo.utils import to_mongo_key
from framework.exceptions import HTTPError
from framework.auth.utils import privacy_info_handle
from framework.auth.decorators import must_be_logged_in
... | |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2010-2011 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/lice... | |
#!/usr/bin/env python
# Copyright (c) 2015 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 l... | |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: qrlbase.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refle... | |
import copy
import inspect
import logging
import sys
from future.backports.http.cookies import CookieError
from future.backports.http.cookies import SimpleCookie
from future.backports.urllib.parse import urlparse
from oic import oic
from oic.extension.oidc_fed import ProviderConfigurationResponse
from oic.oauth2 impor... | |
# Copyright (c) 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.
"""Runs an exe through Valgrind and puts the intermediate files in a
directory.
"""
import datetime
import glob
import logging
import optparse
import os... | |
#
# 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
# ... | |
"""
Includes functions for reading and writing graphs, in a very simple readable format.
loadgraph: reads from files
inputgraph: reads from terminal input / stdin
savegraph: writes to files
printgraph: writes to terminal / stdout
writeDOT: writes in .dot format; can be used for visualization.
The other functi... | |
"""Helpers for components that manage entities."""
from threading import Lock
from homeassistant import config as conf_util
from homeassistant.bootstrap import (prepare_setup_platform,
prepare_setup_component)
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_SCAN_INTERVAL... | |
import pytest
import pandas as pd
import numpy as np
from plotly.callbacks import Points, BoxSelector
from tardis.visualization.widgets.line_info import LineInfoWidget
from tardis.util.base import species_string_to_tuple
@pytest.fixture(scope="class")
def line_info_widget(simulation_verysimple):
line_info_widget ... | |
""" Code to grab the data from NeuroVault, and compute a map of
frequency of activation in the brain.
"""
# Authors: Chris Filo Gorgolewski, Gael Varoquaux
# License: BSD
import json
import urllib, os, errno
from urllib2 import Request, urlopen, HTTPError
import pandas as pd
from pandas.io.json import json_normalize
... | |
#!/usr/bin/env python
# we're using python 3.x style print but want it to work in python 2.x,
from __future__ import print_function
import re, os, argparse, sys, math, warnings, subprocess, threading, shutil
import tempfile
import platform
# make sure scripts/internal is on the pythonpath.
sys.path = [ os.path.abspa... | |
from __future__ import absolute_import
from typing import Optional, Tuple, Mapping, Any, Text
from django.utils.translation import ugettext as _
from django.conf import settings
from django.template.defaultfilters import slugify
from django.core.files import File
from django.http import HttpRequest
from jinja2 import ... | |
'''
Created on 14.04.2016
@author: Tobias
'''
import sklearn_helpers as skhelper
from stacking.stacking_model import *
import pandas as pd
import numpy as np
from time import strptime
import datetime
from collections import Counter
from sklearn import preprocessing, naive_bayes
from sklearn.neighbors.classification ... | |
# This file is part of beets.
# Copyright 2012, Adrian Sampson.
#
# 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, ... | |
# 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 ... | |
#
# 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... | |
#!/usr/bin/python2.4
#
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
import traceback
from zope.interface import implements
from twisted.trial.unittest import TestCase
from twisted.internet.defer import succeed, gatherResults
from twisted.web._stan import Tag
from twisted.web._flatten import flattenSt... | |
# Copyright (c) 2011-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 agre... | |
"""Iterative methods for solving linear systems"""
__all__ = ['bicg','bicgstab','cg','cgs','gmres','qmr']
import warnings
import numpy as np
from . import _iterative
from scipy.sparse.linalg._interface import LinearOperator
from .utils import make_system
from scipy._lib._util import _aligned_zeros
from scipy._lib._... | |
import logging
from datetime import datetime
from sqlalchemy import func
from sqlalchemy.orm import joinedload
from sqlalchemy.dialects.postgresql import JSONB, ARRAY
from aleph.core import db, schemata
from aleph.text import normalize_strong, string_value
from aleph.util import ensure_list
from aleph.model.collection... | |
"""
Copyright (C) 2013-2018 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
model_data.py
~~~~~~~~~~~~~~~~~~
Functionality to build the model-internal data array and process
time-varying parameters.
"""
import collections
import ruamel.yaml
import xarray as xr
imp... | |
##
## This file is a layer that sits between challenge.py
## and the R scoring code. It's purpose is to be an
## adaptor between generic code and scoring code specific
## to a given challenge question.
## Communication with R is through the RPy2 package.
############################################################
i... | |
import sys
import os
from PyQt4.QtSql import *
import ui_forms.ui_receiveform
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from sqlalchemy import *
from sqlalchemy.orm import *
from databaseschema import *
import modelsandviews
import genericdelegates
from functions import *
localTITLE = "Receiving"
#=======... | |
import os
import time
import numpy as np
import OpenGL.GL as gl
import OpenGL.GLU as glu
import OpenGL.GLUT as glut
import Image
import PIL.ImageOps as iops
from fos.core.utils import list_indices as lind
from os.path import join as pjoin
import fos.core.pyramid as pyramid
from dipy.core import track_metrics as tm
im... | |
#!/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 licen... | |
# -*- coding: utf-8 -*-
import json
import pytest
from hyper.cli import KeyValue
from hyper.cli import get_content_type_and_charset, main, parse_argument
from hyper.cli import set_request_data, set_url_info
from hyper.common.headers import HTTPHeaderMap
# mock for testing
class DummyUrlInfo(object):
def __init_... | |
"""
pywow wdb/dbc field types
"""
from structures.fields import *
##
# Core custom types for WDB/DBC files
#
class IDField(IntegerField):
"""
Integer field containing the row's ID
"""
def __init__(self, name="_id"):
IntegerField.__init__(self, name=name, primary_key=True)
class RecLenField(IntegerField):
""... | |
# Copyright 2021 The Kubeflow 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 applicabl... | |
from socket import socket
from socket import timeout
from thread import Threading
import Queue
import struct, sys, time
EA_SZ = 4
CMD_REQ = 0
CMD_RES = 1
BPHIT=0
GETBPS=1
SETBPS = 2
GETREGS = 3
SETREGS = 4
READMEM = 5
WRITEMEM = 6
IDA_CMD = 7
IDA_GETNAME=0
IDA_MAKECOMMENT=1
IDA_MAKEBYTE=2
IDA_MAKEWORD=3... | |
#-------------------------------------------------------------------------------
# Name: SCE_Python
# Purpose: find smallest value of criterium
#
# Author: VHOEYS
#
# Created: 11/10/2011
# Copyright: (c) VHOEYS 2011
#-------------------------------------------------------------------------------
#... | |
#!/usr/bin/python
import os
import numpy as np
import matplotlib.pyplot as pp
import time
def load_gains(cal_table):
dtype=[('time', 'f8'), ('a1', 'i4'), ('a2', 'i4'), ('cparam', 'c16', 2),
('paramerr', 'f8', 2), ('flag', 'i4',2), ('snr', 'f8', 2)]
tb.open(cal_table, nomodify=True)
gains = np.... | |
# Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
import unittest
from test import support
from random import random
from math import atan2, isnan, copysign
import operator
INF = float("inf")
NAN = float("nan")
# These tests ensure that complex math does the right thing
class ComplexTest(unittest.TestCase):
def assertAlmostEqual(self, a, b):
if isinsta... | |
"""wrapper for some git commands"""
import re
import subprocess
from mod import log
name = 'git'
platforms = ['linux', 'osx', 'win']
optional = False
not_found = "git not found in path, can't happen(?)"
# default git clone depth
clone_depth = 10
#---------------------------------------------------------------------... | |
# Copyright (c) 2014 Baidu.com, 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 o... | |
#!/usr/bin/python
#
# Copyright 2015 John Kendrick
#
# This file is part of PDielec
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied wa... | |
# Copyright (C) 2013 Jaedyn K. Draper
#
# 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... | |
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a sample controller
## - index is the default action of any application
## - user is required for authentication and authorization... | |
# Copyright 2010 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 requ... | |
# -*- encoding: UTF-8 -*-
"""Mardown Preview main."""
import sublime
import sublime_plugin
import os
import sys
import traceback
import tempfile
import re
import json
import time
import codecs
import cgi
import yaml
import textwrap
from collections import OrderedDict
from urllib.request import urlopen
from urllib.error... | |
# -*- coding: utf-8 -*-
'''Fabric tasks for the setup of some services.'''
import re
import tempfile
from fabric.api import env, hide, sudo, warn_only
from fabric.contrib.files import exists
from fabsetup.fabutils import checkup_git_repo_legacy, install_packages
from fabsetup.fabutils import needs_packages, task, r... | |
__author__ = 'Peter Shipley <peter.shipley@gmail.com>'
__copyright__ = "Copyright (C) 2013 Peter Shipley"
__license__ = "BSD"
# from xml.dom.minidom import parse, parseString
#from StringIO import StringIO
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import iselement
from ISY.IsyExceptionClass import ... | |
from __future__ import unicode_literals, print_function, division
import feedparser
import dataset
from twisted.internet.reactor import callLater
from threading import Thread
import twisted.internet.error
import logging
logger = logging.getLogger('module_rss')
DATABASE = None
updater = None
botref = None
config = {}
... | |
"""
Example manage.py script, which is responsible for providing a command-line
interface to application specific tasks, such as managing databases.
"""
import os
import sys
PROJECT_HOME = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(PROJECT_HOME)
from dateutil import parser
impor... | |
#!/usr/bin/env python
#
# Copyright 2017 Brocade Communications Systems, 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/... | |
import MySQLdb
class QueryBuilder():
"""
contiene le utilities per generare le queries da usare in interrogazioni
@note: il risultato del filtro e' ottenuto intersecando i risultati di un massimo di tre query con l'insieme delle anagrafiche derivante dalla selezione geografica:
in particolare viene eseguita una qu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.