src
stringlengths
721
1.04M
# coding=utf-8 ## # PopupControl. # <p> # Description of the test. # # @data INSTANCE_ID [String] instance id ## from qtaste import * import time javaguiMI = testAPI.getJavaGUI(INSTANCE_ID=testData.getValue("JAVAGUI_INSTANCE_NAME")) subtitler = testAPI.getSubtitler() def displayFirstPopup(): """ @step ...
#!/usr/bin/env python """ Reads audio data from the device through isochronous transfer. NOTE: Due to alignment or whatever, the data is not correct. Data size of the input endpoint is 170B, but the the actual data size is 6 * (3*2*4), the rest bytes are filled with zero. """ import usb.util import time ID_VENDOR = ...
import logging import numpy as np from ray.tune.schedulers.trial_scheduler import FIFOScheduler, TrialScheduler logger = logging.getLogger(__name__) class AsyncHyperBandScheduler(FIFOScheduler): """Implements the Async Successive Halving. This should provide similar theoretical performance as HyperBand but...
# Copyright (C) 2013 FlowKit Ltd from numpy import * from pylb import multi from pylb import lbio #def inivelfun(x, y, z, d): # """ v_x(x,y) = uMax*(1+.2*sin(y/ly*2pi)+.2*sin(z/lz*2pi)). v_y(x,y) = v_y(x,y)= 0 """ # return (d==0) * uLB * (1.0 + 1e-2 * sin(y/ly *2*pi) + # 1e-2 * si...
# -*- coding: utf-8 -*- # Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test the image_lib module.""" from __future__ import print_function import collections import gc import glob import os import...
# -*- coding: utf-8 -*- from earthquakes import app, db # from earthquakes import settings_production from earthquakes.models import Earthquake, NearestCity import os import logging import time import datetime import calendar import pytz from pytz import timezone from datetime import tzinfo, date import unittest import...
# """ # .. # >>> from djangorestframework.parsers import FormParser # >>> from djangorestframework.compat import RequestFactory # >>> from djangorestframework.views import View # >>> from StringIO import StringIO # >>> from urllib import urlencode # >>> req = RequestFactory().get('/') # >>> ...
# Record/replay test that boots a Linux kernel # # Copyright (c) 2020 ISP RAS # # Author: # Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> # # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. import os import logging import time from avocado im...
#!/usr/bin/env python """Module for setting up statistical models""" from __future__ import division from math import pi import numpy as np import pymc as mc import graphics import data_fds import external_fds def fds_mlr(): """PyMC configuration with FDS as the model.""" # Priors # FDS inputs: abs_coe...
# SPDX-License-Identifier: LGPL-3.0-only """Unit tests for the doorstop.core.types module.""" import unittest import yaml from doorstop.common import DoorstopError from doorstop.core.types import UID, Level, Prefix, Stamp, Text class TestPrefix(unittest.TestCase): """Unit tests for the Prefix class.""" # pyl...
# yselect - An RPM/Yum package handling frontend. # Copyright (C) 2006 James Bowes <jbowes@redhat.com> # Copyright (C) 2006 Devan Goodwin <dg@fnordia.org> # # 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 Fr...
# -*- coding: utf-8 -*- from decimal import Decimal from django.contrib.auth.decorators import login_required from django.db import connection from django.http import HttpResponse from django.http import JsonResponse from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ # Create yo...
# --------------------------------------------------------------------- # # Copyright (c) 2012 University of Oxford # # 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, incl...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Database setup script for VisualKopasu """ # This code is a part of visualkopasu (visko): https://github.com/letuananh/visualkopasu # :copyright: (c) 2012 Le Tuan Anh <tuananh.ke@gmail.com> # :license: GPLv3, see LICENSE for more details. import sys import os import ...
import mxnet as mx import numpy as np class EvalMetricWithSummary(mx.metric.EvalMetric): def __init__(self, name, output_names=None, label_names=None, summary=None, **kwargs): super().__init__(name, output_names=output_names, label_names=label_names, **kwargs) self.summary = summary self.g...
# -*- coding: utf-8 -*- # # test_connect_arrays.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 Lic...
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 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: # # 1. Redistributions of source code must retain the above copyri...
## # Copyright (c) 2010-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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
# -*- 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 #...
from django.contrib import messages from django.contrib.auth import get_user_model, login from django.urls import reverse from django.shortcuts import redirect, resolve_url from django.template.response import TemplateResponse from django.utils.translation import ugettext as _ from django.views.decorators.cache import ...
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
from datetime import datetime import string from uuid import UUID from django.core.management import BaseCommand from django.utils import timezone from agir.lib.mailtrain import update_person from agir.people.models import Person PADDING = "0000000-0000-0000-0000-000000000000" class Command(BaseCommand): help ...
# Copyright 2020 kubeflow.org. # # 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,...
# Copyright 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 logging import os import re import shutil import tempfile import unittest from telemetry.core import exceptions from telemetry import decorators from...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Payment' db.create_table(u'cowry_payment', ( (u'id', self.gf('django.db.models.f...
# vim:ts=4 sw=4 sts=4: import unittest from igraph import * from .utils import is_pypy try: import numpy as np except ImportError: np = None class EdgeTests(unittest.TestCase): def setUp(self): self.g = Graph.Full(10) def testHash(self): data = {} n = self.g.ecount() ...
#!/usr/bin/env python # -*- coding: utf-8 -*- class Graph: #inicia grafo com uma mapa de vértices def __init__(self, vertices): self.numVertices = len(vertices) self.adjList = {} #para cada vértice é criada uma lista de adjacência for vertice in vertices: self.adjList...
#!/usr/bin/env python # # Copyright 2010 Alexandre Fiori # based on the original Tornado by Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LIC...
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
#!/usr/bin/python3 import argparse import copy import cv2 import math import navpy import numpy as np import os import re import sys from props import PropertyNode import props_json from aurauas.flightdata import flight_loader, flight_interp sys.path.append('../lib') import transformations import correlate import ...
""" Base classes used by studio tests. """ from bok_choy.page_object import XSS_INJECTION from common.test.acceptance.fixtures.course import CourseFixture from common.test.acceptance.fixtures.library import LibraryFixture from common.test.acceptance.pages.common.auto_auth import AutoAuthPage from common.test.accepta...
def crazy(a, b, c): def fn(n): if n>b: return n-c return fn(a+ fn(a + fn(a + fn(a+n)))) return fn def crazy2(a, b, c): def fn(n): if n>b: return n-c s = 0 while n<=b: n += a s += 3 return n + s*(a-c) -c return fn def...
#!/usr/bin/env python # -*- coding: utf-8 -*- make_only_first_exam = False encrypt_exam = True import time import string import re #import py7zlib import subprocess import os import shelve import shutil from bio_info_questions import * from exam_settings import * import ParseStudentList mecs, names = Par...
#!/usr/bin/env python # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2018 NIWA # # 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 yo...
"""version 1.3.0 Revision ID: eb7141efd75a Revises: 430a70c8aa21 Create Date: 2016-01-06 13:38:46.918409 """ # revision identifiers, used by Alembic. revision = 'eb7141efd75a' down_revision = '430a70c8aa21' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from irma.common.utils....
from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers import Tokenizer from sumy.summarizers.lsa import LsaSummarizer as Summarizer from sumy.nlp.stemmers import Stemmer from sumy.utils import get_stop_words # summarizer requires this to work import nltk nltk.download('punkt') class ArticleSumma...
#! /usr/bin/python2.7 ''' Copyright (c) 2013, Nikola Wuttke 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 the above copyright notice, this list of condit...
from AppKit import NSObject, NSComboBox from objc import python_method from vanilla.vanillaBase import VanillaBaseControl class VanillaComboBoxDelegate(NSObject): _continuous = True @python_method def _callVanillaCallback(self, notification): obj = notification.object() target = obj.targ...
#!/usr/bin/env python """ Generate a small diff between two html documents. Does the following: 1. Diffs two html files to add `<ins>` and `<del>` tags 2. Generates a unified diff from the html diff against the original html documents The unified diff can be applied to the original html to generate the diff html. ""...
# # 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...
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2006-2006 Trolltech ASA. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## Licensees holding a valid Qt License Agreement may use this file in ## accordance...
#!/usr/local/bin/python # -*-coding:Utf-8 -* from modules.individualClass import Individual import random class NumberCouple(Individual): """NumberCouple class: represent one couple of real individual, inherits from the Individual class Properties: key : standardized representation of the problem [[x1, ...
#1 #v 0.001 import COMMON #file vars and functions for import/export processing import VIEWER #mainly for the toggles from VIEWER import __GL,__GLU#,__GLUT #GL functions ''' from COMMON import Scripts #Shapes (private) #Widgets (private) def Button(Text,X,Y,W,H,): pass def Browser(): import os Dir='C:/';...
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Starts Cohorte isolates using the boot script :author: Thomas Calmant :license: Apache Software License 2.0 :version: 1.1.0 .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file ex...
""" BungieAPI module """ import urllib2 import json import ConfigParser import os.path import sys CONFIG_FILE_NAME = '.bungie_destiny_api.rc' # API_KEY = <secret API key> # put a BungieNet API-KEY obtained from https://www.bungie.net/en-US/User/API # into a ini style file at $HOME/CONFIG_FILE_NAME. CONFIG_FILE = (...
# Copyright 2020 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 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
from App.UtilFuncs import fancify print fancify( """Character( root = ArticulatedRigidBody( name = "pelvis", meshes = [ (path.join(meshDir, "pelvis_2_b.obj"), colourDark), (path.join(meshDir, "pelvis_2_s.obj"), colourLight) ], mass = 12...
# This program 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. # # This program is distributed in the hope that it will be usefu...
"""aura URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/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-based ...
# coding=utf-8 # Copyright 2015 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 from colle...
from CellCycle.ChainModule.ListThread import * from start import loadSettings from start import loadLogger from CellCycle.MemoryModule.calculateSon import calculateSonId def add_check(): currentProfile = {"profile_name": "alessandro_fazio", "key_pair": "AWSCellCycle", "branch": "ListUtilities"} settings_to_l...
""" This is a middleware layer which keeps a log of all requests made to the server. It is responsible for removing security tokens and similar from such events, and relaying them to the event tracking framework. """ from __future__ import absolute_import import hashlib import hmac import json import logging import ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # relevant imports import sys import time import espresso import mpi4py.MPI as MPI import Tetracryst # Preparation of tetrahedral crystal and constuctions of bonds in tetrahedral liquid from espresso import Real3D, Int3D from espresso.tools import decomp from espresso.to...
import swantools.io import swantools.utils import swantools.plot import datetime import matplotlib.pyplot as plt import numpy as np def readtable(): R = swantools.io.SwanIO() P = swantools.plot.SwanPlot() # Reading TABLE dada with headers: df = R.read_swantable('data/table.txt') y = df["Hsig...
#!/usr/bin/python import math import sys import cjson import gflags import collections import sklearn.ensemble import random import time import re FLAGS = gflags.FLAGS gflags.DEFINE_string('csv', 'submission.csv', '') gflags.DEFINE_string('field', '', '') gflags.DEFINE_integer('limit', 100, '') gflags.DEFINE_bool('ex...
#!/usr/bin/env python # # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
from celery import shared_task from django.conf import settings from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model from django.contrib.sites.models import Site import requests from magiclink.models import MagicToken from .models import Ch...
"""Status model as merge semantics This provide a semantics for merge specs that is based on status models. Roughly speaking, a status model contain: * states (e.g. "NOT_PROVED", "TESTS_FAILED"); * for each status, a proof or a counterexample for this status. i.e. a list of messages from a tool explaining why this ...
#!/usr/bin/python from __future__ import absolute_import import argparse import datetime import os from pprint import pformat, pprint import re import svg2mod.svg as svg import sys #---------------------------------------------------------------------------- DEFAULT_DPI = 96 # 96 as of Inkscape 0.92 def main(): ...
""" Tests for the SignatureValidator class. """ from __future__ import absolute_import import ddt from django.test import TestCase from django.test.client import RequestFactory from mock import patch from lti_provider.models import LtiConsumer from lti_provider.signature_validator import SignatureValidator def get...
#!/usr/bin/env python # -*- coding: utf-8 -*- from os.path import join, dirname from setuptools import setup, find_packages def get_version(fname='kavahq/__init__.py'): with open(fname) as f: for line in f: if line.startswith('__version__'): return eval(line.split('=')[-1]) s...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Scan.show_report_time' db.add_column(u'scans', 'show_report_time', self.gf('django.db.mod...
#!/usr/bin/python # Copyright (C) 2012-2018 RIKEN R-CCS ## \file kmrfsplit.py KMR-Shell File Splitter. import sys import os import re from optparse import OptionParser ## Write part of the inputfile to outputfile. # @param ipath inputfile path. # @param opath outputfile path. # @startpos start position o...
# Copyright (c) 2014 Aubrey Barnard. This is free software. See # LICENSE.txt for details. # # Program and API for temporal score IMEDS method. from __future__ import print_function import argparse import collections import getpass import logging import os import re import shutil import socket import string import ...
import logging from django.conf import settings from django.template.defaultfilters import slugify from django.utils import timezone from huey.djhuey import db_periodic_task from huey.djhuey import crontab from huey.djhuey import db_task import pytz import requests import json import datetime from beerstatus import mo...
from re import compile import pytest from nerodia.exception import UnknownObjectException pytestmark = pytest.mark.page('non_control_elements.html') class TestHnExist(object): def test_returns_true_if_the_element_exists(self, browser): assert browser.h1(id='header1').exists is True assert brows...
""" Implement CourseTab """ # pylint: disable=incomplete-protocol # Note: pylint complains that we do not implement __delitem__ and __len__, although we implement __setitem__ # and __getitem__. However, the former two do not apply to the CourseTab class so we do not implement them. # The reason we implement the latter...
from time import time import logging import json from fluxghost import g logger = logging.getLogger("API.DISCOVER") def get_online_message(source, device): st = None doc = { "uuid": device.uuid.hex, "alive": True, "source": source, "serial": device.serial, "version":...
# from example.models import Entry, Comment # from rest_framework_json_api import serializers, views # from rest_framework_json_api.renderers import JSONRenderer # # # # serializers # class RelatedModelSerializer(serializers.ModelSerializer): # class Meta: # model = Comment # fields = ('id',) # #...
#!/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 copy import datetime import hashlib import os import posixpath import subprocess import sys import tempfile import unittest ...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Varnam library functions list """ # Varnam library functions list from .utils import * import ctypes as C #REMINDER: Change this for every major release of varnam LIBVARNAM_MAJOR_VERSION = 3 VARNAM_PATHS = ['','..','/usr/local/lib', '/usr/local/lib/i386-linux-gnu'...
import numpy as np import tempfile import tensorflow as tf import math import json import random import puka import pika import thread import time from simulator import LanderSimulator from mazeGame import mazeSimulator credentials = pika.PlainCredentials('test', 'test') parameters = pika.ConnectionPar...
from __future__ import unicode_literals import datetime import hashlib import random import re from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.db import models from django.template import RequestContext, TemplateDoesNotExist from django.template.loader import render_to...
import uuid EMPTY = 0 BLACK = 1 WHITE = -1 STATUS_EMPTY = 11 STATUS_WAITING = 12 STATUS_FIGHTING = 13 STATUS_SET = (STATUS_EMPTY, STATUS_WAITING, STATUS_FIGHTING) class Game(object): def __init__(self, host_id, host_name, guest_id=None, guest_name=None): self.host_id = host_id self.host_name = ...
from django.conf import settings from django.core.urlresolvers import resolve, Resolver404 from django.views.decorators.cache import never_cache from django.http import HttpResponse from django.shortcuts import get_object_or_404 from channelguide import util from channelguide.channels.models import Channel from chann...
# Authors: Simo Sorce <ssorce@redhat.com> # Alexander Bokovoy <abokovoy@redhat.com> # Martin Kosek <mkosek@redhat.com> # Tomas Babej <tbabej@redhat.com> # # Copyright (C) 2007-2014 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redist...
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
# -*- coding: utf-8 -*- """Base module for unittesting.""" from plone.app.testing import applyProfile from plone.app.testing import FunctionalTesting from plone.app.testing import IntegrationTesting from plone.app.testing import login from plone.app.testing import PLONE_FIXTURE from plone.app.testing import PloneSandb...
""" @package mi.dataset.driver.dosta_abcdjm.dcl.driver @file marine-integrations/mi/dataset/driver/dosta_abcdjm/dcl/driver.py @author Steve Myerson @brief Driver for the dosta_abcdjm_dcl Release notes: Initial Release """ __author__ = 'Steve Myerson' __license__ = 'Apache 2.0' from mi.core.common import BaseEnum fro...
# app.py import sys, os, logging from logging.handlers import RotatingFileHandler import os.path as op from flask import Flask, render_template from flask_sqlalchemy import SQLAlchemy from flask.ext.security import login_required, Security, SQLAlchemyUserDatastore, utils import flask_admin as admin from config import ...
#!/usr/bin/env python # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs telemetry benchmarks and gtest perf tests. This script attempts to emulate the contract of gtest-style tests invoked via recip...
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from django import forms from django.utils.text import slugify from suit_redactor.widgets import RedactorWidget from pebbles.models import ( Pebble, PebblePage, ) class PebblePageForm(forms.Form): title = forms.CharField( max_length=140, required=True, widget=forms.TextInput(attr...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import cstr, flt from webnotes.model.doc import addchild from webnotes.model.bean import getlist from webnotes i...
# Copyright (c) 2013 Alan McIntyre import warnings class KeyData(object): def __init__(self, secret, nonce): self.secret = secret self.nonce = nonce class KeyHandler(object): '''KeyHandler handles the tedious task of managing nonces associated with a BTC-e API key/secret pair. The g...
## \example rmf/link.py # This example is like module/rmf/pdb.py except that instead of creating a # new hierarchy from the rmf file, it simply links the existing hierarchy # to the file. This mechanism can be used for loading multiple # conformations for scoring or other analysis without having to set up # restraints ...
# inGraph (https://www.netways.org/projects/ingraph) # Copyright (C) 2011-2012 NETWAYS GmbH # # 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 optio...
__author__ = 'aarongary' import sys import pymongo import requests import MyGeneInfo from itertools import islice from app.util import set_status, create_edges_index from app.status import Status from bson.json_util import dumps from models.TermResolver import TermAnalyzer import ElasticSearch import os from sklearn.l...
from operator import or_ from pychess.Utils.const import * #from pychess.Utils.lutils.lmove import RANK, FILE from bitboard import * def RANK (cord): return cord >> 3 def FILE (cord): return cord & 7 ################################################################################ #######################################...
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # OpenModes - An eigenmode solver for open electromagnetic resonantors # Copyright (C) 2013 David Powell # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
"""Radiance base command.""" from ... import config from abc import ABCMeta, abstractmethod, abstractproperty import os import subprocess try: basestring except NameError: basestring = str # TODO: Implement piping as on option class RadianceCommand(object): """Base class for commands.""" __metaclass...
# ################################################### # Copyright (C) 2008-2017 The Unknown Horizons Team # team@unknown-horizons.org # This file is part of Unknown Horizons. # # Unknown Horizons is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
import os import pandas as pd def read_synchronisation_file(experiment_root): filepath = os.path.join(experiment_root, "labels", "synchronisation.csv") return pd.read_csv(filepath) def convert_timestamps(experiment_root, timestamps, from_reference, to_reference): """ Convert numeric timestamps (seco...
#from django.contrib.auth.models import User, Group from rest_framework import filters, generics from .serializers import ( UserSerializer, ForumSerializer, TopicSerializer, PostSerializer, ) class UsersReadView(generics.ListAPIView): serializer_class = UserSerializer model = serializer_class.M...
"""delete a flashcard set""" from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import input from builtins import str from future import standard_library standard_library.install_aliases() from .base import ...
""" Handle parsing the RSS feed. """ from datetime import datetime import logging import re import feedparser from gathernews.template import ITEM logger = logging.getLogger(__name__) def get_source(fp: feedparser.FeedParserDict()) -> str: try: return fp['feed']['title_detail']['base'] except Exce...
# GUI for painting colors onto the fractal import gtk import dialog import browser import utils def show(parent,f): PainterDialog.show(parent,f) class PainterDialog(dialog.T): def show(parent, f): dialog.T.reveal(PainterDialog, True, parent, None, f) show = staticmethod(show) def __ini...
from django import forms from django.contrib.auth import authenticate from django.contrib.auth.forms import UserCreationForm from django.core.exceptions import ValidationError from django.contrib.auth.models import User from profiles.models import CustomUser, UserLocation class LoginForm(forms.Form): username = f...
# Michael A. Alcorn (malcorn@redhat.com) # An implementation of the Deep Semantic Similarity Model (DSSM) found in [1]. # [1] Shen, Y., He, X., Gao, J., Deng, L., and Mesnil, G. 2014. A latent semantic model # with convolutional-pooling structure for information retrieval. In CIKM, pp. 101-110. # http:/...