src stringlengths 721 1.04M |
|---|
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.battle.DistributedBattleBldg
from panda3d.core import Lens, Point3, Vec3
from direct.actor import Actor
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import State
from direct.interval.IntervalGlobal import *
import random
fr... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import math
import time
import random
random.seed(67)
import numpy as np
np.random.seed(67)
import pandas as pd
import tensorflow as tf
tf.set_random_seed(67)
from sklearn.utils import shuffle
from sklearn.... |
class ChartEntry:
def __init__(self):
self._identifier = ''
self._x = -1
self._y = -1
self._confidence_interval_95 = -1
def __str__(self):
rez = '\n## Is valid : ' + str(self.is_valid()) + ' ##'
rez += '\nIdentifier : ' + self.identifier
rez += '... |
#!/usr/bin/env python
# -------------------------------- WebLogo --------------------------------
# Copyright (c) 2003-2004 The Regents of the University of California.
# Copyright (c) 2005 Gavin E. Crooks
# Copyright (c) 2006-2011, The Regents of the University of California, through
# Lawrence Berkeley Nationa... |
from abc import ABCMeta, abstractmethod
from .constants import PARALLEL_PROFILE
from .utils import setup_progressbar, grouper, flatten_list
import logging
import multiprocessing
import sys
logger = logging.getLogger(__name__)
__author__ = 'kgori'
"""
Introduced this workaround for a bug in multiprocessing where
error... |
"""Utils for populatedb."""
import os
import re
import string
from itertools import cycle
from contextlib import contextmanager
from django.core.files import File
from django.db.models.base import ModelBase
from factory.base import FactoryMetaClass
HERE = os.path.dirname(os.path.abspath(__file__))
def format_keys(... |
# -*- coding: utf-8 -*-
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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
#... |
# -*- coding: utf-8 -*-
# @ 2017 Akretion - www.akretion.com.br -
# Clément Mombereau <clement.mombereau@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase
class ValidCreateIdTest(Transactio... |
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
import urllib
import logging
# Django
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.utils.timezone import now, utc
from django.views.generic import View
from django.views.generic.base import RedirectView... |
import datetime
import logging
import Mollie
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.template.context_processors import csrf
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts impor... |
# Authors: Paulius Sarka <paulius.sarka@gmail.com>
#
# Based on sklearn/tree/tree.py (BSD 3 clause)
#
# Licence: BSD 3 clause
from abc import ABC
from abc import abstractmethod
from math import ceil
import numbers
import numpy as np
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..base import... |
"""
Django settings for Symplicity project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
import dj_database_url
# Build paths inside the... |
#!/usr/bin/env python
import os
from pathlib import Path
from setuptools import find_packages, setup
here = Path(__file__).resolve().parent
README = (here / 'README.rst').read_text(encoding='utf-8')
VERSION = (here / 'VERSION').read_text(encoding='utf-8').strip()
excluded_packages = ["docs", "tests", "tests.*"]
if... |
from corehq.apps.reports.dont_use.fields import ReportSelectField
from corehq.apps.reports.filters.users import SelectCaseOwnerFilter
from django.utils.translation import ugettext_noop
from django.utils.translation import ugettext as _
from corehq.apps.es import CaseES
def _get_blocks(domain):
query = (CaseES('re... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# demo.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions ... |
"""
database connection
"""
import os
import re
import sys
import copy
import random
import inspect
import time
import datetime
import threading
from future.utils import iteritems
from .command_spec import CommandSpec
from .job_spec import JobSpec
from .work_spec import WorkSpec
from .file_spec import FileSpec
from ... |
# Copyright (c) 2011, Alex Krizhevsky (akrizhevsky@gmail.com)
# 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, date
from dateutil.parser import parse
import sys
import os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../lib'))
from utilities.toUTC import toUTC
class TestToUTC():
def result_is_datetime(self, result):
assert type(result) == datetime
... |
from __future__ import absolute_import
from django.dispatch import Signal
class BetterSignal(Signal):
def connect(self, receiver=None, **kwargs):
"""
Support decorator syntax:
>>> @signal.connect(sender=type)
>>> def my_receiver(**kwargs):
>>> pass
"""
... |
"""
Django settings for site_a project.
Generated by 'django-admin startproject' using Django 1.8.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths... |
# Copyright 2016-2017 Capital One Services, 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 ... |
#!/usr/bin/env python
#Use this script to find calibration points for your meter (add to settings.py).
#External settings
import settings
#External modules
import time
if settings.piMode:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(settings.slavePin, GPIO.OUT)
if(settings.meterPin != Fa... |
# this should possibly be a abstract class as well
from . import ConfigSource
class DictSource(ConfigSource):
def __init__(self, **kwargs):
"""If your backend data is exposable as a python dict, you can
subclass from this class to avoid implementing :py:meth:`has`,
:py:meth:`get`, :py:meth... |
import numpy
has_matplotlib = True
try:
from matplotlib import pyplot, figure
except ImportError:
has_matplotlib = False
from dagpype._core import filters
def _make_relay_call(fn, name):
def new_fn(*args, **kwargs):
@filters
def _dagpype_internal_fn_act(target):
try:
... |
from sympy import (
Abs, And, Derivative, Dummy, Eq, Float, Function, Gt, I, Integral,
LambertW, Lt, Matrix, Or, Piecewise, Poly, Q, Rational, S, Symbol,
Wild, acos, asin, atan, atanh, cos, cosh, diff, erf, erfinv, erfc,
erfcinv, erf2, erf2inv, exp, expand, im, log, pi, re, sec, sin,
sinh, solve, so... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/settings/fort_settings.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... |
from mosek.fusion import Model, Domain, Expr, ObjectiveSense
import sys
# Example 1. Full representation of 3-image problem with all maximal cliques.
# DICP instance:
#
# Resource consumption by command:
#
# C = {A, B, C, D}
#
# | x = A: 5 |
# r(c) = | x = B: 10 |
# | x = C: 7 |
# ... |
# -*- coding: utf-8 -*-
import re
from chatbot.bot import BotPlugin
from chatbot import api
class Plugin(BotPlugin):
def __init__(self, oldme, bot):
super().__init__(oldme, bot)
self.register_command("tags", self._list, argc=0)
self.register_event_handler(api.APIEvents.Message, self._on_m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from os import listdir
from os.path import isfile, join
from random import shuffle
from pybrain.datasets import ClassificationDataSet
from pybrain.tools.shortcuts import buildNetwork
from pybrain.supervised.trainers i... |
from .base import *
from ..logger import logger
import numpy as np
from itertools import count
class Batch(StreamerBase):
_count = count(0)
def __init__(self, prev, batch_size, squeeze=False, name=None):
if not isinstance(batch_size, int):
raise KeyError('Batch size must be integer')
... |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... |
# Copyright 2013, 2014, 2015 Kevin Reid <kpreid@switchb.org>
#
# This file is part of ShinySDR.
#
# ShinySDR 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 opt... |
# -*- coding: UTF-8 -*-
import os
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import requests
import tempfile
import random
from django.conf import settings
from django.shortcuts import render_to_response
from django.template import RequestContext
from forms import CaptchaForm
import forms
from django.co... |
from Components.VariableText import VariableText
from Renderer import Renderer
from enigma import eLabel, eEPGCache, eServiceReference
from time import localtime, strftime
from skin import parseColor
class NextEpgInfo(Renderer, VariableText):
def __init__(self):
Renderer.__init__(self)
VariableText.__init__(self)... |
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
import mimetypes
import os
import os.path
import re
import random
import sys
import urllib
from collections import defaultdict
from datetime import datetime
from itertools import groupby
from django import template
from django.conf import settings
from dja... |
# 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 ... |
class ProxyDict(object):
def __init__(self, parent, collection_name, childclass, keyname):
self.parent = parent
self.collection_name = collection_name
self.childclass = childclass
self.keyname = keyname
@property
def collection(self):
return getattr(self.par... |
#
# rescue.py - anaconda rescue mode setup
#
# Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. All rights reserved.
#
# 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... |
ownerclass = 'DeletionOptions'
ownerimport = 'DeletionOptions.h'
result = Window(450, 240, "Deletion Options")
messageLabel = Label(result, "")
linkCheckbox = Checkbox(result, "Link deleted files")
linkLabel = Label(result, "After having deleted a duplicate, place a link targeting the "
"reference file to replace ... |
#!/usr/bin/python3 -u
import os
import logging
import string
import re
import urllib
from urllib import parse as urlparse
import pprint
from lxml import html
default_host = "youtube.com"
default_hurl = "https://"+default_host
skip_codes = { "#": "COMMENT", "@" : "DONE", "?" : "BAD_ITEM", "=" : "COMMAND" }
u... |
from datetime import date
from pyramid.config import Configurator
from pyramid.renderers import JSON
from sqlalchemy import engine_from_config
from .models import Base, DBSession
def date_adapter(obj, request):
return str(obj)
def main(global_config, **settings):
"""Return a Pyramid WSGI application."""
... |
#!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Aureus Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import pri... |
"""
Name: simulator
Author: Nezar Abdennur <nabdennur@gmail.com>
Created: 23/04/2012
Copyright: (c) Nezar Abdennur 2012
"""
from cps.misc import IndexedPriorityQueue
from cps.exception import ZeroPopulationError, SimulationError
import random
NORMAL = 0
CONSTANT_NUMBER = 1
class BaseSimulator(obj... |
#
# Copyright (c) 2014, Red Hat, 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 copyright
# notice, this list of conditions a... |
#!/usr/bin/python3
# Copyright (C) 2014 Peter Todd <pete@petertodd.org>
#
# This file is subject to the license terms in the LICENSE file found in the
# top-level directory of this distribution.
import argparse
import binascii
import bitcoin
import bitcoin.rpc
import logging
import math
import time
from bitcoin.core ... |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.Crypter import Crypter
class MultiloadCz(Crypter):
__name__ = "MultiloadCz"
__type__ = "crypter"
__version__ = "0.41"
__pattern__ = r'http://(?:[^/]*\.)?multiload\.cz/(stahnout|slozka)/.+'
__config__ = [("use_subfolder" , ... |
# -*- 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 M2M table for field studies_for on 'Treatment'
m2m_table_name = db.shorten_name(u'pbl_treatment_stu... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 25 14:34:25 2017
@author: manfred.madelaine
"""
import time
def affStart():
msg1 = "*** Binvenue dans i-Opinion ou Opinion Way ***"
msg2 = "Le logiciel d'analyse et de classification des revues cinématographiques !"
listMsg = []
listMsg.append("")
... |
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class nss_pam_ldapd(test.test):
"""
Autotest module for testing basic functionality
of nss_pam_ldapd
@author
"""
version = 1
nfail = 0
path = ''
def init... |
import sys
class Solution:
def __init__(self):
self.stack = list()
self.queue = list()
def pushCharacter(self, char):
self.stack.append(char)
def popCharacter(self):
return(self.stack.pop(-1))
def enqueueCharacter(self, char):
self.queue.append(char)
... |
from . import _pyrest_core
class Identifier(_pyrest_core.BaseObject):
""""""
class Sequence(_pyrest_core.BaseObject):
""""""
class Feature(_pyrest_core.BaseObject):
""""""
seq_region_name = property(_pyrest_core.fget("_seq_region_name"), None, None, """Name of the chromosome, scaffold, etc the feat... |
"""
Tests for the logic in input type mako templates.
"""
import unittest
import capa
import os.path
import json
from lxml import etree
from mako.template import Template as MakoTemplate
from mako import exceptions
from capa.inputtypes import Status
class TemplateError(Exception):
"""
Error occurred while re... |
#!/usr/bin/env python
#
# Use the raw transactions API to spend grumpycoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a grumpycoind ... |
# vim: set fileencoding=utf-8 :
from flask import render_template, flash, redirect, session, url_for, request, g
from flask.ext.login import login_user, logout_user, current_user, login_required
from app import app, db, lm, oid
from forms import LoginForm, NewEventForm
from models import User, Event, Place
import dat... |
# Copyright (c) 2018 PaddlePaddle 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 app... |
# -*- coding: utf-8 -*-
"""
pyte.graphics
~~~~~~~~~~~~~
This module defines graphic-related constants, mostly taken from
:manpage:`console_codes(4)` and
http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html.
:copyright: (c) 2011-2012 by Selectel.
:copyright: (c) 2012-2017 by pyte ... |
import json
import boto3
import os
import time
import base64
from datetime import datetime
from botocore.exceptions import ClientError
iam_client = boto3.client('iam')
secret_client = boto3.client('secretsmanager')
kms_client = boto3.client('kms')
sqs_client = boto3.client('sqs')
now = datetime.now()
iam_users = os.ge... |
#-*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from datetime import datetime
class Categorie(models.Model):
id = models.AutoField(primary_key=True, db_column='id')
name = models.CharField(max_length=45, unique=True, db_column='name')
description = models.Te... |
# 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, ... |
# -*- coding:utf-8 -*-
import os
import os.path
import unittest
from copy import copy
from statik.config import StatikConfig
from statik.errors import MissingParameterError
from statik.markdown_config import MarkdownConfig
TEST_CONFIG = """project-name: Test Project
base-path: /blog/
assets:
source: src_static
... |
from __future__ import unicode_literals
from ..enums import IncrementalSearchDirection, InputMode
from ..keys import Keys
from ..line import ClipboardData, ClipboardDataType, SelectionType, indent, unindent
from ..selection import SelectionType
from .basic import basic_bindings
from .utils import create_handle_decorat... |
#!/usr/bin/env python
import json
import sys
import os
from collections import OrderedDict
import re
import string
base_path = "syncthing/src/github.com/syncthing/syncthing"
langdir = "gui/assets/lang"
resdir = "app/src/main/res"
resfile = "strings-syncthing.xml"
validKeyChars = string.ascii_letters+string.digits+'_... |
# -*- coding: utf-8 -*-
from ..test_base import TestBase
from models import Invite
from models import Institution
from models import InviteInstitution
from models import User
from custom_exceptions import FieldException
from mock import patch
class InviteInstitutionTest(TestBase):
"""Test invite model."""
... |
#!/usr/bin/env python3
import config
import smtplib
import ssl
import sys
import time
import urllib.error, urllib.parse, urllib.request
from bs4 import BeautifulSoup
from datetime import datetime
last_page = ''
class ClassyUrlOpener(urllib.request.FancyURLopener):
version = 'Mozilla/5.0 (X11; Linux x86_64; rv:21.0)... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
from concurrent.futures import ThreadPoolExecutor
# django
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db.models import Q
# trigger happy
from django_th.models import TriggerService
from dj... |
# This script generates the Makefiles for building PyQt5.
#
# Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
#
# This file is part of PyQt5.
#
# This file may be used under the terms of the GNU General Public License
# version 3.0 as published by the Free Software Foundation and appearin... |
import app_config
import app_events
from app_component import AppComponent
from app_events import *
from common_tasks import PatrolTask
from common_views import MessageView
from controller import Controller
from load_monitor_group_task import LoadMonitorGroupsTask
from monitor_stream_task import MonitorStreamTask
cla... |
import znc
import os
def is_safe_path(basedir, path):
return os.path.abspath(path).startswith(basedir)
class weblog(znc.Module):
module_types = [znc.CModInfo.GlobalModule]
description = "Allowings viewing of log files from the ZNC webadmin"
wiki_page = "Weblog"
def OnLoad(self, args, message):
... |
from builtins import str
from builtins import object
import bcrypt
import logging
from biomaj.mongo_connector import MongoConnector
from biomaj.config import BiomajConfig
class BmajUser(object):
'''
Biomaj User
'''
def __init__(self, user):
if MongoConnector.db is None:
MongoConn... |
#!/usr/local/bin/python3.6
import tkinter as tk
from tkinter import messagebox as mb
from PIL import Image, ImageTk
class SelectRegionApp(tk.Tk):
def __init__(self, image_filename, image_resize, result):
tk.Tk.__init__(self)
self.result_dict = result
self.x = self.y = 0
im = Image.o... |
from django.contrib.admin.views.decorators import staff_member_required
from django.http import JsonResponse
from django.contrib.auth.decorators import permission_required
from rest_framework.decorators import api_view
from mbu.models import Scout, ScoutCourseInstance, ScoutCourseInstanceSerializer, RegistrationStatus
... |
from __future__ import print_function, division
from collections import defaultdict
from sympy.core.basic import C, Basic
from sympy.core.compatibility import cmp_to_key, reduce, is_sequence
from sympy.core.singleton import S
from sympy.core.operations import AssocOp
from sympy.core.cache import cacheit
from sympy.co... |
from flask import Flask, Blueprint, request, jsonify
from flask_restful import reqparse, abort, Api, Resource
from api.auth import Signup, Signin
parser = reqparse.RequestParser()
# parser.add_argument('username', type=str, location='json')
# json_data = request.get_json(force=True)
API_VERSION_V1 = 1
API_VERSION = A... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# This software is licensed as described in the README.rst and LICENSE
# files, which you should have received as part of this distribution.
import setuptools
# noinspection PyPep8Naming
from raspi_mc import __version__ as VERSION
DEPS = ['RPi.Sensor>=0.5.2']
CLASSIFIERS =... |
import inspect
from server.customhttp import HTTPResponse
class NoSuchUrl(Exception):
def __init__(self, url):
self.url = url
class Dispatcher:
def __init__(self, urls, scheduler, deque):
self.deque = deque
self.urls = urls
self.scheduler = scheduler
def dispatch(self, ... |
from citrination_client.models import ServiceStatus
from citrination_client.base.errors import CitrinationClientError
import pytest
example_status_response_dict = {
"reason": "Please wait for machine learning features to become available",
"ready": True,
"context": "notice",
"event": {
"title": "Initializi... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
#!/usr/bin/python
# A Basic SimpleCV interactive shell tutorial
#load required libraries
from __future__ import print_function
from SimpleCV import *
from subprocess import call
from code import InteractiveInterpreter
import platform
lb = "\n" #linebreak
tb = "\t" #tab
tutorial_interpreter = InteractiveInterpreter(... |
#!/usr/bin/python
#
# Copyright 2010 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the follo... |
# Copyright (C) 2006 Novell Inc. All rights reserved.
# This program is free software; it may be used, copied, modified
# and distributed under the terms of the GNU General Public Licence,
# either version 2, or version 3 (at your option).
from __future__ import print_function
__version__ = '0.171.git'
# __store_ve... |
import sys
import random
import math
w, h = map(int, input().split())
jumps = int(input())
x, y = map(int, input().split())
px, py = x, y
search_zone = [(x, y) for x in range(w) for y in range(h)]
def distance(ax, ay, bx, by):
return math.sqrt((bx - ax)**2 + (by - ay)**2)
def around(zone, x, y):
return [(x, ... |
import json
import sys
from tabulate import tabulate
from cook import http, terminal
from cook.format import format_job_memory, format_memory_amount
from cook.querying import query_across_clusters, make_job_request
from cook.util import guard_no_cluster, current_user, print_info, print_error
def get_job_data(cluste... |
# -*- coding: utf8 -*-
import sys, os
sys.path.append(os.path.abspath('.'))
import re
from operator import attrgetter
import difflib
# Pylons model init sequence
import pylons.test
import logging
from quanthistling.config.environment import load_environment
from quanthistling.model.meta import Sessi... |
#
# Copyright (c) 2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
import six
import sys
import unittest
from greentea import greentea_cli
from greentea.gtea.tests_spec import TestSpec
test_spec_def = {
"builds": {
"K64F-ARM": {
"platform": "K64F... |
import sys
import os
def current_file_directory():
return os.path.dirname(os.path.realpath(__file__))
BASE_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(BASE_DIR)
from paper_plane import django_models_init
from treasure.models import FileMapping
from k_util.hash_util import... |
#!/usr/bin/env python
# System
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from os import curdir, sep
import BaseHTTPServer
import CGIHTTPServer
import os
import socket
import string, cgi, time
import sys
import urlparse
# Lib
import app_config
import webserver_util
app_config_path = (
os.path.di... |
""" Testing the "self.set_attribute()" and "self.set_attributes()" methods
to modify a Google search into becoming a Bing search.
set_attribute() -> Modifies the attribute of the first matching element.
set_attributes() -> Modifies the attribute of all matching elements. """
from seleniumbase import BaseCa... |
#!/usr/bin/python
#-*- coding: utf-8 -*-
# Author: Adrian Czapla
# Date: 2016
################################################################################
import pygame
import pygame.image as img
from pygame import transform
################################################################################
dis... |
""" optparser helper functions """
import optparse
import textwrap
class HelpFormatter(optparse.IndentedHelpFormatter):
"""
Modified version of certain optparse.IndentedHelpFormatter methods:
* Respect line-breaks in parser.desription and option.help_text
* Vertically-align long_opts
Inspired by: ... |
import logging
from ....api import Session
from ....common.i18n import N_
from ....common.signal import Signal
from ....promise import reduce_coroutine
from ...event_promise import ensure_gui_thread
from ..base_window_controller import BaseWindowController
_logger = logging.getLogger(__name__)
class ChangePassword... |
#!/usr/bin/env python
# Test this by entering the search string "election" on a command line like this:
# /home/wevote/WeVoteServer/search/query_test_script.py election
from elasticsearch import Elasticsearch
import sys
es = Elasticsearch(["172.31.24.246:9200"], timeout = 120, max_retries = 5, retry_on_timeout = True... |
# stdlib
from io import StringIO
import sys
from typing import Any
from typing import List
# third party
import pytest
import torch as th
# syft absolute
import syft as sy
from syft.core.node.common.client import AbstractNodeClient
from syft.core.pointer.pointer import Pointer
def validate_output(data: Any, data_pt... |
# Copyright (c) 2012 OpenStack, LLC.
# 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... |
# -*-coding:utf-8 -*-
"""
Created on 11/26/2015
@author: Danny<manyunkai@hotmail.com>
DannyWork Project.
"""
import json
import tornado.gen
from .request import request_async
from .token import get_access_token
from exception.request import GetSelfMenuFailed
from docking.models.material import Material, NewsMessage... |
"""
The latest version of this package is available at:
<http://github.com/jantman/RPyMostat-sensor>
##################################################################################
Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file is part of RPyMostat-sensor, also known... |
# vi: encoding=utf-8
# teryt2osm - tool to merge TERYT data with OSM maps
# Copyright (C) 2009 Jacek Konieczny <jajcus@jajcus.net>
#
# 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 versi... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2021 Jose Antonio Chavarría <jachavar@gmail.com>
# Copyright (c) 2015-2021 Alberto Gacías <alberto@migasfree.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 Softw... |
import libardrone
import numpy
from time import time,sleep
from sys import stdout,exit,argv
from math import sqrt,pi
from PID import PID
import diffOrdN
GRADOS=pi/180
class Integral:
""" Calcula la integral de una funcion dada como parametro"""
def __init__(self,f):
self.f=f
self.integral=0.
self.val=0.
def... |
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.mail import Mail
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from config import config
from flask.ext.socketio import SocketIO
bootstrap = Bootstrap()
mail = Mai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.