code stringlengths 1 199k |
|---|
import asyncio
import logging
from vj4 import db
from vj4.model import document
from vj4.model.adaptor import discussion
from vj4.util import argmethod
from vj4.util import domainjob
_logger = logging.getLogger(__name__)
@domainjob.wrap
async def discussion(domain_id: str):
_logger.info('Discussion')
pipeline = [
... |
"""
unittest for visitors.diadefs and extensions.diadefslib modules
"""
import os
import sys
import codecs
from os.path import join, dirname, abspath
from difflib import unified_diff
import unittest
from astroid import MANAGER
from astroid.inspector import Linker
from pylint.pyreverse.diadefslib import DefaultDiadefGen... |
AC = "12"
AL = "27"
AM = "13"
AP = "16"
BA = "29"
CE = "23"
DF = "53"
ES = "32"
GO = "52"
MA = "21"
MG = "31"
MS = "50"
MT = "51"
PA = "15"
PB = "25"
PE = "26"
PI = "22"
PR = "41"
RJ = "33"
RN = "24"
RO = "11"
RR = "14"
RS = "43"
SC = "42"
SE = "28"
SP = "35"
TO = "17"
PRODUCAO = "1"
HOMOLOGACAO = "2"
URLS = {
PROD... |
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, cint, flt, comma_or, nowdate, get_base_path,today
import barcode
import os
from webnotes import msgprint, _
from datetime import date
from webnotes.model.doc import Document, make_autoname
from selling.doctype.customer.customer im... |
import select, socket, struct
class RconSteam:
def connect(host, portnumber, password):
sockrcon = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sockrcon.connect((host, portnumber))
sockrcon.send(sock.send("0xFF0xFF0xFF0xFFrcon 5SweeT23")
connect(('142.4.210.104', '3222', '5SweeT23')) |
"""
tinsul.core
~~~~~~~~~~
A module to simulate condition-monitoring data for Transformer INSULation
prognostics models.
:copyright: (c) 2017 by Eric Strong.
:license: Refer to LICENSE.txt for more information.
"""
import numpy as np
import pandas as pd
from numba import jit
from numpy.random im... |
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
... |
"""
Flickr (Images)
More info on api-key : https://www.flickr.com/services/apps/create/
"""
from json import loads
from urllib.parse import urlencode
about = {
"website": 'https://www.flickr.com',
"wikidata_id": 'Q103204',
"official_api_documentation": 'https://secure.flickr.com/services/api/flickr.photos... |
import sqlite3
import sys
import urllib2
import time, datetime
import re
conn = sqlite3.connect('/Users/MarkTiele/1_Akvo/Software/Walking_for_Water/WvW/data/WvW.sqlite')
cursor = conn.cursor ()
cursor.execute ("SELECT id,ACTIEF FROM W4W_inschrijving")
rows = cursor.fetchall ()
print "Number of items returned: %d" % cur... |
from decimal import Decimal
from unittest.mock import patch
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from feedbacks.models import Request, EmailTemplate
from feedbacks.views import request_email
from products.models import Category, Pr... |
import res_partner |
{
'name': 'Master Procurement Schedule',
'version': '1.2',
'author': 'OpenERP SA and Grzegorz Grzelak (OpenGLOBE)',
'category' : 'Manufacturing',
'images': ['images/master_procurement_schedule.jpeg','images/sales_forecast.jpeg','images/stock_planning_line.jpeg','images/stock_sales_period.jpeg'],
... |
from __future__ import annotations
from flask import render_template
from baseframe import _, __
from ...models import NewUpdateNotification, Update
from ...transports.sms import TwoLineTemplate
from ..helpers import shortlink
from ..notification import RenderNotification
@NewUpdateNotification.renderer
class RenderNew... |
"""
The Host package contains QObjects to display data of the backend ``host``
""" |
import math
from odoo import models, fields, api
import odoo.addons.decimal_precision as dp
class ProductTemplate(models.Model):
_inherit = 'product.template'
@api.multi
def _get_no_wh_internal_stock(self):
for product in self:
locs = []
locs.append(self.env.ref('location_mov... |
"""
Studio URL configuration for openedx-olx-rest-api.
"""
from django.urls import path, include
from . import views
urlpatterns = [
path('api/olx-export/v1/', include([
path('xblock/<str:usage_key_str>/', views.get_block_olx),
# Get a static file from an XBlock that's not part of contentstore/GridF... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='has_config_persional_info',
field=models.BooleanField(default=Fals... |
from .base import * # isort:skip
ENVIRONMENT = 'PROD'
SECRET_KEY = get_env_setting('SECRET_KEY')
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'pasportaservo',
}
}
EMAIL_BACKEND = "sgbackend.SendGridBackend"
SENDGRID_API_KEY = get_env_setting('SENDGRID_A... |
"""
Unit tests for alan.
"""
import alan
from nose.tools import * |
"""
This file contains utility functions which will responsible for sending emails.
"""
from __future__ import absolute_import
import logging
import os
import uuid
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
import six
import six.moves.html_parser # pylint: disable=import-erro... |
import SimpleHTTPServer
class GZipFriendlyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_my_headers()
SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
def send_my_headers(self):
MONKEYPATCHED_HEADERS = {
'/d/us_postal_co... |
import unittest
from ppp_datamodel.nodes import Triple as T
from ppp_datamodel.nodes import Missing as M
from ppp_datamodel.nodes import Resource as R
from ppp_datamodel.nodes import JsonldResource as JR
from ppp_datamodel.nodes.list_operators import *
from ppp_libmodule.simplification import simplify
class Simplificat... |
import os
from inginious.frontend.pages.course_admin.task_edit import CourseEditTask, CourseTaskFiles
from inginious.frontend.plugins.multilang.problems.languages import get_all_available_languages
from ..constants import use_minified
_TEMPLATES_PATH = os.path.join(os.path.dirname(__file__), "templates/")
def code_prev... |
"""
ScanR Structures (Science)
"""
from json import loads, dumps
from searx.utils import html_to_text
about = {
"website": 'https://scanr.enseignementsup-recherche.gouv.fr',
"wikidata_id": 'Q44105684',
"official_api_documentation": 'https://scanr.enseignementsup-recherche.gouv.fr/opendata',
"use_offici... |
"""classi is a tool for text classification"""
import argparse
import os.path
import re
import warnings
from sklearn.externals import joblib
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.linear_model import RidgeClassifier, Logistic... |
from taiga.base.api import serializers
from taiga.base.fields import TagsField
from taiga.users.models import User
from taiga.users.services import get_photo_or_gravatar_url
class FanSerializer(serializers.ModelSerializer):
full_name = serializers.CharField(source='get_full_name', required=False)
class Meta:
... |
from datpy.user_modules.search_modules.elsevier import search
if __name__ == "__main__":
RECORDS = list(search("nordea"))
print "All Done" |
from django.core.management.base import BaseCommand
from events.models import Event
from crm.models import Person
from django.db.models import Count, Q
from django.utils import timezone
from datetime import timedelta
class Command(BaseCommand):
def handle(*args, **kwargs):
windowStart = timezone.now() - tim... |
import os
import sys
from flask import Flask
from flask.ext.babel import Babel, gettext, ngettext, lazy_gettext |
__copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
import random
from journal import models as journal_models
from utils.function_cache import cache
def get_random_journals()... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("credentials", "0010_auto_20170420_1651"),
]
operations = [
migrations.AddField(
model_name="programcertificate",
name="include_hours_of_effort",
field=models... |
import xml.etree.ElementTree as ET
import sys
import getopt
from distutils.version import LooseVersion
import paths
import options
display_framenet = False
display_verbnet = False
options = getopt.getopt(sys.argv[1:], "", ["verbnet", "framenet"])
for opt, v in options[0]:
if opt == "--verbnet":
display_verb... |
from __future__ import unicode_literals
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from .models import Feedback, NewsItem, DebateQ
from voting.models import SACYear
from .forms import FeedbackForm, DebateQForm
def show... |
from . import db
from .mixins import HistoryMixin
class Customer(HistoryMixin, db.Model):
def __repr__(self):
return '<Customer %s (added_by id %s)>' % (self.id, self.added_by_id)
id = db.Column(db.String, primary_key=True)
added_by_id = db.Column('added_by', db.Integer, db.ForeignKey('user.id'), pr... |
import werkzeug
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
from openerp.addons.website.models.website import slug
import re
from openerp.osv import fields
import logging
_logger = logging.getLogger(__name__)
class website_order(http.C... |
import logging
from openerp import tools
from openerp.addons.mail.mail_message import decode
from openerp.addons.mail.mail_thread import decode_header
from openerp.osv import osv
_logger = logging.getLogger(__name__)
class MailThread(osv.Model):
""" Update MailThread to add the feature of bounced emails and replied... |
"""
tests.test_fonts
~~~~~~~~~~~~~~~~~~~~~
Test fonts API.
:copyright: (c) 2018 Yoan Tournade.
:license: AGPL, see LICENSE for more details.
"""
import requests
def test_api_fonts_list(latex_on_http_api_url):
"""
The API list available fonts.
"""
r = requests.get("{}/fonts".format(la... |
"""
Middleware that checks user standing for the purpose of keeping users with
disabled accounts from accessing the site.
"""
from django.conf import settings
from django.http import HttpResponseForbidden
from django.utils import timezone
from django.utils.translation import ugettext as _
from opaque_keys.edx.keys impo... |
from openerp.osv import fields, orm
class partner_invoice_wizard(orm.TransientModel):
"""
questa classe apre il wizard per stampare il fatturato di un cliente/fornitore
"""
_name = 'partner.invoice.wizard'
_description = 'Total Invoice'
_columns = {
'period_from_id': fields.many2one('acc... |
from AccessControl import ClassSecurityInfo
from Products.Archetypes.Registry import registerWidget
from Products.Archetypes.Widget import TypesWidget
from Products.CMFCore.utils import getToolByName
from bika.lims.browser import BrowserView
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
fr... |
__all__ = ["InvalidCliffordError", "RankDeficientError"]
class InvalidCliffordError(ValueError):
"""We raise this exception wherever an automated procedure
has produced a list of output Pauli matrices that does not
commute as the result of an automorphism on the Paulis, or
where some other idiocy has oc... |
"""
telepathy-python - Base classes defining the interfaces of the Telepathy framework
Copyright (C) 2005, 2006 Collabora Limited
Copyright (C) 2005, 2006 Nokia Corporation
Copyright (C) 2006 INdT
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Li... |
from base_files import BaseCppFile
from util import strFunctions, global_variables
class NativeSwigFile():
"""Class for SWIG files"""
def __init__(self, name, package, elements, plugins, is_header):
self.package = package.lower()
self.cap_package = self.package.upper()
self.up_package = ... |
import sys
from paravistest import datadir, pictureext, get_picture_dir
from presentations import CreatePrsForFile, PrsTypeEnum
import pvserver as paravis
myParavis = paravis.myParavis
picturedir = get_picture_dir("Plot3D/A2")
file = datadir + "pointe.med"
print " --------------------------------- "
print "file ", file... |
"""
Test shows an entry and a label. Changing the entry should adjust the label
only for even numbers, otherwise it will turn red until a valid change.
This tests the new prop_write semantics which no longer attempt a cast.
"""
from gi.repository import Gtk
from gi.repository import Gdk
import _importer
import gtkmvc3
... |
""" pygame module for monitoring time
"""
from pygame._sdl import sdl, ffi
from pygame._error import SDLError
WORST_CLOCK_ACCURACY = 12
def _get_init():
return sdl.SDL_WasInit(sdl.SDL_INIT_TIMER)
def _try_init():
if not _get_init():
if sdl.SDL_InitSubSystem(sdl.SDL_INIT_TIMER):
raise SDLErro... |
import os, sys, shutil, copy, glob, time
import numpy as np
from .. import io as su2io
from .. import eval as su2eval
from .. import util as su2util
from ..io import redirect_folder
from warnings import warn, simplefilter
inf = 1.0e20
class Project(object):
""" project = SU2.opt.Project(self,config,state=None,
... |
"""
This file is part of PyZ80.
PyZ80 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.
PyZ80 is distributed in the hope that it will be... |
__revision__ = "$Id: Singleton.py,v 1.11 2009/08/31 21:02:06 rliebscher Exp $"
from fuzzy.set.Polygon import Polygon
from fuzzy.utils import prop
class Singleton(Polygon):
"""This set represents a non-fuzzy number.
Its membership is only for x equal 1.::
*
|
|
... |
"""
pyxs.connection
~~~~~~~~~~~~~~~
This module implements two connection backends for
:class:`~pyxs.client.Client`.
:copyright: (c) 2011 by Selectel.
:copyright: (c) 2016 by pyxs authors and contributors, see AUTHORS
for more details.
:license: LGPL, see LICENSE for more det... |
__program__ = 'Zimbra Attachments Killer'
__version__ = '1.2'
__author__ = 'pysarenko.a'
import os
import sys
import logging
import MySQLdb
import subprocess
from datetime import datetime
from datetime import timedelta
from time import strftime
from time import mktime
from email import message_from_file
from email.util... |
import sys
import os
suds_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(suds_path)
from suds.client import Client
def set_log():
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
logging.getLogger('sud... |
from functools import wraps
import email
import logging
import os.path
import socket
import struct
import ssl
import attr
import six
from taskc import transaction
logger = logging.getLogger(__name__)
def _is_path(instance, attribute, s, exists=True):
"Validator for path-yness"
if not s:
# allow False as... |
import github.Commit
import github.GithubObject
class Tag(github.GithubObject.NonCompletableGithubObject):
"""
This class represents Tags. The reference can be found here https://docs.github.com/en/rest/reference/repos#list-repository-tags
"""
def __repr__(self):
return self.get__repr__(
... |
from typing import List
from pathlib import Path
from eleve.memory import MemoryStorage as Storage, CSVStorage
from eleve.preprocessing import chinese
from eleve import Segmenter
CORPUS = Path('/home/pierre/Corpora/PKU/all.raw.u8')
def preproc(l: str) -> List[str]:
chunks = chinese.tokenize_by_unicode_category(l)
... |
from django.db import models
class Message(models.Model):
phone_number = models.CharField(max_length=15)
date = models.DateTimeField('date published')
body = models.TextField()
outgoing = models.BooleanField(default=False)
def __unicode__(self):
type = "incoming"
if self.outgoing:
... |
from setuptools import setup
setup(
name='SchwaLib',
version='1.0',
packages=['schwalib']
) |
"""
--------------------------------------------------------------------------------------------
Extracted from skikit-learn to ensure basic compatibility
without creating an explicit dependency.
For the original code see
http://scikit-learn.org/
and
https://github.com/scikit-learn
-----------------------------... |
import datetime
import logging
from django.contrib.auth.decorators import login_required
from django.http import (HttpResponse, HttpResponseForbidden,
HttpResponseRedirect)
from django.shortcuts import render, render_to_response
from django.template import RequestContext
from animanga_kuizu.mod... |
"""
Offline processing of multiple audio files in batch
**05-batch-processing.py**
This program demonstrates how to use pyo to do offline batch processing
given a folder of sounds.
"""
import os
from pyo import *
s = Server(audio="offline")
folder_path = SNDS_PATH
output_folder = os.path.join(os.path.expanduser("~"), "... |
from . import res_company
from . import res_users
from . import ir_http
from . import res_config_settings |
from .utils import PGTestCase
good_examples = [
"""
--- model ciao
config x1
config x2 = 2
config x3 = 2 "documentation"
config x4 "documentation"
config x5 '''Very long
documentation string'''
"""
]
bad_examples = [
"""
--- model ciao
config x3 = 2
"documentation"
config x4 "documentation"
"""
]
class Synt... |
import errno
import socket
import sys
import threading
import main
import config
import handler
class MTServer():
def __init__(self, listen_addr, connhandler):
self.listen_addr = listen_addr
self.connhandler = connhandler
self.sock = None
def start(self):
self.sock = socket.socke... |
from odoo import api, models, fields
class ResPartnerMergeLine(models.Model):
_name = 'res.partner.merge.line'
_description = 'Merger Line'
duplicate_id = fields.Many2one(
'res.partner.duplicate', ondelete='cascade', required=True)
duplicate_field_id = fields.Many2one(
'res.partner.dupli... |
from django.apps import AppConfig
class FrikanalenAppConfig(AppConfig):
name = 'fkbeta'
def ready(self):
# Register the signal receivers
from . import signals
signals # Fooling flake8 |
{
'name': 'Invoice Line View OAW',
'version': '8.0.1.0.1',
'category': 'Account',
'summary': 'Adds Invoice Line menu item',
'description': """
Main Features
==================================================
* Add menu item Invoice Lines
* Captures exchange rates as of the invoice dates and shows th... |
from wasp_general.version import __author__, __version__, __credits__, __license__, __copyright__, __email__
from wasp_general.version import __status__
from abc import ABCMeta, abstractmethod
import socket
import struct
from wasp_general.verify import verify_type, verify_value
from wasp_general.config import WConfig
f... |
from __future__ import unicode_literals
from .abc import (
ABCIE,
ABCIViewIE,
)
from .abcnews import (
AbcNewsIE,
AbcNewsVideoIE,
)
from .abcotvs import (
ABCOTVSIE,
ABCOTVSClipsIE,
)
from .academicearth import AcademicEarthCourseIE
from .acast import (
ACastIE,
ACastChannelIE,
)
from .a... |
"""Common configuration constants
"""
PROJECTNAME = 'ebc.licenciamento'
ADD_PERMISSIONS = {
# -*- extra stuff goes here -*-
'Programa': 'ebc.licenciamento: Add Programa',
} |
import matplotlib.pyplot as plt
import numpy as np
from polyFeatures import polyFeatures
def plotFit(min_x, max_x, mu, sigma, theta, p):
"""plots the learned polynomial fit with power p
and feature normalization (mu, sigma).
"""
# We plot a range slightly bigger than the min and max values to get
# ... |
import unittest
from typing import List
import utils
class Solution:
def maxProfit(self, k: int, prices: List[int]) -> int:
if k <= 0 or len(prices) < 2:
return 0
if k * 2 >= len(prices):
result = 0
for i in range(1, len(prices)):
result += max(0, ... |
import os
import collections
SearchResult = collections.namedtuple('SearchResult',
'file, line, text')
def main():
print_header()
folder = get_folder_from_user()
if not folder:
print("Sorry we can't search that location")
return
text = get_search_tex... |
import mock
from murano.dsl import murano_method
from murano.dsl import murano_type
from murano.dsl import object_store
from murano.engine.system import test_fixture
from murano.tests.unit import base
class TestTestFixture(base.MuranoTestCase):
def setUp(self):
super(TestTestFixture, self).setUp()
s... |
import json
import falcon
from apiRequests.RequestCodes import Code200, Code400, Code404, Code409, Code500, HTTP_804, CodeError, HTTP_805, HTTP_803, HTTP_810, \
HTTP_TOPOLOGY_ERROR, HTTP_GIST_ERROR
class ResponsesHandler:
@staticmethod
def handle_200(resp, data=None, msg=None):
resp.body = json.dump... |
"""Code for managing an in-memory cache of negative examples."""
import collections
from typing import Dict
import tensorflow.compat.v2 as tf
NegativeCache = collections.namedtuple('NegativeCache', ['data', 'age'])
class CacheManager(object):
"""Manages an in-memory FIFO or LRU cache of tensor data.
To use with a d... |
import logging
from datetime import datetime
class Dateloghandler(logging.FileHandler):
def __init__(self, filename, mode):
path = '/auto_results/'
fname = datetime.now().strftime(".%Y.%m.%d-%H.%M")
super(Dateloghandler, self).__init__(path + filename + fname, mode) |
import argparse
from time import sleep
import grpc
from gnmi import gnmi_pb2
import google.protobuf.text_format
import signal
import sys
import threading
import queue
parser = argparse.ArgumentParser(description='Mininet demo')
parser.add_argument('--grpc-addr', help='P4Runtime gRPC server address',
... |
'''
New Integration test for image replication.
Check Image Replication after All BS recovering from powered off
@author: Legion
'''
import os
import time
import random
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
image_name = 'image-replication-test-' + time.strftime('%y%... |
"""Definition of Touchdown problem."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import pickle
from absl import flags
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
from valan.framework import common
from valan... |
import functools
import os
from collections import OrderedDict
from distutils.version import StrictVersion
class Command(object):
def complete(self, cmd, text):
return []
def __call__(self, cmd, *args, **kwargs):
pass
def noargs_command(func):
@functools.wraps(func)
def wrapper(self, cmd... |
"""Renewable certificates storage."""
import datetime
import logging
import os
import re
import configobj
import parsedatetime
import pytz
from letsencrypt import constants
from letsencrypt import crypto_util
from letsencrypt import errors
from letsencrypt import error_handler
from letsencrypt import le_util
logger = l... |
"""VIF drivers for VMWare."""
from nova import exception
from nova import flags
from nova import log as logging
from nova.virt.vif import VIFDriver
from nova.virt.vmwareapi import network_utils
LOG = logging.getLogger(__name__)
FLAGS = flags.FLAGS
FLAGS.set_default('vmwareapi_vlan_interface', 'vmnic0')
class VMWareVlan... |
"""
Custom generic managers
"""
import django
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.query import QuerySet
from django.utils.translation import get_language
from parler import appsettings
from parler.utils import get_active_language_choices
class Trans... |
import os
import re
import sys
from oslo.utils import units
from oslo_config import cfg
from cinder import exception
from cinder.i18n import _
from cinder.image import image_utils
from cinder.openstack.common import fileutils
from cinder.openstack.common import log as logging
from cinder import utils
from cinder.volume... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class Sinh(Base):
@staticmethod
def export(): # type: () -> None
... |
import os, sys
import subprocess
import flashtool
def replace(script, key, value):
key = str(key)
value = str(value)
startid = script.find("\n" + key + "=")
startid += 1
assert script[startid - 1] == "\n"
endid = script.find("\n", startid)
print("Replacing|{}|==>|{}|".format(script[startid:endid], key + "... |
import os
import re
import importlib
import subprocess
from pkg_resources import get_distribution
from string import ascii_letters
from distutils.core import setup
file_path = os.path.abspath(os.path.dirname(__file__))
__project__ = 'zbsmsa'
def get_version(project=__project__):
result = re.search(r'{}\s*=\s*[\'"](... |
import pygame
import sys
class Score():
# Colors
WHITE = ( 255, 255, 255)
def __init__ (self, maxY):
self.score = 0
self.maxY = maxY
def addScore(self, by=1):
self.score += by
def draw(self, screen):
font = pygame.font.SysFont('Calibri', 35, True, False)
te... |
import pretend
from warehouse.accounts.interfaces import ITokenService, TokenExpired
from warehouse.manage.tasks import update_role_invitation_status
from warehouse.packaging.models import RoleInvitationStatus
from ...common.db.packaging import ProjectFactory, RoleInvitationFactory, UserFactory
class TestUpdateInvitati... |
"""Benchmark acosh."""
from __future__ import print_function
import timeit
NAME = "acosh"
REPEATS = 3
ITERATIONS = 1000000
def print_version():
"""Print the TAP version."""
print("TAP version 13")
def print_summary(total, passing):
"""Print the benchmark summary.
# Arguments
* `total`: total number ... |
"""Factory to create (benchmark) MFG games with different settings."""
from typing import Optional
from absl import logging
from open_spiel.python.games import dynamic_routing_data
import open_spiel.python.mfg.games as games # pylint: disable=unused-import
from open_spiel.python.mfg.games import crowd_modelling_2d
fro... |
"""Classes for analyzing and storing the state of Python code blocks."""
from __future__ import unicode_literals
import abc
import collections
import re
from grumpy_tools.compiler import expr
from grumpy_tools.compiler import util
from pythonparser import algorithm
from pythonparser import ast
from pythonparser import ... |
from google.cloud import translate_v3
async def sample_delete_glossary():
# Create a client
client = translate_v3.TranslationServiceAsyncClient()
# Initialize request argument(s)
request = translate_v3.DeleteGlossaryRequest(
name="name_value",
)
# Make the request
operation = client.... |
id_seq_relacao_trabalhista|id_pessoa_fisica|id_estab|dt_ini_relacao_trabalhista|nu_dias_contribuicao|vl_remuneracao_total|vl_remuneracao13_total|vl_remuneracao_fgts_total
('1249948386', (('1999-06-08', '304', '3522.09', '317.70', ''), ('1997-04-15', '', '12174.04', '508.89', '')))
def calculateRelacoes(x):
relations ... |
import mock
import copy
import xml.dom.minidom as xml
from sahara.plugins.spark import config_helper as c_helper
from sahara.swift import swift_helper as swift
from sahara.tests.unit import base as test_base
from sahara.utils import xmlutils
class ConfigHelperUtilsTest(test_base.SaharaTestCase):
def test_make_hadoo... |
import proto # type: ignore
from google.ads.googleads.v10.enums.types import (
placement_type as gage_placement_type,
)
__protobuf__ = proto.module(
package="google.ads.googleads.v10.resources",
marshal="google.ads.googleads.v10",
manifest={"DetailPlacementView",},
)
class DetailPlacementView(proto.Mes... |
import os
import re
import gzip
import pandas as pd
from cuttsum.data import get_resource_manager, MultiProcessWorker
from cuttsum.misc import ProgressBar
import random
import GPy
import numpy as np
from collections import defaultdict
import multiprocessing
import signal
import sys
import Queue
from sklearn.preprocessi... |
"""This module implements the listbox widget"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
from builtins import range
from asciimatics.strings import ColouredText
from asciimatics.widgets.u... |
"""Synapse Evaluation Board base definitions
This module provides easy initialization of the evaluation boards:
Demonstration Boards (SN163, SN111), and
Proto Board (SN171) and SNAPstick (SN132)
Call the function 'detectEvalBoards()' to detect and intialize one of these
boards in the default configuration.
"""
from... |
'''
------------------------------------------------------------------------------
Copyright 2018 Esri
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.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.