text stringlengths 1 927k |
|---|
import numpy as np
import os
import inspect
import sys
LOCATION = "/".join(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))).split("/")[:-1])
sys.path.insert(0, LOCATION)
from powerbox import PowerBox, get_power
def test_power1d():
p = [0] * 40
for i in range(40):
pb = PowerB... |
from abc import ABC, abstractmethod
from dataclasses import dataclass, field, replace
from enum import Enum, Flag
from typing import Dict, List, Optional, Callable, Union, Any, TypeVar, Generic
from .pitch import PitchDimensions, Point, Dimension
from .formation import FormationType
from ...exceptions import (
Ori... |
""" file: setup_extensions.py (cogj)
author: Jess Robertson, @jesserobertson
date: Saturday, 16 March 2019
description: Set up Cython extensions for CO-GJ
"""
from pathlib import Path
from logging import getLogger
from multiprocessing import cpu_count
import numpy
from setuptools import Extension
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
TEXT = '''
Stock Analysis System
'''
ABOUT = '''
Name: Stock Analysis System
Author: Sleepy
E-Mail: sleepysoft@163.com
'''
VERSION = '0.0.5'
HISTORY = '''
''' |
import typing as _t
import zlib
from ._json import _CompactJSON
from .encoding import base64_decode
from .encoding import base64_encode
from .exc import BadPayload
from .serializer import Serializer
from .timed import TimedSerializer
class URLSafeSerializerMixin(Serializer):
"""Mixed in with a regular serializer... |
"""class GitHandler(object):
def __init__(self):
def register(self, path, track=True):
def to_gitignore(self, dir):""" |
#!/usr/bin/env python
import re
from setuptools import setup
# Version handline needs to be programatic because
# we can't import toga_curses to compute the version;
# and to support versioned subpackage dependencies
with open('toga_curses/__init__.py', encoding='utf8') as version_file:
version_match = re.search(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/4/15 14:51
# @Author : LoRexxar
# @File : Pretreatment.py
# @Contact : lorexxar@gmail.com
from phply.phplex import lexer # 词法分析
from phply.phpparse import make_parser # 语法分析
from phply import phpast as php
from bs4 import BeautifulSoup
import esp... |
# Copyright 2018 Tensorforce Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
#
# Copyright (C) 2018 Giuliano Pasqualotto (github.com/giulianopa)
# This code is licensed under MIT license (see LICENSE.txt for details)
#
import platform
import datetime
import geocoder
import decimal
import socket
import boto3
import time
import json
from urllib2 import urlopen
def get_location():
""" Get cu... |
import traceback
from collections import defaultdict
from revscoring.errors import ModelInfoLookupError
from .... import errors
from ... import responses, util
def format_v3_score_response(response):
"""
{
"<context_name>": {
"scores": {
"<rev_id>": {
... |
"""
PSET-3
Hangman Part 3: Printing Out all Available Letters
Next, implement the function getAvailableLetters that takes in one
parameter - a list of letters, lettersGuessed. This function returns
a string that is comprised of lowercase English letters - all lowercase
English letters that are not in lettersGuessed.... |
from thetis import *
import math
import pytest
@pytest.fixture(params=['rt-dg', 'dg-dg', 'dg-cg', 'bdm-dg'])
def element_family(request):
return request.param
def test_steady_state_channel_mms(element_family, do_exports=False):
lx = 5e3
ly = 1e3
order = 1
# minimum resolution
min_cells = 48... |
# qubit number=5
# total number=54
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... |
# -*- coding: utf-8 -*-
""" Tests for calculations
"""
import os
import numpy as np
from aiida.plugins import CalculationFactory
from aiida.orm import Dict
from aiida.engine import run, run_get_node
from aiida_spirit.tools.helpers import prepare_test_inputs
from . import TEST_DIR
def test_input_para_validator():
... |
""" Dwarf Fortress portable wiki """
import os
os.chdir(os.path.dirname(os.path.abspath(__file__)))
import pwiki.util as util
util.add_path('depends/bottle')
import pwiki.database as database
import pwiki.parser as parser
import pwiki.server as server
def main():
util.printf('Loading database... ')
db = data... |
"""
The cli entry point for linting slurm configs
"""
import argparse
import sys
from slurmlint.linter import lint
from slurmlint.__version__ import __version__
def cli():
"""
CLI entry point for Slurm Configuration Linter
Run ``slurmlint --help`` for usage
"""
version_msg = 'slurmlint, version {... |
"""
Postgres.py - file with PostgreSQL Database interactions funcs
"""
import psycopg2
from simplejson import loads, dumps
from configs import db_configs
from psycopg2.extras import Json
db = psycopg2.connect(**db_configs)
cur = db.cursor()
def upload_link(link, id_):
cur.execute("UPDATE seq_table SET link = '%... |
# -*- coding: utf-8 -*-
from benedict.core.traverse import traverse
from benedict.utils import type_util
def _get_term(value, case_sensitive):
v_is_str = type_util.is_string(value)
v = value.lower() if (v_is_str and not case_sensitive) else value
return (v, v_is_str)
def _get_match(query, value, exact,... |
# Leo colorizer control file for rib mode.
# This file is in the public domain.
# Properties for rib mode.
properties = {
"doubleBracketIndent": "false",
"indentNextLines": "Begin|WorldBegin|FrameBegin|TransformBegin|AttributeBegin|SolidBegin|ObjectBegin|MotionBegin",
"lineComment": "#",
"lineUpClosing... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... |
import uuid
import yaml
import os
from copy import deepcopy
from datetime import datetime
from contextlib import contextmanager
from yaml.representer import SafeRepresenter
from yaml.emitter import Emitter
from yaml.serializer import Serializer
from yaml.resolver import Resolver
from twisted.python.util import unti... |
from lenstronomy.LightModel.light_model import LightModel
import numpy as np
__all__ = ['DifferentialExtinction']
class DifferentialExtinction(object):
"""
class to compute an extinction (for a specific band/wavelength). This class uses the functionality available in
the LightModel module to describe an ... |
from .particles import Particle, particles
from .process import Process |
# Copyright 2021 NREL
# 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, software
# distri... |
"""
Django settings for main project.
Generated by 'django-admin startproject' using Django 2.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
# Bu... |
# coding: utf-8
"""
Text2Label by word vector APIs
Text to label by word2vec of contents.<BR />[Endpoint] https://api.apitore.com/api/19 # noqa: E501
OpenAPI spec version: 0.0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import... |
#!/usr/bin/env python
# Copyright (C) 2013 Ion Torrent Systems, Inc. All Rights Reserved
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('cleanup_unusedPlansByAge')
# log.setLevel(logging.DEBUG)
import iondb.bin.djangoinit
from iondb.rundb import models
import pytz
from datetime impor... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse
from ..utils import (
ExtractorError,
int_or_none,
parse_iso8601,
)
class ShahidIE(InfoExtractor):
_VALID_URL = r'https?://shahid\.mbc\.net/ar/episode/(?P<id>\d+)/?'
... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import re
import datetime
import os
import sys
# -- Path setup -----------------------... |
#!/usr/bin/env python
## This script generate the graphs that compares handel signature
## generation with different number of failing nodes for a fixed
## number of total nodes, and a fixed threshold 51%
##
import sys
import matplotlib.pyplot as plt
import pandas as pd
plt.figure(figsize=(4,2))
from lib import *
... |
# Copyright 2022 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 __future__ import absolute_import
from __future__ import print_function
import os
import sys
import numpy as np
import librosa
import toolkits
import random
# ===========================================
# Parse the argument
# ===========================================
import argparse
parser = argparse.Ar... |
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the... |
"""MRI data processing with retinex and balance methods."""
from __future__ import division
import os
import numpy as np
import nibabel as nb
from iphigen import core, utils
from iphigen.ui import user_interface, display_welcome_message
import iphigen.config as cfg
def main():
"""Iphigen processes for nifti imag... |
from flask import Flask
from flask_socketio import SocketIO, emit
import os
app = Flask(__name__)
app.config['SECRET KEY'] = 'secret!'
socket = SocketIO(app)
@app.route('/')
def index():
emit("hola")
return "Hola"
if __name__ == "__main__":
port = int(os.environ.get('PORT',5000))
host = '0.0.0.0'
... |
import logging
import os
from functools import reduce
from collections import defaultdict
from prometheus_client.metrics_core import GaugeMetricFamily, HistogramMetricFamily, GaugeHistogramMetricFamily
from prometheus_client.utils import INF
import api
import settings
from helpers import execution_duration, Histogram... |
import os
import shutil
import subprocess
import tempfile
import contextlib
import unittest
import unittest.mock as mock
from types import ModuleType
import pkg_resources
from opsdroid.core import OpsDroid
from opsdroid.cli.start import configure_lang
from opsdroid.configuration import load_config_file
from opsdroid.c... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
#
# PySNMP MIB module Juniper-CBF-CONF (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-CBF-CONF
# Produced by pysmi-0.3.4 at Wed May 1 14:02:02 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... |
from django.db.models.signals import post_save
from django.dispatch import receiver
from allauth.socialaccount.models import SocialAccount
from django.contrib.auth.models import User
from furport.models import Profile
@receiver(post_save, sender=SocialAccount)
def socialAccountSaveHandler(sender, instance, created, ... |
#!/usr/bin/python
# Copyright 2014 Jens Carl, Hothead Games Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'stat... |
import base64
import requests
class PBClient(object):
def __init__(self, token, api_base_url, ssl_verify=True):
self.token = token
self.api_base_url = api_base_url
self.ssl_verify = ssl_verify
self.auth = base64.encodestring('%s:%s' % (token, '')).replace('\n', '')
def do_get(... |
import os
import logging
from buildwebapi import api as buildapi
LOG = logging.getLogger(__name__)
def get_build_type(build_id):
build = get_build(build_id)
LOG.debug('%s is %s build', build_id, build.buildtype)
return build.buildtype
def get_build_id_and_system(build_id):
build_system = 'ob'
i... |
import numpy as np
import pymc3 as pm
from typing import Callable, Dict
from ..io import io_commons
class VariationalParameterTrackerConfig:
"""Configuration for `VariationalParameterTracker`."""
def __init__(self):
self.var_names = []
self.inv_trans_list = []
self.inv_trans_var_names ... |
# coding: utf-8
"""
@title A Python DEAP implementation of Genetic Algorithms with Cluster Averaging Method for Solving Job-Shop Scheduling Problems
@see https://www.jstage.jst.go.jp/article/jjsai/10/5/10_769/_article/-char/ja/
@see https://www.personal-media.co.jp/book/comp/173/
@author Shigeta Yosuke
@email shigeta@t... |
# -*- coding: utf-8 -*-
"""
jinja2htmlcompress
~~~~~~~~~~~~~~~~~~
A Jinja2 extension that eliminates useless whitespace at template
compilation time without extra overhead.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import print_fun... |
import logging
logger = logging.getLogger(__name__)
async def process_name(*, name: str) -> str:
name = name.upper()
logger.info(f"action=process_name, status=success, name={name}")
return name |
# This an autogenerated file
#
# Generated with ContourDataPoint
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.contourdatapoint import ContourDataPointBlueprint
from typing import Dict
from sima.sima.moao import MOAO
from sima.sima.scriptableva... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, unittest, json
from frappe.test_runner import make_test_records_for_doctype
from frappe.core.doctype.doctype.doctype import InvalidFieldNameError
test_dependencies... |
# Generated by Django 4.0.1 on 2022-02-03 16:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bobapp', '0012_alter_gituser_email'),
]
operations = [
migrations.AddField(
model_name='chatmember',
name='latest_we... |
from __future__ import print_function
__author__ = 'Giacomo Govi'
import sqlalchemy
import sqlalchemy.ext.declarative
import subprocess
from datetime import datetime
import os
import sys
import logging
import string
import json
import CondCore.Utilities.credentials as auth
prod_db_service = 'cms_orcon_prod'
dev_db_s... |
import os
import pandas as pd
from experiments.conf import Config
from fairness import measure_fairness
from privacy.models import get_l_distinct, get_k
def evaluate_experiment(conf: Config):
# Load setup
setup = conf.get_setup()
A = setup["A"]
I = setup["I"]
O = setup["O"]
S = setup["S"]
... |
import numpy as np
import tensorflow as tf
from tensorflow.python.ops.array_grad import _TileGrad
from tensorflow.python.framework import ops
def shape(x):
if isinstance(x, tf.Tensor):
return x.get_shape().as_list()
return np.shape(x)
@ops.RegisterGradient("TileDense")
def tile_grad_dense(op, grad):... |
from typing import Optional
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils.module_loading import import_string
from psqlextra.partitioning import PostgresPartitioningError
class Command(BaseCommand):
"""Create new partitions and delete old ones according t... |
from fortran_format import *
from for2py_arrays import *
def main():
A = Array([(1,5),(1,5)])
for i in range(1,5+1):
for j in range(1,5+1):
A.set((i,j), 11*(i+j)) # A(i,j) = 11*(i+j)
fmt_obj_10 = Format(['5(I5)'])
fmt_obj_11 = Format(['""'])
for i in range(1,5+1):
... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# Modified by Xingyi Zhou
# ------------------------------------------------------------------------------
from __future__ import a... |
import _plotly_utils.basevalidators
class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="colorsrc", parent_name="funnel.outsidetextfont", **kwargs
):
super(ColorsrcValidator, self).__init__(
plotly_name=plotly_name,
parent... |
class UserLogs(object):
def __init__(self,**kwargs):
if 'user' in kwargs:
self.user = kwargs['user']
if 'url' in kwargs:
self.url = kwargs['url']
if 'action' in kwargs:
self.action = kwargs['action']
if 'model_name' in kwargs:
self.mode... |
#!/usr/bin/env python3
import json
import datetime
import sys
import psycopg2
from yandex_transport_webdriver_api import YandexTransportProxy
# TODO: Move these two to API
def form_stop_url(stop_id):
return 'https://yandex.ru/maps/?masstransit[stopId]=' + stop_id
def parse_stop(yandex_stop_id, db_settings, ytpro... |
from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class LimitMode(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "LimitMode"
... |
from ConfigSpace.configuration_space import ConfigurationSpace
from autosklearn.pipeline.components.base import AutoSklearnPreprocessingAlgorithm
from autosklearn.pipeline.constants import DENSE, SPARSE, UNSIGNED_DATA, INPUT
from ConfigSpace.hyperparameters import CategoricalHyperparameter, UniformIntegerHyperparameter... |
from tsn.util.registry import Registry
BACKBONE = Registry()
HEAD = Registry()
RECOGNIZER = Registry()
CONSENSU = Registry()
CRITERION = Registry() |
class Rectangle:
'''
* Define a constructor which expects two parameters width and height here.
'''
def __init__(self,width,height):
self.area = width*height
'''
* Define a public method `getArea` which can calculate the area of the
* rectangle and return.
'''
def ge... |
from decimal import Decimal
import factory
from django.contrib.auth.models import User
from factory.django import DjangoModelFactory
from . import models
class StoreFactory(DjangoModelFactory):
name = factory.Faker("company")
class Meta:
model = models.Store
class BranchFactory(DjangoModelFactory... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.http import HttpResponse
from django.shortcuts import render
def dummy_view(request):
return HttpResponse()
def djnago_template_view(request):
return render(request, 'django.html', {})
def jinja_template_view(req... |
from huobi.connection.restapi_sync_client import RestApiSyncClient
from huobi.constant import *
from huobi.model.etp.etp_creation_redemption_history import ETPCreationRedemptionHistory
class GetETPCreationRedemptionHistoryService:
def __init__(self, params):
self.params = params
def request(self, **... |
from __future__ import unicode_literals
import os
import re
import sys
import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI')
def test_examples_esp_local_ctrl(env, extra_data):
rel_project_path = os.path.join('examples', 'protocols', 'esp_local_ctrl')
dut = env.get_dut('esp_local_ctrl', rel_pro... |
# -*- coding: utf-8 -*-
import os
import json
from bs4 import BeautifulSoup
def fill_html(json_dir, blank_html="blank.html", unit_html="unit.html"):
"""
The function will read all json files in json_dir and save formatted
HTML file to a zanryu.html
@type json_data: str
@param json_data: location ... |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure 'ninja_use_console' is supported in actions and rules.
"""
import TestGyp
test = TestGyp.TestGyp(formats=['ninja'])
test.ru... |
"""fetchplugin_dialog_model.py - model for the fetchplugin_dialog
Chris R. Coughlin (TRI/Austin, Inc.)
"""
__author__ = 'Chris R. Coughlin'
from models import plugin_installer
from models.mainmodel import get_logger
module_logger = get_logger(__name__)
class FetchPluginDialogModel(object):
"""Model for the Fet... |
# Add Two Numbers
'''
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, exce... |
"""Interpreter executes Python commands."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com> / "
__author__ += "David N. Mashburn <david.n.mashburn@gmail.com>"
import os
import sys
from code import InteractiveInterpreter, compile_command
from . import dispatcher
from . import introspect
import wx
import six
c... |
## @package workspace
# Module caffe2.python.workspace
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import contextlib
from google.protobuf.message import Message
from multiprocessing import Process... |
from .db_settings import get_model_indexes
from .utils import commit_locked
from .expressions import ExpressionEvaluator
import datetime
import sys
from django.db.models.sql import aggregates as sqlaggregates
from django.db.models.sql.constants import LOOKUP_SEP, MULTI, SINGLE
from django.db.models.sql.where import A... |
#!/usr/bin/python
# coding: UTF-8
#
# Author: Dawid Laszuk
# Contact: laszukdawid@gmail.com
#
# Edited: 11/05/2017
#
# Feel free to contact for any information.
from __future__ import division, print_function
import logging
import numpy as np
import time
from scipy.interpolate import interp1d
from PyEMD.PyEMD.s... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
#!/usr/bin/env python
from __future__ import unicode_literals
from __future__ import print_function
import os
import sys
import codecs
import time
import tempfile
import subprocess
import argparse
import json
import base64
import rbql
def report_error_and_exit(error_type, error_details):
sys.stdout.write(json.d... |
from typing import Optional, Tuple
from pydantic import BaseModel
class AlternativesBase(BaseModel):
id: int
alternative: str
class AlternativesUpdate(BaseModel):
alternative: Optional[str]
class AlternativesIn(BaseModel):
alternative: str
is_correct: bool
question_fk: int
class Alternat... |
"""
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... |
# Definition of the class structures in file imas.py
import imas
import numpy
import sys
import os
'''
This sample program will create a pulse file (shot 13, run 1) and will
put an example of equilibirium IDS using put_slice methods.
'''
# This routine reads an array of pfsystems IDSs in the database, filling
# some ... |
from django.shortcuts import render
from django.http import HttpResponse
def homePageView(request):
return HttpResponse('Hello, World!') |
#######################################################################
# Filename: HexStatistics.py #
# Author: Karolina Mamczarz #
# Institution: AGH University of Science and Technology in Cracow, #
# Poland ... |
# Copyright 2017 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 by applicable law or a... |
"""See https://github.com/numpy/numpy/pull/11937.
"""
import sys
import os
import uuid
from importlib import import_module
import pytest
import numpy.f2py
from numpy.testing import assert_equal
from . import util
def setup_module():
if not util.has_c_compiler():
pytest.skip("Needs C compiler")
if n... |
"""
This module defines some classes that are generally useful for defining a type system for a new
domain. We inherit the type logic in ``nltk.sem.logic`` and add some functionality on top of it
here. There are two main improvements:
1) Firstly, we allow defining multiple basic types with their own names (see ``NamedB... |
import operator
import toolz
from public import public
from ibis import util
from ibis.common.validators import immutable_property
from ibis.expr import datatypes as dt
from ibis.expr import rules as rlz
from ibis.expr import types as ir
from ibis.expr.operations.core import BinaryOp, Node, UnaryOp, ValueOp
from ibis... |
import sys
import os
from os.path import abspath, dirname, join
try:
from django.conf import settings
from django.test.utils import get_runner
if not os.environ.get('DJANGO_SETTINGS_MODULE'):
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
try:
import django
s... |
#===============================================================================
# Copyright (c) 2015, Max Zwiessele
# 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... |
from rest_framework.fields import CharField
from lego.apps.comments.serializers import CommentSerializer
from lego.apps.content.fields import ContentSerializerField
from lego.apps.quotes.models import Quote
from lego.apps.tags.serializers import TagSerializerMixin
from lego.utils.serializers import BasisModelSerialize... |
from setuptools import setup, find_packages
from os import path
from io import open
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='mehrp',
version='0.0.1',
description='Easy beeping (merhp) from the ... |
import numpy as np
import cv2
cap = cv2.VideoCapture('car.mp4')
# params for ShiTomasi corner detection
feature_params = dict(maxCorners=100,
qualityLevel=0.3,
minDistance=7,
blockSize=7)
# Parameters for lucas kanade optical flow
lk_params = dict(win... |
"""oto URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... |
#===========================================================================
#
# Copyright (c) 2014, California Institute of Technology.
# U.S. Government Sponsorship under NASA Contract NAS7-03001 is
# acknowledged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modific... |
import os
import copy
import PIL
import torch
import torchvision
import numpy as np
import math
import logging
from typing import List
LOG = logging.getLogger(__name__)
def define_path(use_jaad=True, use_pie=True, use_titan=True):
"""
Define the correct paths to datasets'annotations and images
"""
a... |
from bokeh.io import output_file, show
from bokeh.models.widgets import Button
output_file("button.html")
button = Button(label="Foo", button_type="success")
show(button) |
#from ann import learnANN;
from bayes import learnBayes;
from svm import learnSVM;
from parse import getData;
import sys;
def classify(train, test):
trainData, testData = getData(train, test);
#print len(trainData[0]), len(testData[0])
#print len(trainData[0][0]), len(trainData[1]), len(testData[0][0]), len(testData... |
from telethon import events
import subprocess
import asyncio
import time
from userbot.utils import admin_cmd
#@command(pattern="^.cmds", outgoing=True)
@borg.on(admin_cmd(pattern=r"cmds"))
async def install(event):
if event.fwd_from:
return
cmd = "ls userbot/plugins"
process = await asyncio.create_... |
# This example illustrates how to execute complex commands from
# a remote API client. You can also use a similar construct for
# commands that are not directly supported by the remote API.
#
# Load the demo scene 'remoteApiCommandServerExample.ttt' in CoppeliaSim, then
# start the simulation and run this program.
#
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.