src
stringlengths
721
1.04M
from django.conf.urls import include, url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^populated_cities', views.populated_cities_query, name ='populated_cities'), url(r'^start_tour_cities', views.start_tour_cities, name ='start_tour_cities'), url(r'^stop_tour_cities...
from django.db import models from django.contrib.auth.models import User CAMPAIGN_TYPE = ( ('S', 'Standard'), ('P', 'Mini-Site'), ) STATUS = ( ('A', 'Active'), ('I', 'Inactive'), ) PCAMPAIGN_LINK = ( ('FB', 'Facebook Page'), ('TW', 'Twitter Page'), ('NOTE', 'Send us a Note'), ('WEB', ...
from pupa.scrape import Person, Scraper from openstates.utils import LXMLMixin from .util import get_client, get_url, backoff, SESSION_SITE_IDS HOMEPAGE_URLS = { "lower": ( "http://www.house.ga.gov/Representatives/en-US/" "member.aspx?Member={code}&Session={sid}" ), "upper": ( "h...
# 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 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ODB++ attribute parser """ __all__ = ["parse_attributes_from_line", "parse_attributes"] def parse_attributes_from_line(line): """ Given a pre-stripped line from a line record file, parse the attribute section. Returns a dict of numeric attr...
from __future__ import print_function from show3d_balls import * import argparse import os import random import numpy as np import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torc...
# https://leetcode.com/explore/challenge/card/january-leetcoding-challenge-2021/582/week-4-january-22nd-january-28th/3614/ # A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and # going in the bottom-right direction until reaching the matrix's end. # F...
# # known-value-test: Test against test vectors # Yawning Angel (yawning at schwanenlied dot me) # # Depends on obfsproxy for some utility stuff. # import obfsproxy.transports.obfs3_dh as obfs3_dh # # Test keypair x/X: # # The test vector specifies "... 756e" for x but this forces the UniformDH # code to return p - X...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # OpenBCI - framework for Brain-Computer Interfaces based on EEG signal # Project was initiated by Magdalena Michalska and Krzysztof Kulewski # as part of their MSc theses at the University of Warsaw. # Copyright (C) 2008-2009 Krzysztof Kulewski and Magdalena Michalska # ...
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
XXXXXXXXX XXXXX XXXXXX XXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX X...
import tempfile import pytest from django.core.management import call_command from postix.core.models import ListConstraint @pytest.yield_fixture def sample_member_file_ccc(): with tempfile.NamedTemporaryFile() as t: t.write( b"""chaos_number first_name last_name state 2 bezahlt 4 A B Verz...
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from aws import Action service_name = 'AWS ElastiCache' prefix = 'elasticache' AddTagsToResource = Action(prefix, 'AddTagsToResource') AuthorizeCacheSecurityGroupIngress = \ Action(prefix, 'Authoriz...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
"""dqutils.dq3.charsmall - The dictionary of small size characters. """ CHARMAP = { 0x00:"", 0x01:" ", 0x02:"/", 0x03:"゜", 0x04:"゛", 0x05:":", 0x06:"Ex", 0x07:"Lv", 0x08:"―", 0x09:"*", 0x0A:"ど", 0x0B:".", 0x0C:"あ", 0x0D:"い", 0x0E:"う", 0x0F:"え", 0x10:...
# Copyright 2010 The Go 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 the server part of the package dashboard. # It must be run by App Engine. from google.appengine.api import mail from google.appengine.api import memcach...
# GPL # Original Authors: Evan J. Rosky (syrux), Chichiri, Jace Priester # import bpy import random import math from bpy.types import ( Operator, Menu, ) from mathutils import ( Vector, Quaternion, ) # ################### ...
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------------------------------...
# User Configuration variable settings for pitimolo # Purpose - Motion Detection Security Cam # Updated - 20-Jun-2017 IMPORTANT - Required for pi-timolo.py ver 6.71 or Greater # Done by - Claude Pageau configTitle = "pi-timolo ver 6.71 Default Settings" configName = "config.py" #=====================================...
'''functions to work with contrasts for multiple tests contrast matrices for comparing all pairs, all levels to reference level, ... extension to 2-way groups in progress TwoWay: class for bringing two-way analysis together and try out various helper functions Idea for second part - get all transformation matrices ...
## \file ## \ingroup tutorial_roofit ## \notebook ## Basic functionality: adding boxes with parameters to RooPlots and decorating with arrows, etc... ## ## \macro_code ## ## \author Clemens Lange, Wouter Verkerke (C++ version) import ROOT # Set up model # --------------------- # Create observables x = ROOT.RooRealVa...
import nifty import numpy import nifty.segmentation import nifty.graph.rag import nifty.graph.agglo import vigra import matplotlib.pyplot as plt from random import shuffle #import fastfilters numpy.random.seed(32) Objective = nifty.graph.opt.lifted_multicut.PixelWiseLmcObjective2D class PlmcObjective2D(nifty.gr...
#!/usr/bin/env python #************************************************************************ # Codelet Tuning Infrastructure # Copyright (C) 2010-2015 Intel Corporation, CEA, GENCI, and UVSQ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
#!/usr/bin/python # Program to detect periodic payments and spot gaps in them import argparse import csv import datetime import os import qsutils # See notes in finconv.py for config file format secs_per_day = 24 * 60 * 60 def finperiodic_setup(app_data, input_format): return ['payee'], {} def finperiodic_row...
#!/usr/bin/env python2 # - * - coding=utf-8 - * - # Copyright (c) 2015, Sergiusz Bazanski <q3k@q3k.org> # Copyright (c) 2015, Remigiusz Marcinkiewicz <enleth@enleth.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the followi...
# Copyright (c) 2011 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 ...
import gdal class GDALCalculateArea: """ Problem: How do we compute zonal stats from a raster given only a bounding box from geoserver? Geoserver Bounding Box = [LEFT,BOTTOM,RIGHT,TOP] So, corner coordinates = A:(LEFT,TOP) B:(LEFT,BOTTOM) C:(RIGHT,BOTTOM) D:(RIGHT,TOP) * ------------------------> * ...
from objects.orobject import OrObject from collections import namedtuple from libbuiltin import typeof from objects.number import Number import objects.constants as constants import sys overrides = { "stdin": "", # oranj script - "count": "q", # in `who` "digits": "n", # csplit "exit": "x", "extrac...
from toee import * import tpdp def OnBeginSpellCast( spell ): print "Ray of Cluminess OnBeginSpellCast" print "spell.target_list=", spell.target_list print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level def OnSpellEffect( spell ): print "Ray of Clumsiness OnSpellEffect" def OnBeginRound( sp...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # Imports ===================================================================== import transaction from BTrees.OOBTree import OOBTree from BTrees.OOBTree import OOTreeSet from BTrees.OOBTree import intersection from zeo_connector impo...
# pkmin.py # # Copyright (C) 2014 Leo Osvald (leo.osvald@gmail.com) # # This file is part of PKMin. # # PKMin 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 opti...
# -*- coding: utf-8 -*- import json from nose.tools import eq_, ok_ from rest_framework.exceptions import ParseError from django.contrib.auth.models import AnonymousUser from django.test.client import RequestFactory from django.test.utils import override_settings import mkt from mkt.constants.applications import DEV...
# See LICENCE for the source code licence. # (c) 2010 Dan Saul from Base import Base SAVE_STATUS_SAVED = 0 # We can close this without losing data. SAVE_STATUS_NOT_SAVED = 1 # If we close this we will lose data, but we can save. SAVE_STATUS_NOT_SAVED_NEED_PATH = 2 # If we close this we will lo...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import logging from scrapy.conf import settings from scrapy.exceptions import DropItem import rethinkdb as r #class Pushfeed...
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class TrustProductsChannelEndpo...
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = "Stefan Mauerberger" __copyright__ = "Copyright (C) 2017 Stefan Mauerberger" __license__ = "GPLv3" ''' Save a plot of the discretization as PGF file ''' import numpy as np from matplotlib import pyplot as plt from plotting import rcParams, prepare_map from ...
import sys import argparse from itertools import izip def parseArgument(): # Parse the input parser=argparse.ArgumentParser(description=\ "Get the positions with the top scores and their scores") parser.add_argument("--bedFileNameList", required=True,\ help='File with list of bed files') parser.add_argument(...
# -*- 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...
"""Integration tests for Hover""" import json import re from unittest import TestCase from lexicon.tests.providers.integration_tests import IntegrationTestsV2 class HoverProviderTests(TestCase, IntegrationTestsV2): """TestCase for Hover""" provider_name = "hover" domain = "novuslex.com" domain_id = ...
"""sc2league URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
#! /usr/bin/env python # -*- encoding: utf-8 -*- # vim:fenc=utf-8: from mole.event import Event from mole.action import Action, ActionSyntaxError sort_asc = lambda x,y:cmp(x,y) sort_des = lambda x,y:cmp(y,x) class ActionSort(Action): """This action sort values in pipeline. :param `fields`: a :class:`list` w...
# 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 ...
# # rpclib - Copyright (C) Rpclib contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This lib...
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_...
# -*- coding: utf-8 -*- # pylint: disable=too-many-arguments,redefined-outer-name import copy import os import pytest import psutil import gevent from gevent import Greenlet from raiden.app import App from raiden.api.rest import RestAPI, APIServer from raiden.api.python import RaidenAPI from raiden.raiden_service imp...
from lixian import XunleiClient from lixian_commands.util import * from lixian_cli_parser import * from lixian_config import get_config import lixian_help from getpass import getpass @command_line_parser(help=lixian_help.login) @with_parser(parse_login) @with_parser(parse_logging) def login(args): if args.cookies =...
from slm_lab.agent import net from slm_lab.agent.algorithm import policy_util from slm_lab.agent.algorithm.sarsa import SARSA from slm_lab.agent.algorithm.dqn import DQN from slm_lab.lib import logger, util from slm_lab.lib.decorator import lab_api import numpy as np import torch logger = logger.get_logger(__name__) ...
# this one doesn't crawl the web, it just and only # takes xml from import os import psycopg2 import uni_to_beta import xml import xmlrpc connect_manu = psycopg2.connect("dbname=manu_tironis user=quellen password=quellen") manu_cursor = connect_manu.cursor() def get_raw_text(): pass def translate(raw_text): ...
# Copyright (C) 2010 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 ...
# Licensed under the GNU General Public License Version 2 # # 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 pro...
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from PyQt5.Qt import QAction from calibre.gui2.actions import InterfaceAction from calibre.gui2.dialogs.quickview import...
""" ------------------------ GILDAS CLASS file reader ------------------------ Read a CLASS file into an :class:`pyspeckit.spectrum.ObsBlock` """ from __future__ import print_function from astropy.extern.six.moves import xrange from astropy.extern.six import iteritems try: import astropy.io.fits as pyfits except I...
# Copyright (c) 2011-2021 Berkeley Model United Nations. All rights reserved. # Use of this source code is governed by a BSD License (see LICENSE). import csv from django.conf import settings from django.conf.urls import url from django.contrib import admin from django.urls import reverse from django.http import Http...
"""Service calling related helpers.""" import functools import logging # pylint: disable=unused-import from typing import Optional # NOQA import voluptuous as vol from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import HomeAssistant # NOQA from homeassistant.exceptions import TemplateError fro...
#-*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
import psycopg2 as dbapi2 class Author: def __init__(self,id, name, lastname, birthdate, nationality, penname,description,picture): self.id= id self.name= name self.lastname=lastname self.birthdate=birthdate self.nationality=nationality self.penname = penname ...
import random import traceback import itertools from base64 import b64decode as bd from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import toUnicode, ss, tryUrlencode from couchpotato.core.helpers.variable import tryInt, splitString from couchpotato.core.logger import CPLog...
"""Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ """ # Copyright (c) 2011 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause fro...
# Copyright 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 agreed to in...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import requests import time def alos_ql_downloader(): """Функция скачивает квиклуки для ALOS, используя в качестве исходных данных ссылки из 2х .txt-листов: main_links_filepath = основной файл со ссылками, auxl_links_filepath = резервный (на случай ...
# japanese_theme_base.py --- Traditional colors of Japan def parse_csv(s): result = dict() def modifier(x): if x[0] == "#": return x[1:] else: return result[x] ls = s.splitlines() for l in ls: ss = l.split(",") result[ss[0]] = modifier(ss[1]) ...
from django.conf.urls import url from views import BucketListsView, \ BucketListCreateView, BucketListUpdateView, \ BucketListDeleteView, BucketListDetailView, \ BucketListItemCreateView, BucketListItemUpdateView, \ BucketListItemDoneView, BucketListItemDeleteView urlpatterns = [ # bucket list...
from typing import Tuple, Optional from pathlib import Path import numpy as np import tensorflow as tf import gpflow from gpflow.config import default_float from gpflow.utilities import print_summary from gpflow.utilities import set_trainable from gpflow.likelihoods import Likelihood import tensorflow as tf import ...
import datetime import email import re import time import os from email.header import decode_header, make_header from imaplib import ParseFlags class Message(): def __init__(self, mailbox, uid): self.uid = uid self.mailbox = mailbox self.gmail = mailbox.gmail if mailbox else None ...
''' Created on Jul 12, 2012 @author: gillesB ''' from Window import Window from Workarea import Workarea class WindowTools(object): """ Some utilities for the windows """ @staticmethod def get_active_window(): """ Returns the active window :return: the active window ...
#! /usr/bin/env python # This script generates input files used to run MCMC from the shell prompt. # Preamble # -------- # To correctly execute this script, one needs to set the correct paths # to the source code. The paths are given as if the Python session # runs from a 'run/' folder at the same level than the rep...
#!/usr/bin/env python3 #******************************************************************************** # DynoSprite - scripts/sprite2asm.py # Copyright (c) 2013-2014, Richard Goedeken # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Attendance', fields=[ ('id', models.AutoField(s...
import copy import random from datetime import datetime import pytz from fedlearner.common import metrics, common from fedlearner.data_join.common import convert_to_str from fedlearner.common.common import convert_to_datetime class MetricStats: def __init__(self, raw_data_options, metric_tags): self._ta...
# initial helloworld attempt! import argparse # main def main(): parser = argparse.ArgumentParser() parser.add_argument('filearg', help='XML file') parser.add_argument('-macro', '-m', nargs='+', dest='macarg', help='macro string arg') args = parser.parse_args() print(args) #args_init() ''' De...
#!/usr/bin/env python3 import string, os, time, json, re, unicodedata, html.parser, requests # Bon appetit cafe hours api url url = "http://legacy.cafebonappetit.com/api/2/cafes" # How many cafeterias you want to parse (in order) totalCafes = 2393 # What our file should be named fileName = "data.json" # Parser to cl...
from datetime import datetime def convert_daynum_to_friendly(day_num): friendly_string = "" lastdigit = int(str(day_num[-1])) if lastdigit == 1 and day_num != 11: friendly_string = "st" if lastdigit == 2 and day_num != 12: friendly_string = "nd" if lastdigit == 3 and day...
''' Converts Program model to a image (graph) ''' import pygraphviz as pgv def stmts_to_str(title, types, ss): l = [title] if types: l.append(', '.join(['%s: %s' % x for x in types])) for (v, e) in ss: ls = str(e) ls = ls.replace(r'\n', r'\\n') ls = ls.replace(r'\r', r'\\r...
# http://stackoverflow.com/a/1336640 # http://creativecommons.org/licenses/by-sa/3.0/ import logging # now we patch Python code to add color support to logging.StreamHandler def add_coloring_to_emit_windows(fn): # add methods we need to the class def _out_handle(self): import ctypes return ct...
# Under MIT License, see LICENSE.txt from typing import Dict from Util import Position class Ball: def __init__(self, position=Position()): self._position = position self._velocity = Position() def update(self, new_dict: Dict): self.position = new_dict['position'] self.velo...
# Author: Jason Lu # 猜数字 age_of_oldboy = 56 guess_age = int(input("guess age:")) if guess_age == age_of_oldboy: print("Yes, you got it.") elif guess_age > age_of_oldboy: print("think smaller...") else: print("think bigger...") print("===============for语句================") count = 0 age_of_oldboy = 56 ...
import os import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from cv_core import engine, util from cv_gtk3.main_window import MainWindowFunctions from cv_gtk3.setting import GUISettings from cv_gtk3.signal_handlers import handlers from cv_gtk3.gtk_util import GTKUtilities class CardvaultGTK(...
import theano import theano.tensor as T import mlbase.network as N import h5py import numpy as np import mlbase.layers.activation as act import mlbase.loaddata as l from mlbase.layers import * import mlbase.cost as cost from skimage.measure import block_reduce def test_generative(): import mlbase.cost as cost ...
from datetime import timedelta, datetime from airflow import DAG from airflow.contrib.operators.bigquery_operator import BigQueryOperator from airflow.contrib.operators.bigquery_to_gcs import BigQueryToCloudStorageOperator from airflow.contrib.operators.gcs_to_bq import GoogleCloudStorageToBigQueryOperator from dags....
import numpy def obtain_matrix_from_quaternion(q: numpy.ndarray) -> numpy.ndarray: if q.size != 4: raise ValueError('Wrong number of elements on the array (q.size != 4)!') m = numpy.zeros((3, 3), dtype=numpy.float64) m[0, 0] = 1.0 - 2.0 * q[2] * q[2] - 2.0 * q[3] * q[3] m[0, 1] = 2.0...
#!/usr/bin/python ################################################################ # LiveQ - An interactive volunteering computing batch system # Copyright (C) 2013 Ioannis Charalampidis # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as...
""" MIT License Copyright (c) 2016 Sully Chen (https://github.com/SullyChen/Autopilot-TensorFlow) 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...
# Copyright (c) 2010-2014, GEM Foundation. # # NRML is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # NRML is distributed in t...
import json import time from calendar import timegm from datetime import datetime, timedelta from django.conf import settings from django.core import signing from django.urls import reverse from django.test import RequestFactory import jwt import mock from freezegun import freeze_time from rest_framework.exceptions ...
from __future__ import division import os from pymongo import MongoClient import numpy as np from moca.helpers import read_memefile, get_total_sequences from moca.helpers.db import create_binary_pickle, encode_image#, unpickle_numpy_array from moca.helpers import get_max_occuring_bases, search_files #from moca.helpers ...
# 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...
# Copyright (C) 2018 DataArt # # 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, ...
""" Created on 22/03/2013 @author: thom """ import random import math import logging from rdkit.Chem import AllChem as Chem from ULPS import Float_t import config class Kinetics2D(object): @classmethod def get_ke(cls, m, x, y): return 0.5 * m * (x * x + y * y) @classmethod def get_speed(...
"""Interface to a series of frequently used mirth shell commands. Project setup.py defines entry points for the functions below. """ import argparse import getpass import os import shutil import tempfile from pheme.util.config import Config from pheme.warehouse.mirth_channel_transform import TransformManager CHANN...
#!/usr/bin/python """ Fill color Takes 3 sets of arguments --file <filename> --base R,G,B # color to replace --fill R,G,B # color to fill """ import argparse import os import shutil import random def get_args(): parser = argparse.ArgumentParser() parser.add_argument('file', type=str, help='input voxel...
import os, sys, zipfile, time from modulegraph.find_modules import PY_SUFFIXES from modulegraph.modulegraph import os_listdir import macholib.util def os_path_islink(path): """ os.path.islink with zipfile support. Luckily zipfiles cannot contain symlink, therefore the implementation is trivial. ""...
# Importing helper class for setting up a reachability planning problem from hpp.corbaserver.rbprm.rbprmbuilder import Builder # Importing Gepetto viewer helper class from hpp.gepetto import Viewer rootJointType = 'freeflyer' packageName = 'hpp-rbprm-corba' meshPackageName = 'hpp-rbprm-corba' # URDF file describing t...
class Stack(): def __init__(self, arg = []): self.Q1 = arg self.Q2 = [] def stack_empty(self): if len(self.Q1) == 0 and len(self.Q2) == 0: return True else: return False def push(self, x): if self.stack_empty() is True: self.Q1.ap...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('uwadmin', '0004_auto_20150318_0034'), ] operations = [ migrations.AddField( model_name='publishrequest', ...
# # 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 us...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
#!/usr/bin/env python # 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 StringIO import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from testing...