src
stringlengths
721
1.04M
# coding=utf-8 from collections import namedtuple, Counter from collections import deque from collections import defaultdict import os import sys try: from collections import OrderedDict except ImportError: # python 2.6 or earlier, use backport from ordereddict import OrderedDict __author__ = 'xubinggui' ...
from sqlalchemy.exc import IntegrityError from tests.api_tests import APITestBase from tests.models_tests import ModelsTestBase from test_models.basekit import BaseKitBrand, BaseKitSite from test_models.core import User from hoops.common import BaseModel import time class TestBaseKitUserModel(ModelsTestBase): de...
# Copyright 2017 Eficent Business and IT Consulting Services S.L. # (http://www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, models class LocationAccuracyReport(models.AbstractModel): _name = "report.stock_location_accuracy" _description = "Locati...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
from chanutils import get_doc, select_all, select_one, get_json from chanutils import get_attr, get_text, get_text_content from playitem import PlayItem, PlayItemList, MoreEpisodesAction _FEEDLIST = [ {'title':'Popular', 'url':'http://www.itv.com'}, {'title':'All Shows', 'url':'http://www.itv.com/hub/shows'}, {'...
# Copyright (c) 2010 Red Hat Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of GP...
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-04-13 19:46 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
#!/usr/bin/env python # -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (C) 2009-2010 Nicolas P. Rougier # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #---------------...
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 (a...
# analog_sensors.py # author: Valerio De Carolis <valerio.decarolis@gmail.com> # date: 2013-10-30 # license: MIT import sys import os import time import signal import serial from serial import Serial, SerialException # default serial configuration DEFAULT_CONF = { 'port': '/dev/ttyACM3', 'baudrate': 57600, 'b...
import tweepy import json,re,sys # Authentication details. To obtain these visit dev.twitter.com consumer_key = 'ufulV3imKoYNzdh58LotTC1YD' consumer_secret = '2A781ma736HTenAXXYn9tRIelQYJkbCqY0GLi7W71ZwwDmNU59' access_token = '2564905075-MY9osfHabaRnonQVHHhHeA1vCLSOhuHWjBNBiIY' access_token_secret = 'JsD8Woc7i...
from __future__ import absolute_import from django.http import Http404 from mock import patch from sentry.testutils import TestCase from sentry.api.bases.sentryapps import ( SentryAppPermission, SentryAppBaseEndpoint, SentryAppInstallationPermission, SentryAppInstallationBaseEndpoint, add_integrat...
import gym import os import sys import numpy as np import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from gym import wrappers from datetime import datetime from sklearn.pipeline import FeatureUnion from sklearn.preprocessing import StandardScaler from sklearn.kernel_approximation...
""" Django settings for web project. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import...
# -*- coding: utf-8 -*- __author__ = 'degibenz' from aiohttp import web from aiohttp.web import json_response from models.client import Client, ObjectId from core.middleware import check_auth __all__ = [ 'ClientInfo', 'CreateClient', 'AuthClient', 'DeleteClient' ] class ClientInfo(web.View): @c...
# # This file is part of LiteSPI # # Copyright (c) 2020 Antmicro <www.antmicro.com> # SPDX-License-Identifier: BSD-2-Clause import enum class CFIManufacturerIDs(enum.Enum): """Manufacturer IDs from the CFI standard. Common Flash Interface (CFI) is a standard introduced by the Joint Electron Device Engin...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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...
# Copyright (C) 2006-2007 Red Hat, Inc. # Copyright (C) 2008 One Laptop Per Child # Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/> # # 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 Foundati...
""" Test breakpoint names. """ import os import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class BreakpointNames(TestBase): mydir = TestBase.compute_mydir(__file__) NO_DEBUG_INFO_TESTCASE = True @add_test_categories(['pyapi']...
''' This is our main file ''' import random from Player import Player def intro(): #intro to the GAME print('Good morning') input('What a weird dream you woke from, huh? PRESS ENTER') input('Maybe once you open your eyes ... PRESS ENTER') input('You will see something IS a little off ... PRESS ENTER')...
# This file is a minimal clang-format vim-integration. To install: # - Change 'binary' if clang-format is not on the path (see below). # - Add to your .vimrc: # # map <C-I> :pyf <path-to-this-file>/clang-format.py<cr> # imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr> # # The first line enables clang-fo...
import pygame from pygame.locals import * class EventEngine: """ Reads the event queue and passes events to other engines @author: James Heslin (PROGRAM_IX) """ def __init__(self, i_e): """ Takes an InputEngine and passes all relevant events to it @type i_...
# -*- coding: utf-8 -*- ## #Typical interfaces definition. # #Here we're just trying to make some typical interface definitions #to better test the doxypypy filter. # from zope.interface import Interface, Attribute # Public API Interfaces ## # The zeroth sample interface. # # Nothing special, just a sample in...
from __future__ import print_function from __future__ import division from future import standard_library standard_library.install_aliases() from builtins import range, zip from past.utils import old_div import urllib.parse import future import future.utils import numpy as np import pandas as pd from pyquery import P...
# size limit at 1280x1280 # http://maps.googleapis.com/maps/api/staticmap?size=500x500&path=color:0x000000|weight:10|44.35789,11.3093|44.4378,11.3935&format=GIF&maptype=satellite&scale=2 import os import sys import subprocess import platform from xml.sax import saxutils, parse, handler if __name__ == '__main__': ...
# Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: ...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt """Use blog post test to test permission restriction logic""" import frappe import frappe.defaults import unittest from frappe.core.page.user_properties.user_properties import add, remove, get_properties, clear_rest...
# discoursegraphs.readwrite: input/output functionality """ The ``readwrite`` package contains importers, exporters and other output functionality. Basically, it allows you to convert annotated linguistic documents into a graph-based representation for further processing. """ from discoursegraphs.readwrite.anaphorici...
# coding=utf8 """ Make install_date in source consistant with binaries @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2015, Mark Hymers <mhy@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it and/or modify # it under the te...
import os, xbmc, xbmcgui, utils import GoogleMusicApi class GoogleMusicActions(): def __init__(self): self.icon = utils.addon.getAddonInfo('icon') self.song_url = utils.addon_url+"?action=play_song&song_id=%s&title=%s&artist=%s&albumart=%s" self.api = GoogleMusicApi.GoogleMusicA...
""" PythonDBAGraphs: Graphs to help with Oracle Database Tuning Copyright (C) 2016 Robert Taft Durrett (Bobby Durrett) 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...
from keys import * from simulation_params import * import nest import numpy.random as random # Neuron parameters hh_neuronparams = {'E_L': -70., # Resting membrane potential in mV 'V_T': -63., # Voltage offset that controls dynamics. # -63mV ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # toyblock documentation build configuration file, created by # sphinx-quickstart on Mon Sep 4 12:31:07 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # a...
#!/usr/bin/python # coding:utf-8 #211 #svn 目录为/var/svn 模式http:// 钩子网站目录为/var/usr/local/apache2/htdocs/ import socket, threading, os, re, MySQLdb, random import sys, os, time, atexit, string from signal import SIGTERM import ConfigParser class Daemon: def __init__(self, pidfile, stdin='/dev/null', stdout='/dev...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2013 jno <jno@pisem.net> # Copyright 2016 Dmitry Nezhevenko <dion@dion.org.ua> # # Version: 0.3 # # 0. You can make me happy with https://www.dropbox.com/referrals/NTE2ODA0Mzg5 # 1. Most of the code was taken from cli_client.py. The ftpsbackend.py w...
#!/usr/bin/env python from cement.core import foundation, controller from lib import get_backend, set_backend from monitor import * from pprint import PrettyPrinter pprint = PrettyPrinter(indent=2).pprint backend = get_backend() def my_split(p): """ splits args based on '=' delim :return: """ ...
# coding: utf-8 """ Vericred API Vericred's API allows you to search for Health Plans that a specific doctor accepts. ## Getting Started Visit our [Developer Portal](https://developers.vericred.com) to create an account. Once you have created an account, you can create one Application for Production and an...
# -*- coding: utf-8 -*- # import json import pytest from resources.lib import utilities def load_params_from_json(json_path): with open(json_path) as f: return json.load(f) def test_isMovie(): assert utilities.isMovie('movie') def test_isEpisode(): assert utilities.isEpisode('episode') def ...
# (c) Crown Copyright 2014 Defence Science and Technology Laboratory UK # Author: Rich Brantingham import copy import time import json import urlparse import datetime from xml.dom.minidom import parseString from xml.parsers.expat import ExpatError from django.test import TestCase from django.core impor...
""" byceps.services.tourney.models.tourney_category ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from sqlalchemy.ext.orderinglist import ordering_list from ....database import db, generate_uuid from ....typing import P...
# Copyright (C) 2015-2019 Magenta ApS, https://magenta.dk. # Contact: info@magenta.dk. # # 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 copy import jsonschema ...
from setuptools import setup, find_packages import os HERE = os.path.abspath(os.path.dirname(__file__)) def get_long_description(): dirs = [ HERE ] if os.getenv("TRAVIS"): dirs.append(os.getenv("TRAVIS_BUILD_DIR")) long_description = "" for d in dirs: rst_readme = os.path.join(d, "REA...
#!/usr/bin/env python """ Python compiler from DTLL (ISO DSDL Part 5: Datatypes) to a Python data types script """ import os import re import sys import codecs import optparse import cStringIO from xml import sax from amara import domtools from Ft.Xml.Domlette import GetAllNs from Ft.Xml.Domlette import NonvalidatingR...
#!/usr/bin/env python # coding=utf-8 """ Copyright 2012 Load Impact 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 la...
'''Dual Path Networks in PyTorch.''' import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable class Bottleneck(nn.Module): def __init__(self, last_planes, in_planes, out_planes, dense_depth, stride, first_layer): super(Bottleneck, self).__init__() sel...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Setup.technique' db.add_column(u'feed_setup', 'technique'...
# -*- coding: utf-8 -*- # Resource object code # # Created: pon. nov. 30 09:12:53 2015 # by: The Resource Compiler for PyQt (Qt v4.8.6) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x0b\x37\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49...
from gevent import pywsgi from geventwebsocket import WebSocketError from geventwebsocket.handler import WebSocketHandler from threading import Thread import zmq.green as zmq from settings import settings, LISTEN class WebSocketTranslator(object): def __init__(self, context): self.context = context ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2014 Leonardo Kewitz 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 limit...
from django import template from django.utils.safestring import SafeString from django.urls import reverse from django.http.request import QueryDict from urllib.parse import quote_plus register = template.Library() def cleaned_params(context): params = context['request'].GET.copy() if 'partial' in params: de...
# Copyright 2013 the Neutrino authors (see AUTHORS). # Licensed under the Apache License, Version 2.0 (see LICENSE). import plankton from plankton import codec import unittest @plankton.serializable class Object(object): def __init__(self, header=None): self.header = header self.payload = None def set...
# coding=utf-8 # Copyright 2016 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 pex....
""" Adaptations of the cached and filesystem template loader working in a multi-tenant setting """ import hashlib from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import connection from django.template import TemplateDoesNotExist from django.template.base import ...
""" Recursive least squares model Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function from warnings import warn from statsmodels.compat.collections import OrderedDict import numpy as np import pandas as pd from statsmodels.regression.linear_model import OL...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
# Running the test with Python 2: # Be sure to install pytest version 4.6.4 (newer should also work) # Command in cppcheck directory: # python -m pytest addons/test/test-misra.py # # Running the test with Python 3: # Command in cppcheck directory: # PYTHONPATH=./addons python3 -m pytest addons/test/test-misra.py impor...
# -*- coding: utf-8 -*- import re import urlparse from core import httptools from core import scrapertools from core import servertools from core.item import Item from platformcode import config, logger host = "http://www.peliculashindu.com/" def mainlist(item): logger.info() itemlist = list() iteml...
import scipy import numpy as np import tensorflow as tf import menpo.io as mio import keras import keras.backend as K import io from scipy import sparse from ..utils import get_custom_objects, mesh as graph from ..layers import Layer, InputSpec class MeshReLU1B(Layer): def __init__(self, **kwargs): super...
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, absolute_import, division) import logging from datetime import datetime import six from django.dispatch import receiver, Signal from django.db.models import F from django.db.models.signals import pre_save, post_save from django.db import transaction, I...
import os from fusesoc.config import Config from fusesoc import utils from fusesoc.utils import Launcher, pr_warn, pr_info, unique_dirs class File(object): name = "" file_type = "" is_include_file = False logical_name = "" def __init__(self, s): self.is_include_file = False if ...
#!C:\Program Files\Python35\python import cgi import math from datetime import datetime import serial import time # the following 3 lines will need to be modified to match your setup/ & location center_lng = -85.198159 #Antenna's GPS Longtitude center_lat = 35.123637 #Antenna's GPS Latitude ser = serial.Serial('COM10...
"""---------------------------------------------------------------------------- wnd_main_config.py Copyright (C) 2013-2020 Wilhelm Duembeg This file is part of gsat. gsat is a cross-platform GCODE debug/step for Grbl like GCODE interpreters. With features similar to software debuggers. Features such as...
import asyncio import aiozmq import zmq class ZmqDealerProtocol(aiozmq.ZmqProtocol): transport = None def __init__(self, queue, on_close): self.queue = queue self.on_close = on_close def connection_made(self, transport): self.transport = transport def msg_received(self, msg...
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change th...
# -*- coding: utf-8 -*- # field_gtk.py # Copyright (C) 2007-2008 Jean-Baptiste LAMY -- jiba@tuxfamily.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 Free Software Foundation; either version 2 of the License, or #...
""" Histogram-related functions """ from __future__ import division, absolute_import, print_function import operator import numpy as np from numpy.compat.py3k import basestring __all__ = ['histogram', 'histogramdd', 'histogram_bin_edges'] # range is a keyword argument to many functions, so save the builtin so they ...
import os import os.path as op import json import re import sys from hashlib import sha1 from datetime import datetime as dt from pygments import lexers from bottle import route, request, redirect, static_file, response, abort from bottle import jinja2_template as template import markdown import bleach from piu impor...
# -*- encoding:utf-8 -*- import sys import scrapy from MovieReview.items import MoviereviewItem from scrapy_redis.spiders import RedisSpider from scrapy.http import Request, HtmlResponse from scrapy.linkextractors import LinkExtractor from scrapy.selector import Selector from bs4 import BeautifulSoup from obtain_date i...
#-*- coding: UTF-8 -*- import os from app import app, db from app.models import User, Role from flask.ext.script import Manager, Server, Shell from flask.ext.migrate import Migrate, MigrateCommand manager = Manager(app) def make_shell_context(): return dict(app=app, db=db, User=User, Role=Role) manager.add_comma...
# 3rd party imports from bidi.algorithm import get_display as apply_bidi # Django imports from django.conf import settings # Project imports from .factories import create_voters, generate_arabic_place_name from .base import TestGeneratePdfBase from .utils_for_tests import NBSP, extract_pdf_page, extract_textlines, cl...
from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from django.db import models from django.utils.crypto import get_random_string from django.utils.translation import ugettext_lazy as _ from multiselectfield import MultiSelectField from oidc_provider.models import Clien...
def fill(grid): legend = {0: '#', 1: '=', 2: '-', 3: '.'} grid = {(x, y): grid[y][x] for y in range(h) for x in range(w)} def flood(root=(1, 1), depth=0): visited = set() queue = {root} while queue: node = queue.pop() ...
# # Module for starting a process object using os.fork() or CreateProcess() # # processing/forking.py # # Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt # import os import sys import signal import processing __all__ = ['Popen', 'assertSpawning', 'exit'] # # Check that the current thread is sp...
""" Class for managing notifications in pegasus-monitord. """ ## # Copyright 2007-2011 University Of Southern California # # 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.a...
from mpf.tests.MpfTestCase import MpfTestCase, MagicMock class TestCarouselMode(MpfTestCase): def get_config_file(self): return 'config.yaml' def get_machine_path(self): return 'tests/machine_files/carousel/' def _start_game(self): self.machine.playfield.add_ball = MagicMock() ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Scotchman documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 14:08:17 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # au...
import os import imp try: from StringIO import StringIO except ImportError: # python 3 from io import StringIO import sys import tempfile import unittest try: from unittest import skipUnless except ImportError: # sys.version < (2, 7) def skipUnless(condition, reason): ret...
# This script processes MIMIC-III dataset and builds longitudinal diagnosis records for patients with at least two visits. # The output data are cPickled, and suitable for training Doctor AI or RETAIN # Written by Edward Choi (mp2893@gatech.edu) # Usage: Put this script to the foler where MIMIC-III CSV files are locate...
import os import click import polib from . import ignore_msg from .po import rewrite_po from .pt import rewrite_pt from .python import rewrite_python REWRITERS = { '.po': rewrite_po, '.pt': rewrite_pt, '.py': rewrite_python, } @click.command() @click.argument('po-file', type=click.Path(exists=True)) @cl...
""" Set up the plot figures, axes, and items to be done for each frame. This module is imported by the plotting routines and then the function setplot is called to set the plot parameters. """ try: from setplotfg import setplotfg except: print("Did not find setplotfg.py") setplotfg = None #----------...
from warnings import warn import parmed as pmd import parmed.periodic_table as pt from foyer.exceptions import FoyerError from foyer.topology_graph import TopologyGraph from foyer.smarts_graph import SMARTSGraph def find_atomtypes(structure, forcefield, max_iter=10): """Determine atomtypes for all atoms. P...
# -*- coding: utf-8 -*- # YAFF is yet another force-field code. # Copyright (C) 2011 Toon Verstraelen <Toon.Verstraelen@UGent.be>, # Louis Vanduyfhuys <Louis.Vanduyfhuys@UGent.be>, Center for Molecular Modeling # (CMM), Ghent University, Ghent, Belgium; all rights reserved unless otherwise # stated. # # This file is pa...
# -*- coding: utf-8 -*- import sys import os import argparse from director.importer import Importer from director.updater import Updater from director.service import Service def stype(bytestring): unicode_string = bytestring.decode(sys.getfilesystemencoding()) return unicode_string def parse_options(): ...
#!/usr/bin/env python2.7 # NOTE THIS NEEDS 2.6 as parser breaks with 2.5 :-) import warnings warnings.simplefilter("ignore",DeprecationWarning) import os, sys, re, urllib2, string, socket import htmlentitydefs import mechanize import html5lib from html5lib import treebuilders import lxml.html, lxml.etree from lxml.css...
#!/usr/bin/env python # vim: set et sw=4 sts=4 fileencoding=utf-8: # # A library for reading Microsoft's OLE Compound Document format # Copyright (c) 2014 Dave Jones <dave@waveform.org.uk> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation fi...
# 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...
# Lint as: python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
""" This tutorial introduces logistic regression using Theano and stochastic gradient descent. Logistic regression is a probabilistic, linear classifier. It is parametrized by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is done by projecting data points onto a set of hyperplanes, the distance...
# -*- coding: utf-8 -*- # # 2020-04-13 Cornelius Kölbel <cornelius.koelbel@netknights.it> # migrate to click # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE # License as published by the Free Software Foundation; either # v...
{ "id": 3, "title": "ARP", "originalTitle": "ARP", "tags": [], "style": "dark", "timezone": "browser", "editable": true, "hideControls": false, "sharedCrosshair": false, "rows": [ { "collapse": false, "editable": true, "height": "250px", "panels": [ { "a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Module to do event-driven programming very easily. @author: Damien Boucard @author: Dirk Van Haerenborgh @license: Gnu/LGPLv2 @version: 1.1 Module attributes: - dispatcher: accepted values: 'gobject' (asynchronous), 'callback' (synchronous). """ import loggin...
# 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 frappe from erpnext.utilities.transaction_base import TransactionBase from frappe.utils import now, extract_email_id import json import reque...
import os os.chdir(os.path.dirname(__file__)) import sim_util import sys import pandas as pd import numpy as np from numpy.random import poisson, uniform from numpy import mean import time import math po = False team_homes = pd.read_csv(os.path.join(os.path.split(__file__)[0], 'TeamHomes.csv'), header = None, index_...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'about.ui' # # Created: Fri Sep 10 23:16:30 2010 # by: PyQt4 UI code generator 4.7.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_About(object): def setupUi(self, About): ...
import io import json import sys from six import text_type from stix2.pattern_visitor import create_pattern_object def step_cyber_observable(obj): type_name20 = obj["type"] if type_name20 == "file": obj.pop("is_encrypted", None) obj.pop("encryption_algorithm", None) obj.pop("decryptio...
""" Unit tests for the NetworkStatusDocumentV3 of stem.descriptor.networkstatus. """ import datetime import io import unittest import stem.descriptor import stem.version from stem import Flag, str_type from stem.descriptor.networkstatus import ( HEADER_STATUS_DOCUMENT_FIELDS, FOOTER_STATUS_DOCUMENT_FIELDS, DE...
# -*- coding: utf-8 -*- # Copyright © 2013-2021 Udo Spallek, Roberto Alsina and others. # 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 #...
import io, sys class Sudoku(): def __init__(self, textfile): puzzle = open(textfile).readlines() class Position(): def __init__(self, row, column, box): self.row = row self.column = column self.box = box if __name__ == '__main__': puzzle = open(sys.argv[1]).readlines()...
"""add gender identity enums Revision ID: 72365b7c0037 Revises: 9c957ce496bf Create Date: 2019-06-05 08:56:34.278852 """ import model.utils import sqlalchemy as sa from alembic import op from rdr_service.participant_enums import GenderIdentity # revision identifiers, used by Alembic. revision = "72365b7c0037" down_...
from mlcollection.datasets.movielens.movielensparser import MovieLensParser from mlcollection.lib.collaborativefiltering import pearson from operator import itemgetter class MovieRecommender(MovieLensParser): def __init__(self): # this will load in our data set MovieLensParser.__init__(self) ...