text
stringlengths
475
200k
from setuptools import setup import setuptools from setuptools.command.test import test as TestCommand import sys import os class PyTest(TestCommand): test_package_name = 'src' def finalize_options(self): TestCommand.finalize_options(self) _test_args = [ '--ignore=build', ...
# 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 required by applica...
# 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, s...
# 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 ...
# Copyright 2012-2019 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) from lino.api import dd, _ ledger = dd.resolve_app('ledger') class DeclarationDetail(dd.DetailLayout): main = """ start_period end_period entry_date accounting_period user partner narratio...
# ##### 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...
# # ---------------------------------------------- # WARNING, ALL LITERALS IN THIS FILE ARE UNICODE # ---------------------------------------------- # from __future__ import unicode_literals # # # from _cffi_backend import FFI def test_cast(): ffi = FFI() assert int(ffi.cast("int", 3.14)) == 3 # unicod...
#!/usr/bin/python import sys import os import urllib # Config section apps = [("/swiftp_proxy", "http://24.21.195.59/swiftp_proxy_dev.tgz", "-detached -jointo ''")] do_apt_upgrade = False # Code section logfilename = "/tmp/startup.log" fh = open(logfilename, 'a') def log(string): """Writes a string to both std...
# 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 ...
# Copyright (C) 2105 wysiwyng # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is d...
import tpt from tpt import * import sys import code import ctypes import traceback DEBUG=False #print "console module loaded." #redirect stdout like this: class logger: def write(self,txt): txt=txt.strip().split("\n")[-1] repr(txt) try: tpt.log(txt) except:#yeah, this ha...
""" 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 use this ...
''' Deep dive Transect Extraction for Fire Island, NY 2012 Requires: python 2.7, Arcpy Author: Sawyer Stippa, modified by Ben Gutierrez & Emily Sturdivant email: [EMAIL]; [EMAIL]; [EMAIL] Date last modified: 2/26/2016 Notes: Run in ArcMap python window; Turn off "auto display" in ArcMap preferences, I...
""" .. dialect:: drizzle+mysqldb :name: MySQL-Python :dbapi: mysqldb :connectstring: drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> :url: http://sourceforge.net/projects/mysql-python """ from sqlalchemy.dialects.drizzle.base import ( DrizzleDialect, DrizzleExecutionC...
from pycp2k.inputsection import InputSection class _each3(InputSection): def __init__(self): InputSection.__init__(self) self.Just_energy = None self.Powell_opt = None self.Qs_scf = None self.Xas_scf = None self.Md = None self.Pint = None self.Metady...
from django.conf import settings from django.contrib.auth.models import Permission from django.core.files.images import ImageFile from django.db.models.query import QuerySet from django.test import TestCase from django_images.models import Thumbnail import factory from taggit.models import Tag from ..models import Pi...
#!/usr/bin/env python # encoding: utf-8 """ ``rand`` is a module that provides ``random`` utilities, such as: * globally setting a seed value * random integers between a range * random floats between a range * return ``True`` or ``False`` based on a probability (the ``maybe`` function) * return random data """ imp...
#! /usr/bin/python """ Input: fasta, int Output: tabular Return titles with lengths of corresponding seq """ import sys, os assert sys.version_info[:2] >= ( 2, 4 ) def __main__(): infile = sys.argv[1] outfile = sys.argv[2] keep_first = int( sys.argv[3] ) fasta_title = fasta_seq = '' # ...
import torch # import numpy as np from torch import nn, autograd, optim from matplotlib import pyplot as plt num_data_samples = 16 hidden_size = 8 batch_size = 16 # num_critic_steps = 5 # weight_clipping = 0.01 data_samples = torch.rand(num_data_samples, 1) class Discriminator(nn.Module): def __init__(self, hi...
# -*- coding: utf-8 -*- import unittest from sqp import models, views_ui_functions from django.contrib.auth.models import User from django.conf import settings import json import types from sqp import views_ui_exceptions #A collection of questions in various languages test_languages = [ {'langu...
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
# coding=iso-8859-1 import string #Map between ICAO and IATA if possible class ICAOIATAMapper(): mapping = {} bIsInit=False def init(self): print "In init mapper" file = open('C:\\DEV\\work\\data.x-plane.com\\work\\wiki_icao.html', 'r') for line in file: ...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # PvrGoku Dailymotion # Version 0.1 (10.12.2014) #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) # Gracias a la librería plugintools de Jesús (www.mimediacenter.i...
""" Tests for the views """ from datetime import datetime import ddt from django.core.urlresolvers import reverse from mock import patch from opaque_keys import InvalidKeyError from pytz import UTC from rest_framework import status from rest_framework.test import APITestCase from capa.tests.response_xml_factory import...
from operator import itemgetter from collections import defaultdict import csv import json pokedex = dict( pokemon={}, generations=[], types={} ) def get_pokemon_name(pokemon_id: int): """ Return the name of a pokemon's ID. """ for name, value in pokedex["pokemon"].items(): if value["id...
# -*- coding: utf-8 -*- # Copyright 2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
""" sentry.tsdb.dummy ~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from sentry.tsdb.base import BaseTSDB class DummyTSDB(BaseTSDB): """ A no-op time-series storage. ""...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import werkzeug from odoo import _, exceptions, http, tools from odoo.http import request from odoo.tools import consteq from werkzeug.exceptions import BadRequest class MassMailController(http.Controlle...
import pdb import time import collections import random import itertools import xmlrpclib import dis server_url = 'http://127.0.0.1:20738/RPC2' server = xmlrpclib.Server(server_url) G = server.ubigraph def erdos (): vert_ids = range(0,1000) p = 0.001 G.clear() pdb.set_trace() for id in vert_ids:...
# -*- coding: utf-8 -*- from sqlalchemy import inspect from server.main import db from sqlalchemy.sql import func class BaseModel(db.Model): """Base data model for all objects""" __abstract__ = True def __init__(self, *args): super().__init__(*args) def __repr__(self): """Define a ...
from nose.tools import assert_equal class TestBinaryTree(object): def test_insert_traversals (self): myTree = BinaryTree() myTree2 = BinaryTree() for num in [50, 30, 70, 10, 40, 60, 80, 7, 25, 38]: myTree.insert(num) [myTree2.insert(num) for num in range (1, 100, 10)] print("Test: insert checking with ...
# 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 ...
from __future__ import print_function from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.random_forest import H2ORandomForestEstimator import random def cv_carsRF(): # read in the dataset and construct training set (and validation se...
__author__ = 'AssadMahmood' import unittest import asposecloud import os.path import json import time from asposecloud.storage import Folder from asposecloud.slides import Converter from asposecloud.slides import Document from asposecloud.slides import Extractor class TestAsposeSlides(unittest.TestCase): def set...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, 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 co...
#!/usr/bin/env python import argparse import random DEBUG = False MSVC = False class Subobject(object): def __init__(self, base, is_virtual, offset, direct_subobject_of): self.base = base self.is_virtual = is_virtual self.offset = offset self.direct_subobject_of = direct_subobject...
# Source: http://www.pyimagesearch.com/2017/04/17/real-time-facial-landmark-detection-opencv-python-dlib/ # USAGE # python video_facial_landmarks.py --shape-predictor shape_predictor_68_face_landmarks.dat # python video_facial_landmarks.py --shape-predictor shape_predictor_68_face_landmarks.dat --picamera 1 # import t...
# # This file is part of Plinth. # # 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 distribute...
"""ParentMgr module: contains the ParentMgr class""" from direct.directnotify import DirectNotifyGlobal from direct.showbase.PythonUtil import isDefaultValue import types class ParentMgr: # This is now used on the AI as well. """ParentMgr holds a table of nodes that avatars may be parented to in a distrib...
# Copyright 2017 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...
from django.db.models.query import QuerySet from datetime import date from django.contrib.contenttypes.models import ContentType from workflows.models import StateObjectRelation class GASMemberQuerySet(QuerySet): # TODO: refactor here some GASMemberManager objects pass class OrderQuerySet(QuerySet): ...
import urllib.request import json from coinotomy.watchers.common import Watcher NORMAL_TIMEOUT = 60*5 class WatcherCoinfloor(Watcher): def __init__(self, name: str, symbol: str): Watcher.__init__(self, "coinfloor." + name, NORMAL_TIMEOUT) self.backend = None self.api = CoinfloorAPI(symbo...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, parse_filesize, qualities, ) class Channel9IE(InfoExtractor): ''' Common extractor for channel9.msdn.com. The type of provided URL (video or playlist) is determined acco...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
__author__ = 'tangy' import numpy as np import pickle as pkl from copy import deepcopy import re from py_bing_search import PyBingSearch import urllib def get_improved_term(query): bing = PyBingSearch('') # Add your bing-api key here result_list, next_url = bing.search("%s wikipedia" % query, limit=3, format=...
#!/usr/bin/env python """ Copyright (c) 2014 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
# -*- 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): # Removing unique constraint on 'TtShape', fields ['gtfs_shape_id'] db.de...
import pytest import numpy as np import scipy.signal import matplotlib.pyplot as plt from matplotlib.cm import get_cmap import hearinglosssimulator as hls import helper #~ exit() #~ nb_channel = 2 nb_channel = 1 sample_rate =44100. #~ chunksize = 256 #~ chunksize = 512 chunksize = 1024 #~ chunksize = 2048 backwar...
#------------------------------ # Name: Balazs Somfalvi # Assignment: L5Q2bonusBS.py #------------------------------ # Rock-Paper-Scissors Game import random #necessary for random number generation def show_rules(): print('*** Rock-Paper-Scissors ***') print(''' Rules: Each player chooses ether Rock, ...
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
import logging import logging.config # needed when logging_config doesn't start with logging.config from copy import copy from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.core.management.color import color_style from django.utils.module_loading impo...
########################################################################## # # Copyright (c) 2007-2010, Image Engine Design 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: # # * Redis...
# coding: utf-8 # # Copyright 2020 The Oppia 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 requi...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
#!/usr/bin/env python3 # encoding: utf-8 import logging from raven.contrib.flask import Sentry from framework.sessions import get_session from website import settings logger = logging.getLogger(__name__) sentry = Sentry(dsn=settings.SENTRY_DSN) # Nothing in this module should send to Sentry if debug mode is on #...
#!/usr/bin/env python """ Migrate a Compose file from the V1 format in Compose 1.5 to the V2 format supported by Compose 1.6+ """ import argparse import logging import sys import ruamel.yaml from compose.config.types import VolumeSpec log = logging.getLogger('migrate') def migrate(content): data = ruamel.yaml...
import re import string domain="http://www.unutulmazfilmler.co" encoding="utf-8" def match_results(page,names,info): match_name,match_year,link=False,False,"" results=re.findall('<h2 class="content-title">\s*?<a href="(.*?)" title=".*?" class="link-unstyled">(.*?)\s\-.*?</a>\s*?<small>\(([0-9]{4})\s|-',page,re.DOT...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 OpenStack Foundation # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eBay Inc. # # Licensed under the Apach...
#!/usr/bin/env python ################################################################################ # This is based on https://github.com/ps2/subg_rfspy with minor adjustments # # Copyright (c) 2015 Pete Schwamb # The MIT License (MIT) # # Copyright (c) 2015 Pete Schwamb # # Permission is hereby granted, free of ch...
from __future__ import print_function from datetime import datetime import logging import requests import os from parser import Parser import pymysql logger = logging.getLogger() logger.setLevel(logging.INFO) def process_dynamo_stream(event, context): records = event['Records'] logger.info('Received Dynamo ...
#!/usr/bin/env python # 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 distributed in the hope that i...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/python # # Copyright 2014 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 b...
"""Base classes for all estimators.""" # Author: Gael Varoquaux <[EMAIL]> # License: BSD 3 clause import copy import inspect import warnings import numpy as np from scipy import sparse from .externals import six ############################################################################### def clone(estimator, saf...
# Copyright 2004 Toby Dickenson # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distri...
########################################################################################## ## Project Euler #25: N-digit Fibonacci number ## ## ## ## Link: https://www.hackerrank.com/contests/p...
"""Utilities for working with ID tokens.""" import datetime from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import load_pem_private_key from django.conf import settings from django.core.exceptions import ImproperlyConfigured import jwt from provider.oauth2.mod...
"""Support Hook, available at hooksmarthome.com.""" import logging import asyncio import voluptuous as vol import async_timeout import aiohttp from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA) from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, CONF_TOKEN from homeassistant.helpers...
from __future__ import absolute_import from __future__ import division from builtins import object from past.utils import old_div from envparse import env from itertools import chain from datetime import timedelta from rgbmatrix import RGBMatrix, graphics import threading import time from . import utils # TODO these s...
# -*- coding: utf-8 -*- ############################################################################### # # GetReportById # Returns the contents of a report with a given report id. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # yo...
# 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 required by applica...
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship Base = declarative_base() class Restaurant(Base): __tablename__ = 'restaurant' id = Column(Integer, primary_key=True...
# No shebang line, this module is meant to be imported # # Copyright 2013 Oliver Palmer # # 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 # # U...
from django.conf.urls.defaults import patterns, url from blog.models import Post urlpatterns = patterns('django.views.generic', url(r'^(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{1,2})/(?P<slug>[-\w]+)/$', 'date_based.object_detail', {'queryset': Post.objects.published(), 'date_field': 'publish'}, ...
from lxml.etree import Element from jenkins_job_manager.helper import Helper class IssuesRecorderGenerator: @staticmethod def create_analysis_tools(checkstyle: str) -> Element: analysis_tools = Element('analysisTools') check_style = Element( 'io.jenkins.plugins.analysis.warnings.c...
import logging from pprint import pprint import numpy as np from copy import deepcopy from pycqed.measurement.waveform_control import pulsar as ps from pycqed.measurement.waveform_control import sequence as sequence from pycqed.measurement.waveform_control import segment as segment from pycqed.measurement.randomized_b...
''' This file is part of the API for the Maniac Challenge 2013. The Maniac API 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 3 of the License, or (at your option) any later version. ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Dag Wieers <[EMAIL]> # # This file is part of Ansible # # Ansible 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 # (a...
""" sentry.app ~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.conf import settings from sentry.utils.imports import import_string from threading import local class State(local)...
from django.urls import path from . import feeds urlpatterns = [ path('syndication/rss2/', feeds.TestRss2Feed()), path('syndication/rss2/articles/<int:entry_id>/', feeds.TestGetObjectFeed()), path( 'syndication/rss2/guid_ispermalink_true/', feeds.TestRss2FeedWithGuidIsPermaLinkTrue()), ...
# Copyright 2013 django-htmlmin 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 unittest from django.test.client import Client class TestDecorator(unittest.TestCase): @classmethod def setUpClass(cls): cls.cli...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaegraph.business_base import NodeSearch, DeleteNode from classificacaodtm_app.commands import ListClassificacaodtmCommand, SaveClassificacaodtmCommand, UpdateClassificacaodtmCommand, \ ClassificacaodtmPublicForm, Classificacaodtm...
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
# Copyright (c) 2009 by Kenjiro Taura. All rights reserved. # Copyright (c) 2008 by Kenjiro Taura. All rights reserved. # Copyright (c) 2007 by Kenjiro Taura. All rights reserved. # Copyright (c) 2006 by Kenjiro Taura. All rights reserved. # Copyright (c) 2005 by Kenjiro Taura. All rights reserved. # # THIS MATERIAL IS...
import os.path import sys import string def prepare_mingw(env): env['TOOLS'] = ['mingw'] additionalCPPFLAGS = [] if env.__contains__('more-warnings') and env['more-warnings'] == '1': additionalCPPFLAGS += warnFlags if env.__contains__('warnings-as-errors') and env['warnings-as-errors'] == '1'...
""" TO NOTE: 1) args must be entered into original python call in the same order they are used in the mainfunc given 2) must have matching number of args in args.avro as are required to call mainfunc, in proper order 3) mainfunc name needs to be the same as the name for the function added to the scala module """ ...
import datetime as dt import pandas as pd from .context import tohu from tohu.v6.primitive_generators import Constant, Integer, HashDigest, FakerGenerator, Timestamp from tohu.v6.derived_generators import Apply, Lookup, SelectMultiple, SelectOne from tohu.v6.custom_generator import CustomGenerator from .exemplar_gener...
#!/usr/bin/env python # optimizer_counters_to_sql.py - Store CSV counters into SQLite -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https...
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
#!/usr/bin/python #------------------------------------------------------------- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this f...
# -=- encoding: utf-8 -=- # # SFLvault - Secure networked password store and credentials manager. # # Copyright (C) 2009 Savoir-faire Linux inc. # # Author: Alexandre Bourget <[EMAIL]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
import json, urllib, urllib2, re, sys from chii import command, config GOOGLE_API_KEY = config['google_api_key'] if GOOGLE_API_KEY: import lxml.html import requests try: headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:5.0.1) Gecko/20100101 Firefox/5.0.1'} resp = r...
# -*- coding: utf-8 -*- import gtk, cairo, time import sudoku, gsudoku, saver from defaults import * from gtk_goodies import gconf_wrapper def fit_squares_in_rectangle (width, height, n, margin=0): """Optimally fit squares into a rectangle. Return number of columns, number of rows, and square size for the...
import sublime import sublime_plugin import os class FetchCommand(sublime_plugin.WindowCommand): fileList = [] packageList = [] s = None packageUrl = None filesPlaceholder = {"jquery": "http://code.jquery.com/jquery.min.js"} packagesPlaceholder = {"html5_boilerplate": "http...
""" Demonstrates the algorithm for solving linear systems by Harrow, Hassidim, Lloyd (HHL). The HHL algorithm solves a system of linear equations, specifically equations of the form Ax = b, where A is a Hermitian matrix, b is a known vector, and x is the unknown vector. To solve on a quantum system, b must be rescaled...
from __future__ import print_function, division from sympy.core import S, sympify, Expr, Rational, Symbol, Dummy from sympy.core import Add, Mul, expand_power_base, expand_log from sympy.core.cache import cacheit from sympy.core.compatibility import default_sort_key, is_sequence from sympy.core.containers import Tuple...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import parse_duration class SWRMediathekIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?swrmediathek\.de/(?:content/)?player\.htm\?show=(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}...
import abc class Container(abc.ABC): """ A container for exposed methods and/or event handlers for a better modularization of the application. Example usage :: # in users.py class UsersModule(gemstone.Container): @gemstone.exposed_method("users.register") ...