gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/python
#
# Test suite for Optik. Supplied by Johannes Gijsbers
# (taradino@softhome.net) -- translated from the original Optik
# test suite to this PyUnit-based version.
#
# $Id: test_optparse.py,v 1.10 2004/10/27 02:43:25 tim_one Exp $
#
import sys
import os
import copy
import unittest
from cStringIO im... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# coding=utf-8
# 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 re
... | |
# a python implementation of a local web server which
# ... recognizes web form data from post requests
# ... and stores web form data in a mysql database.
# to run from root dir: `python software/start_local_web_server.py`
# source(s):
# + http://georgik.sinusgear.com/2011/01/07/how-to-dump-post-request-with-python/... | |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | |
#
# Copyright 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... | |
#!/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
"License");... | |
"""Create publication class and contain methods for data fetching."""
import time
import requests
import json
from snovault import (
collection,
load_schema,
calculated_property,
CONNECTION
)
from snovault.crud_views import (
collection_add,
item_edit,
)
from snovault.attachment import ItemWithA... | |
#PiRoCon - 4Tronix Initio - Motor Controller
#Martin O'Hanlon
#www.stuffaboutcode.com
import sys
import time
import RPi.GPIO as GPIO
#motor pins
MOTORAFWRDPIN = 19
MOTORABWRDPIN = 21
MOTORBFWRDPIN = 24
MOTORBBWRDPIN = 26
#encoder pins
MOTORAENCODERPIN = 7
MOTORBENCODERPIN = 11
#motor speed equivalents
# use this if o... | |
#!/usr/bin/python
import sys, os, re, platform
from os.path import exists, abspath, dirname, join, isdir
try:
# Allow use of setuptools so eggs can be built.
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
from distutils.extension import Extension
from ... | |
from api_lib import APITest
from publish import DefaultSigningOptions
class SnapshotsAPITestCreateShowEmpty(APITest):
"""
GET /api/snapshots/:name, POST /api/snapshots, GET /api/snapshots/:name/packages
"""
def check(self):
snapshot_name = self.random_name()
snapshot_desc = {u'Descript... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions for computing robust statistics using
Tukey's biweight function.
"""
import numpy as np
from .funcs import _expand_dims, median_absolute_deviation
__all__ = ['biweight_location', 'biweight_scale', 'biweight_midvariance... | |
#!/usr/bin/env python
"""Creates the Script menu.
To Do:
- add html help; note that this will have to be fed to ScriptWdg,
RO.ScriptWdg has no idea of TUI help
History:
2004-07-19 ROwen
2004-08-11 ROwen Modified for updated RO.Wdg.Toplevel.
2004-08-23 ROwen Added some diagnostic print statements (commented ou... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import click
from collections import OrderedDict
from concurrent.futures import ThreadPoolExecutor, as_completed
from dateutil.parser import parse as parse_date
from datetime import datetime, timedelta
import jsonschema
from requests.excepti... | |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import numpy as np
import random
import types
import nose
from six import BytesIO
import pickle
from nose.tools import assert_true, assert_false, assert_equal, assert_raises
from slicerator import Sli... | |
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now
from modelcluster.fields import ParentalKey
from wagtail.admin.edit_handlers import (FieldPanel, InlinePanel,
... | |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# CityParkingData represents the complete collection of parking lots
# pre-populated with "static" data where possible. The goal is to
# reduce api breakage due to html template changes or field format
# discrepancies by limiting the # of fields pulled dynamically.
class ParkingData:
def __init__(self):
se... | |
"""Base configuration implementation."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | |
import itertools
import datetime
import slugify
from django.views import generic
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core import urlresolvers, paginator
from django import http
from django.db.models import Q
from django.utils import timezone
from taggit.models import Tag
from rest_f... | |
# coding: utf-8
"""A shortcut to deploy a fresh modoboa instance."""
import getpass
import os
import shutil
import subprocess
import sys
try:
import pip
except ImportError:
sys.stderr.write("Error: pip is required to install extensions.\n")
sys.exit(2)
import django
from django.core import management
fr... | |
import os
import commands
from pUtil import tolog
class FileState:
"""
This class is used to set and update the current output file state dictionary.
When the job is running, the file fileState-<JobID>.pickle is created which contains
the current state of the output file dictionary
File state dicti... | |
## Compiled from /files/home/nholtz/work/git/structural-analysis/matrix-methods/frame2d/Frame2D/Frame2D_Output.ipynb on Sun Dec 10 13:13:42 2017
## DO NOT EDIT THIS FILE. YOUR CHANGES WILL BE LOST!!
## In [2]:
from salib import extend, NBImporter
from Tables import Table, DataSource
## In [3]:
from Frame2D_Base impor... | |
# 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 ... | |
# Copyright 2017, 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 agreed to in writing, ... | |
import talib
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier, ExtraTreesClassifier
import numpy as np
import pandas
def initialize(context):
set_symbol_lookup_date('2010-01-01')
# Parameters to be changed
context.model1 = RandomForestClassifier(n_estimators=300,
... | |
# Copyright (c) 2012 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 typing import Any, List, Set, Tuple, Type
from google.appengine.ext import ndb
from backend.common.models.cached_model import TAffectedReferences
from backend.common.models.district_team import DistrictTeam
from backend.common.models.event import Event
from backend.common.models.event_team import EventTeam
from ... | |
#################################################################
###############written by dkudrow 08/2010########################
#Reads all of the images in a directory, sorts them by Strehl
#Ratio or consecutive order, and stacks the specified top percent
#either aligned to a guide star or not, weighting if reques... | |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#*********************************************************#
# @@ScriptName: collectorfluentd.py
# @@Author: Fang.Li<surivlee@gmail.com>
# @@Create Date: 2013-12-05 14:21:57
# @@Modify Date: 2014-03-13 17:53:02
# @@Function:
#*************************************************... | |
#
# 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 (c) 2021 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 ap... | |
#!/usr/bin/env python3
#
# Copyright (c) 2015-2016 The Khronos Group Inc.
# Copyright (c) 2015-2016 Valve Corporation
# Copyright (c) 2015-2016 LunarG, Inc.
# Copyright (c) 2015-2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the... | |
# -*- coding: utf-8 -*-
import numpy as np
from scipy import sparse
from pygsp import utils
_logger = utils.build_logger(__name__)
@utils.filterbank_handler
def compute_cheby_coeff(f, m=30, N=None, *args, **kwargs):
r"""
Compute Chebyshev coefficients for a Filterbank.
Parameters
----------
f... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cherrypy
import htpc
import requests
from json import dumps
import logging
from cherrypy.lib.auth2 import require, member_of
from htpc.helpers import fix_basepath, striphttp
class Deluge(object):
session = requests.Session()
def __init__(self):
se... | |
from rsqueakvm import constants, storage_classes
from rsqueakvm.model.numeric import W_Float, W_SmallInteger, W_LargeIntegerWord, W_LargeIntegerBig
from rsqueakvm.model.variable import W_BytesObject
from .util import read_image, open_reader, copy_to_module, cleanup_module, InterpreterForTest, slow_test, very_slow_test... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for pytesmo.
This file was generated with PyScaffold 1.3, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
"""
import os
import sys
import inspect
from distutils.cmd impo... | |
from django.db.models import Q
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext_lazy as _
from django_filters import ChoiceFilter, MultipleChoiceFilter
from mapentity.filters import PolygonFilter, PythonPolygonFilter
from geotrek.... | |
import skimage.io as io
import numpy as np
import os
def pascal_segmentation_lut():
"""Return look-up table with number and correspondng class names
for PASCAL VOC segmentation dataset. Two special classes are: 0 -
background and 255 - ambigious region. All others are numerated from
1 to 20.
... | |
import logging
import re
from threading import Event, Thread
from urllib.parse import unquote_plus, urlparse
import websocket
from streamlink import logger
from streamlink.buffers import RingBuffer
from streamlink.plugin import Plugin, PluginError
from streamlink.plugin.api import useragents, validate
from streamlink... | |
# 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 ... | |
import tensorflow as tf
from networks.network import Network
from fcn.config import cfg
zero_out_module = tf.load_op_library('lib/triplet_flow_loss/triplet_flow_loss.so')
class custom_network(Network):
def __init__(self):
self.inputs = cfg.INPUT
# self.input_format = input_format
self.num... | |
#!/usr/bin/env python
"""usage: AntogniniAeberli.py [options] [params] [cityfile]
options:
-h, --help Show this help
-n, --no-gui Hide the Graphical User Interface during the problem resolution
-v, --verbose Show verbose informations during the generation of solution on the command line.
params:
-m VALUE, --m... | |
# coding=utf-8
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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/li... | |
#!/usr/local/bin/python3
"""
Copyright (c) 2017-2019 Ad Schellevis <ad@opnsense.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain th... | |
# Class definition:
# NordugridATLASExperiment
# This class is the ATLAS experiment class for Nordugrid inheriting from Experiment
# Instances are generated with ExperimentFactory via pUtil::getExperiment()
# import relevant python/pilot modules
from Experiment import Experiment # Main experiment class
from... | |
#! /bin/env python
"""
This is the BoccaCmd module
>>> b = BoccaCmd (".",package="my.package")
>>> b.full_name ("func")
'my.package.func'
>>> b.short_name ("my.package.func")
'func'
"""
import subprocess
import os
import sys
import shutil
import optparse
import tarfile
import commands
from types import *
pass_pre =... | |
"""
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | |
# Copyright (C) 2008 Jean-Michel Sizun <jm.sizun AT gmail>
#
# Copyright (C) 2008 Brent Woodruff
# http://www.fprimex.com
#
# Copyright (C) 2004 John Sutherland <garion@twcny.rr.com>
# http://garion.tzo.com/python/
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the ... | |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2015, Battelle Memorial Institute
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistribut... | |
# Copyright (c) 2019 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 appli... | |
"""
The MIT License (MIT)
Copyright (c) 2016 Stratos Goudelis
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, me... | |
# -*- test-case-name: twext.enterprise.dal.test.test_record -*-
##
# Copyright (c) 2015-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.apa... | |
"""
Copyright (c) 2012, Thomas M. Farrelly
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, distri... | |
# coding: utf-8
"""
flask_oauthlib.provider.oauth1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implemnts OAuth1 provider support for Flask.
:copyright: (c) 2013 - 2014 by Hsiaoming Yang.
"""
import logging
from functools import wraps
from werkzeug import cached_property
from flask import request, redirect, url_fo... | |
'''runstest
formulas for mean and var of runs taken from SAS manual NPAR tests, also idea
for runstest_1samp and runstest_2samp
Description in NIST handbook and dataplot doesn't explain their expected
values, or variance
Note:
There are (at least) two definitions of runs used in literature. The classical
definition ... | |
# 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... | |
#!/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
"License");... | |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import os... | |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Various utilities
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname(os.path.realpath(__file__))
>>> datadir = ... | |
import logging
from django.http import QueryDict
from rest_framework.response import Response
from rest_framework.exceptions import ValidationError
from rest_framework import status
from rest_framework import generics
from rest_framework import serializers
from hs_core import hydroshare
from hs_core.models import Co... | |
#!/usr/bin/env python3
import os
import sys
import re
import math
import platform
import xml.etree.ElementTree as ET
################################################################################
# Config #
#######################################... | |
import os
from copy import deepcopy
################################################################################
############################# IDENTIFICATION TREES #############################
################################################################################
class Classifier :
def __init__(sel... | |
# Copyright 2017 Ravi Sojitra. 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 (c) 2009-2012 Denis Bilenko. See LICENSE for details.
"""Synchronized queues.
The :mod:`gevent.queue` module implements multi-producer, multi-consumer queues
that work across greenlets, with the API similar to the classes found in the
standard :mod:`Queue` and :class:`multiprocessing <multiprocessing.Queue... | |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/colors.py
__version__=''' $Id: colors.py 3208 2008-02-13 11:23:55Z rgbecker $ '''
import string, math
from types import StringType, ListType, Tupl... | |
# Copyright 2016 Suzy M. Stiegelmeyer
#
# 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... | |
"""Testing configuration from CLI, env-vars and YAML files."""
from __future__ import absolute_import
import unittest
from collections import OrderedDict
import yaml
import mock
import pathlib2
from future.builtins import str
from rotest.common.config import Option, get_configuration, search_config_file
class Comm... | |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""CLI tests."""
from __future__ import absolute_import, print_function
import uui... | |
#!/usr/bin/python
# Licensed to Paul Querna under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | |
from . import ScattergramData
from .. import db
import os
import random
from datetime import datetime
import urllib.request, json
import requests
from requests.exceptions import HTTPError
from requests.auth import HTTPBasicAuth
import plotly.tools as tools
import plotly.plotly as py
import plotly.graph_objs as go
... | |
"""
This script first erases all the files in a target directory, and then
copies the necessary files to run Repy into it. Afterwards, the .mix
files in the target directory are ran through the preprocessor.
The target directory that is passed to the script must exist. It is
emptied before files are copied over.
... | |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | |
import codecs
import json
import mimetypes
import os
import time
from collections import OrderedDict
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template.defaultfilters import filesizeformat
from django.utils.encoding import smart_unicode
import commonware.log
import jinj... | |
# -*- coding: utf-8 -*-
#
# 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... | |
#########################################################################
""" wingdbstub.py -- Debug stub for debuggifying Python programs
Copyright (c) 1999-2001, Archaeopteryx Software, Inc. All rights reserved.
Written by Stephan R.A. Deibel and John P. Ehresman
Usage:
-----
This is the file that Wing DB use... | |
#!/usr/bin/env python
# Written by Irving Y. Ruan <irvingruan@gmail.com>
# 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 noti... | |
#by amounra 0513 : http://www.aumhaa.com
import Live
from _Tools.re import *
from _Framework.ControlSurfaceComponent import ControlSurfaceComponent
from Live8DeviceComponent import Live8DeviceComponent as DeviceComponent
from _Generic.Devices import *
class MonoDeviceComponent(DeviceComponent):
__doc__ = ' Class ... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for option in orm['questionnaire.questionoption'].objects.all():
option.UID = "O%d" % option.id
o... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
import copy
import os
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.patheffects as PathEffects
from matplotlib.patches import Circ... | |
from __future__ import division # This makes Python interpret / as float division.
from classes import *
from heuristic import *
from addition_module import *
from multiplication_module import *
from function_module import *
from random import randint
from math import floor, ceil
import timeit
start = timeit.default_t... | |
#!/usr/bin/python
# Copyright (c) 2013, Regents of the University of California
# 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 no... | |
# Copyright 2011-2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, 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/lic... | |
# Emitter expects events obeying the following grammar:
# stream ::= STREAM-START document* STREAM-END
# document ::= DOCUMENT-START node DOCUMENT-END
# node ::= SCALAR | sequence | mapping
# sequence ::= SEQUENCE-START node* SEQUENCE-END
# mapping ::= MAPPING-START (node node)* MAPPING-END
__all__ = ['Emitter', 'Emi... | |
# 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 appli... | |
#!/usr/bin/env python
# OSM to VISSIM converter
from vissim_objs import Vissim
import networkx as nx
from osm_to_graph import read_osm
from osm_to_graph import BusStopNode
from collections import OrderedDict
import geo_math as geo
import math
import vissim_v8 as vissim
import matplotlib.pyplot as plt
import numpy as np... | |
# 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 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 logging
import json
import urllib
import os
import sys
from threading import Thread
from twisted.internet import reactor
import requests
from bs4 import BeautifulSoup as bs4
from soupy import Soupy, Q
requests.packages.urllib3.disable_warnings()
log = logging.getLogger('giantbomb')
t =... | |
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ValidationError
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.db import models, transaction
from django.db.models import Count
from django.db.models.... | |
# encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
# -*- coding: utf-8 -*-
from __future__ import absolute_import, with_statement
__all__ = ['CurrencyHandler', 'TaxHandler', 'CategoryHandler', 'AssetHandler',
'AccountHandler', 'EquityHandler', '... | |
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
# NOTE: If you make changes to this file, be sure to restart Mr. Do!
import os
import shutil
import sys
import time
import conf
import g
from grax.access_level import Access_Level
#from grax.grac_manager i... | |
#!/usr/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/tools/docco/graphdocpy.py
"""Generate documentation for reportlab.graphics classes.
Type the following for usage info:
pytho... | |
# Copyright 2015, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 Yahoo! 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.or... | |
# Copyright 2013 Red Hat, 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 agre... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2011, Monash e-Research Centre
# (Monash University, Australia)
# Copyright (c) 2010-2011, VeRSI Consortium
# (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modificatio... | |
import re
from django.db.backends import BaseDatabaseIntrospection, FieldInfo
field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
def get_field_size(name):
""" Extract the size number from a "varchar(11)" type name """
m = field_size_re.search(name)
return int(m.group(1)) if m else No... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.