src stringlengths 721 1.04M |
|---|
# Copyright (C) 2015-2020: The University of Edinburgh
# Authors: Craig Warren and Antonis Giannopoulos
#
# This file is part of gprMax.
#
# gprMax 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 Foundatio... |
#=================================================================================================================
# Structure of PyjAmaseis
#
# - IMPORTS
# - STATION INFORMATION USER INTERFACE CODE (class myFrame4)
# - SECONDARY OPTIONS UI WINDOW CODE (class selectionWindow)
# - CODE FOR FRAME WHICH APPEARS AT BOTTOM... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
GridNearest.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*************... |
"""
@name: Modules/Computer/Web/web_irrigation.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2016-2020 by D. Brian Kimmel
@note: Created on Aug 22, 2016
@license: MIT License
@summary:
"""
__updated__ = '2019-12-30'
# Import system type stuff
import os
# Import PyMh ... |
""" Extra math for implementing SVG on top of Kiva.
"""
import sys
from math import acos, sin, cos, hypot, ceil, sqrt, radians, degrees
import warnings
def bezier_arc(x1,y1, x2,y2, start_angle=0, extent=90):
""" Compute a cubic Bezier approximation of an elliptical arc.
(x1, y1) and (x2, y2) are the corners o... |
# -*- coding: utf-8 -*-
#
# Copyright © 2016 Mark Wolf
#
# This file is part of Xanespy.
#
# Xanespy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from copy import copy
import json
import argparse
from flask import Flask, render_template
import app_config
import app_utils
from app_utils import get_last_updated
from render_utils import make_context, smarty_filter, urlencode_filter
import slides
import static_app
imp... |
from celery.result import AsyncResult
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils.http import urlencode
class Progress:
def __init__(self, task, total, stage=None):
self.task = task
self._total = total
self._done = 0
self._stage = ... |
# Copyright 2014-2016 The Meson development 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 agree... |
# -*- coding: utf-8 -*-
import pywikibot, re, subprocess
from pywikibot import pagegenerators
import time, sys
start = time.clock()
args = pywikibot.handleArgs()
site = pywikibot.Site('it', 'wikipedia')
today = time.strftime("%Y%m%d")
if sys.argv[1] == "immagini_orfane_libere":
path = '/data/project/alessiobot... |
"""Provides a basic hand detector in depth images.
HandDetector provides interface for detecting hands in depth image, by using the center of mass.
Copyright 2015 Markus Oberweger, ICG,
Graz University of Technology <oberweger@icg.tugraz.at>
This file is part of DeepPrior.
DeepPrior is free software: you can redistribu... |
# coding: utf-8
"""Plotting library."""
from copy import deepcopy
from io import BytesIO
import numpy as np
from .basic import Booster, _log_warning
from .compat import GRAPHVIZ_INSTALLED, MATPLOTLIB_INSTALLED
from .sklearn import LGBMModel
def _check_not_tuple_of_2_elements(obj, obj_name='obj'):
"""Check objec... |
from django.db import models
from django.utils.safestring import mark_safe
from settings import FEINCMS_GRID_TOTAL_COLUMNS
class GridContent(models.Model):
grid_columns = models.PositiveSmallIntegerField('Columns', blank=True, null=True, help_text='How many columns of the total (%s) this content will span.' % FE... |
#!/usr/bin/env python
#============================================================================
# Copyright (c) Microsoft Corporation. All rights reserved. See license.txt for license information.
#============================================================================
import os
import sys
import tempfile
imp... |
# Copyright (C) 2011 Jason Anderson
#
#
# This file is part of PseudoTV.
#
# PseudoTV is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
import utils
import sdk
from sdk import exceptions as kexceptions
import unittest
import pytz
import time
import random
from datetime import datetime, timedelta
class Account(unittest.TestCase):
def test_retrieve_account(self):
account = sdk.Account(id=self.account.id)
account.refresh()
s... |
"""
The MIT License (MIT)
Copyright (c) 2014 Trustly Group AB
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... |
#!/usr/bin/env python3
#
# texworker.py -- background worker for flasktex
#
# This file is part of flasktex.
#
# Copyright (c) 2015, Boyuan Yang <073plan@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following con... |
import os
from nose.tools import assert_raises, assert_sequence_equal
import mitty.lib.vcfio as vio
import mitty.test
def test_basic():
"""I/O: Basic vcf loading."""
v = vio.load_variant_file(
os.path.join(mitty.test.example_data_dir, 'tiny.vcf.gz'), 'g0_s0',
os.path.join(mitty.test.example_data_dir, 't... |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib 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
#
# ... |
import argparse
import numpy as np
from rstools.utils.batch_utils import iterate_minibatches, merge_generators
from tqdm import trange
from A3C.a3c_ff import A3CFFAgent
from A3C.a3c_lstm import A3CLstmAgent
from common.networks import activations
from wrappers.gym_wrappers import Transition
from wrappers.run_wrappers... |
# Copyright 2018 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, s... |
# -*- coding: utf-8 -*-
import urllib.request
import time
import pymongo
import http.client
import re
def httpWrapper(url):
try:
data_raw = urllib.request.urlopen(url).read().decode('utf-8')
except:
return "NULL"
return data_raw
def getGirlName(data_raw):
matches = re.findall('名前[ ]+... |
import os
import urllib
import urllib2
import thread
if __name__ == '__main__':
URL = 'http://localhost:82/harmony/wk.cgi/harmony/execute'
FIELDS = {
'command' : 'harmonysite3_sync_price',
}
response = urllib2.urlopen(URL, urllib.urlencode(FIELDS))
print response.code, response.msg
print response.headers
p... |
# Copyright (C) 2003-2005 Peter J. Verveer
#
# 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 the above copyright
# notice, this list of conditions and the following d... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
import sys
import json
import os.path
import requests
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
url = os.path.expandvars(url)
resp = requests.get(url, params={'page':current_page, 'count': '-1'})
resul... |
from rest_framework import serializers
from django.contrib.auth.hashers import make_password
from rest_framework.exceptions import ValidationError
from django.contrib.auth import get_user_model
from common.serializers import JobSerializer
from job_auth.serializers import UserSerializer
from .models import(
Employer... |
import json
import mock
from django.test import TestCase
from django.urls.base import reverse
from seqr.views.apis.phenotips_api import phenotips_edit_handler, phenotips_pdf_handler
from seqr.views.utils.test_utils import _check_login, create_proxy_request_stub
class PhenotipsAPITest(TestCase):
fixtures = ['use... |
#
# 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 n... |
# -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Course',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_cre... |
# Copyright 2013: Mirantis 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 ... |
import numpy as np
from pytest import mark
from scipy.signal import correlate
from nitime.algorithms.spectral import dpss_windows as nitime_dpss_windows
from src.spectral.transforms import (Multitaper, _add_axes,
_auto_correlation, _fix_taper_sign,
... |
# Copyright (C) 2013 Haris K
# Ported from LALSimulation's LALSimInspiralSpinTaylorF2.c
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your opt... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/usr/bin/env python
# This document is part of FS_Nav
# https://github.com/geowurster/FS_Nav
# =================================================================================== #
#
# New BSD License
#
# Copyright (c) 2014, Kevin D. Wurster
# All rights reserved.
#
# Redistribution and use in source and binary f... |
# ===============================================================================
# Copyright 2018 gabe-parrish
#
# 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/licen... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='personal_objects',
fields=[
('key', models.Char... |
# -*- coding: utf-8 -*-
from functools import wraps
from django.core.exceptions import PermissionDenied
from django.contrib.auth.views import redirect_to_login
from django.shortcuts import redirect
from spirit.core.conf import settings
def moderator_required(view_func):
@wraps(view_func)
def wrapper(reques... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
w.tdays("2017-02-02", "2017-03-02", "")
w.tdays("2017-02-02", "2017-03-02", "Days=Weekdays")
w.tdays("2017-02-02", "2017-03-02", "Days=Alldays")
w.tdays("2017-02-02", "2017-03-02", "TradingCalendar=SHFE")
"""
import pandas as pd
from .utils import asDateTime
def down... |
#!/usr/bin/python3
# -*- coding_ utf-8 -*-
""" This program implements a renderer for LPO files. """
from PIL import Image, ImageDraw, ImageFont, ImageFilter # Python image library (Pillow)
from pntools import partialorder # LPO data structure
import math
import sys
import os
def calculate_size(lpo):
""" This fu... |
from __future__ import absolute_import, print_function, unicode_literals
from os import fork, kill, waitpid
from signal import SIGTERM
import socket
from time import sleep
from . import compat_six as six
class Event(dict):
""" Events are encoded as dicts with a header fieldname to
content-list map. Norm... |
"""Ambient render passes node plugin"""
import sys
import maya.OpenMaya as OpenMaya
import maya.OpenMayaMPx as OpenMayaMPx
nodeId = OpenMaya.MTypeId(0x0011EF6E)
def addNumAttr(attr, type, default, doc=""):
numAttr = OpenMaya.MFnNumericAttribute()
setattr(CoronaPassesNode, attr, numAttr.create(attr, attr, type... |
# BASE SETTINGS COMMON TO ALL ENVIRONMENTS
import os, sys, dj_database_url
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
""" Get the environment variable or return exception """
try:
return os.environ[var_name]
except KeyError:
error_msg = "Set the ... |
# -*- coding: utf-8 -*-
import collections
import numpy as np
import pytest
from pandas.compat import lrange
from pandas.core.dtypes.dtypes import CategoricalDtype
from pandas import Categorical, Index, isna
import pandas.util.testing as tm
class TestCategoricalMissing(object):
def test_na_flags_int_categori... |
import warnings
warnings.simplefilter(action="ignore", category=RuntimeWarning)
warnings.simplefilter(action="ignore", category=PendingDeprecationWarning)
import matplotlib as mpl
mpl.use('agg')
from matplotlib.testing.compare import compare_images
import os.path
from tempfile import NamedTemporaryFile
import hicexplor... |
# encoding: utf-8
import os,sys
reload(sys)
sys.setdefaultencoding( "utf-8" )
import gconf
import MySQLdb
# encoding: utf-8
import os,sys
reload(sys)
sys.setdefaultencoding( "utf-8" )
import gconf
import MySQLdb
class MySQLConnection(object):
"""docstring for MySQLConnection"""
def __init__(self, host,port,user,pas... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# Mzero - XBMC Plugin
# Canal para ver un vídeo conociendo su URL
# http://blog.tvalacarta.info/plugin-xbmc/Mzero/
#------------------------------------------------------------
from core import config
from core import logger
from cor... |
# 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 agreed to in writing, ... |
# -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: September 21, 2002
# Author: Francesc Alted
#
# $Id$
#
########################################################################
"""Classes for describing columns for ``Table`` objects."""
# Im... |
"""Copyright 2008 Orbitz WorldWide
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) 2015
#
# Augusto Lopez Dantas - augustold42@gmail.com
# Daniel Yang Chow - danielyc95@gmail.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... |
# coding: utf-8
"""Standard test images.
For more images, see
- http://sipi.usc.edu/database/database.php
"""
import os as _os
import numpy as np
from .. import data_dir
from ..io import imread, use_plugin
from .._shared._warnings import expected_warnings
from ._binary_blobs import binary_blobs
from .. import i... |
# -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... |
# Copyright (C) 2006-2007 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribute... |
#
# SpaceWire.py
# SpaceWire Module
#
# 2011/05/30 K. Sakai (sakai@astro.isas.jaxa.jp)
import socket
import struct
import sys
# SSDTP2 Control Flags
DataFlag_Complete_EOP = '\x00'
DataFlag_Complete_EEP = '\x01'
DataFlag_Fragmented = '\x02'
ControlFlag_SendTimeCode = '\x30'
ControlFlag_GotTimeCode = '\x31'
ControlFlag... |
# 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... |
#! /usr/bin/env python
#
# Copyright (C) 2001 Andrew T. Csillag <drew_csillag@geocities.com>
#
# You may distribute under the terms of either the GNU General
# Public License or the SkunkWeb License, as specified in the
# README file.
#
#
# This is a script which facilitates creation of versioned... |
# 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.
import os
import unittest
from telemetry import tab_test_case
from telemetry import util
from telemetry.inspector_timeline import InspectorTimeline
_SAM... |
"""
Basic building blocks for generic class based views.
We don't bind behaviour to http method handlers yet,
which allows mixin classes to be composed in interesting ways.
"""
from rest_framework import status
from rest_framework.response import Response
from rest_framework.settings import api_settings
class Create... |
# pylint: disable=anomalous-backslash-in-string, too-many-locals,
# pylint: disable=multiple-statements
"""
Module that abstract operations to handle Internet Explorer versions.
"""
import os
import platform
import re
import xml.etree.ElementTree as ET
import requests
from driloader.browser.exceptions import Brow... |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Violin Memory, 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
#
# ... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import os
import json
from cryptography.hazmat.primitives import serialization
from py_vapid import Va... |
#!/usr/bin/python
def simpleGenRandomNumber(n, llimit=0, ulimit=1):
import random
result = [random.uniform(llimit, ulimit) for i in xrange(n)]
return result
if __name__ == '__main__':
# For basic questions
# Basic #1
# In this part, the built-in Python functions would be used.
num_random =... |
'''
Copyright 2015 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 agreed to in ... |
import numpy as np
import xgboost as xgb
import json
rng = np.random.RandomState(1994)
class TestGPUTrainingContinuation:
def test_training_continuation(self):
kRows = 64
kCols = 32
X = np.random.randn(kRows, kCols)
y = np.random.randn(kRows)
dtrain = xgb.DMatrix(X, y)
... |
#!/usr/bin/env python
# Comunication.py, script that manages the communication with the databas,
# as requirement it needs that exist a file with the information of the database,
# which content is :
# host => name of the host
# data base => name of database
# user => user name
# password => keyword
#
# This file is ... |
# Copyright 2015-2016 Yelp 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 writin... |
"""
Benchmarks game inspired comparison of different implementations for a given language.
It doesn't really belong directly to the temci tool, but uses big parts of it.
It's currently in a pre alpha state as it's a part of the evaluation for my bachelor thesis
that I'm currently doing,
"""
import temci.utils.util as... |
import time
import binascii
import bsddb
import os.path
from petlib.ec import *
from petlib.ec import EcGroup, EcPt
from petlib.bn import Bn
import config as conf
def _make_table(start=conf.LOWER_LIMIT, end=conf.UPPER_LIMIT):
G = EcGroup(nid=713)
g = G.generator()
o = G.order()
i_t... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.test_runner import make_test_records
from erpnext.stock.doctype.item.item import WarehouseNotSet, ItemTemplat... |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from bs4 import BeautifulSoup
from django.core.urlr... |
#!/usr/bin/python
# -*- coding: latin-1 -*-
"""Setup script."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
import commonsdownloader
version = commonsdownloader.__version__
except ImportError:
version = 'Undefined'
classifiers = [
'Development... |
from functools import wraps
import sys
from .constants import OK, CREATED, ACCEPTED, NO_CONTENT
from .data import Data
from .exceptions import MethodNotImplemented, Unauthorized
from .preparers import Preparer
from .serializers import JSONSerializer
from .utils import format_traceback
def skip_prepare(func):
"""... |
from __future__ import print_function
import collections
import json
import logging
import os
import pickle
import pandas as pd
import numpy as np
from sklearn.model_selection import ShuffleSplit, KFold
import cellline_data
import drug_data
import response_data
from uno import loggerUno as logger
from uno import d... |
# -*- coding: utf-8 -*-
# try something like
#from ednet.ad import AD
#from ednet import Util, SequentialGUID, AppSettings, W2Py, Student
#from ednet import *
from ednet.ad import AD
from ednet.faculty import Faculty
from ednet.util import Util
from ednet.canvas import Canvas
from pytube import YouTube
import os
impo... |
from random import choice, randrange, shuffle
import numpy as np
# If the code is not Cython-compiled, we need to add some imports.
from cython import compiled
if not compiled:
from mazelib.generate.MazeGenAlgo import MazeGenAlgo
RANDOM = 1
SERPENTINE = 2
class DungeonRooms(MazeGenAlgo):
"""
This is a va... |
import sqlite3
import time
import joinlist
# the tables look like this:
# db name 'imaqtpie.db' (each channel in joinlist has its own .db)
# Table name chat (each db has one table named 'chat')
#___________________________________________________________________
# usr | mesg | id | flags | channel | ... |
"""
the BiasRobot class takes the full text of a clinical trial as
input as a robotreviewer.data_structures.MultiDict, and returns
bias information in the same format, which can easily be converted
to JSON.
there are multiple ways to build a MultiDict, however the most common
way used in this project is as a PDF binar... |
#!/usr/bin/python
# requirements
from termcolor import *
import uuid
from SIBLib import SibLib
from smart_m3.m3_kp import *
from virtualiser import *
import threading
import thread
#functions
def NewRemoteSIB():
# debug print
print colored("request_handlers> ", "blue", attrs=["bold"]) + "executing method " ... |
#!/usr/bin/python
import inkex
import inkscapeMadeEasy_Base as inkBase
import inkscapeMadeEasy_Draw as inkDraw
import math
class myExtension(inkBase.inkscapeMadeEasy):
def __init__(self):
inkex.Effect.__init__(self)
self.OptionParser.add_option("--myColorPicker", action="store", type="string", de... |
import mock
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from tastypie.test import ResourceTestCase
from .helpers.mixins import UsersMixin
from .helpers.factories import EventFactory
from ..models import Event, EventUpdate
from .. import ja... |
from bson.objectid import ObjectId
import json
class Editor(object):
def __init__(self, pymongo_object, collection, request_args, doc_id):
"""
:param pymongo_object:
:param collection:
:param request_args:
:param doc_id:
"""
self.mongo = pymongo_object
... |
import requests
import json
access_token='EAAMcWZCJ7Ui4BALHXjXKkizZANG5AhQZAL9buUS5KR6fX8YurTosJLmxTfP4WoZBiP8DFe8eqbJ2NplRPGLsve2xYIwwsbERTnX5pvsiRIvJ0So1TZAHmOHlUPVnzZCBjPdZBhkm8CBnYTV0eNjAwQiBVkroQGnaqgZD'
outfile=open("list.csv","w")
def text_cleaning(text):
text = text.encode('ascii', 'ignore').... |
"""
Export a model, loading in the moving averages and saving those.
"""
import argparse
import logging
import os
import pprint
import sys
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.python.framework import graph_util
import time
from config import parse_config_file
import model
de... |
# -*- coding: utf-8 -*-
import os
import re
import utils
from dispatchers import BaseDispatcher
BASH_SCRIPT_TEMPLATE='''#!/bin/bash'''
RE_ENV_PATTERN=re.compile(r'^.+?=.+?$')
CI_STAGES = [
'before_install', 'install',
'before_script', 'script',
'after_success', 'after_failure',
'before_deploy', 'de... |
#!/usr/bin/python
#
# Copyright (c) 2008-2019, The Tor Project, Inc.
# See LICENSE for licensing information.
#
# Hi!
# I'm redox.py, the Tor redocumentation tool!
# I am a horrible hack!
# I read the output of doxygen from stderr, and add missing DOCDOC comments
# to tell you where documentation should go!
# To us... |
def main():
hist_txt_to_json()
def hist_txt_to_json():
j = open('HistologyLesions.json', 'w')
j.write('{\n')
index = True
benign = False
with open('HistologyLesions.txt', 'r') as t:
tfile = t.readlines()
num_lesions = len(tfile)
global td # define globally for ece_extent... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2016, Nigel Small
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
"""This module provides the API endpoint to manage the missions for a drone. A mission is a
series of actions that can be loaded to a drone and executed automatically"""
# Import DroneKit-Python
from dronekit import Command, mavutil
import web
import logging
import traceback
import json
import requests
import APIServ... |
# Copyright 2018, The TensorFlow Federated 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... |
from django.db import models
class Musica(models.Model):
slug = models.SlugField(primary_key=True, max_length=100)
nome = models.CharField(max_length=255)
letra = models.TextField()
cifra = models.TextField()
info = models.TextField()
link_video = models.URLField(blank=True, null=True)
categorias = models.ManyT... |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from re import compile
def boolean(x):
if x in [True, 1, '1', 'true', 'True']:
return "true"
if x in [False, 0, '0', 'false', 'False']:
return "false"
raise ValueError
def i... |
from rest_framework.throttling import UserRateThrottle
from rest_framework.exceptions import PermissionDenied
from django.conf import settings
from django.contrib.sites.models import Site
class PerUserThrottlingRatePerGroup(UserRateThrottle):
def allow_request(self, request, view):
"""
Implement ... |
# Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 位运算符
print " & | ^ ~ << >>"
# 逻辑运算符
a = 10
b = 20
if (a and b):
print 'a and b = ', a and b
if (a or b):
print 'a or b = ', a or b
a = 0
if (not a):
print 'not a = ', not a
a = 21
b = 10
c = 0
# 赋值运算符
print "赋值运算符"
c = a + b
c += a
print "1 - c = ", c
c *=... |
#!/usr/bin/env python
# License - see UNLICENSE.md
"""
Simple python API to Singly
"""
import urllib
import urllib2
import urlparse
try:
import simplejson as json
except ImportError:
import json
class Service(dict):
"""Singly Service"""
def __init__(self, singly, name, dct):
"""Construct a... |
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.