text stringlengths 1 927k |
|---|
import torch
import torch.nn as nn
import spconv
from functools import partial
from .spconv_backbone import post_act_block
from ...utils import common_utils
class SparseBasicBlock(spconv.SparseModule):
expansion = 1
def __init__(self, inplanes, planes, stride=1, downsample=None, indice_key=None, norm_fn=None... |
from collections import OrderedDict
from typing import Dict, Generic, Mapping, TypeVar
CacheKey = TypeVar("CacheKey")
CacheValue = TypeVar("CacheValue")
class LRUCache(Generic[CacheKey, CacheValue], OrderedDict):
"""
A dictionary-like container that stores a given maximum items.
If an additional item i... |
# (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
HERE = path.abspath(path.dirname(__file__))
# Get the long descr... |
'''This example demonstrates the use of Convolution1D for text classification.
'''
from __future__ import print_function
import sys
sys.path.append('/Users/wangwei/anaconda2/envs/python3_keras/lib/python3.6/site-packages')
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layer... |
# ---------------------------------------------------------------------------
# Copyright 2017-2018 OMRON 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.apac... |
import asyncio
import asyncpg
import coc
import discord
import logging
import math
from collections import namedtuple
from datetime import datetime
from discord.ext import commands, tasks
from cogs.utils.db_objects import DatabaseMessage
from cogs.utils.formatters import CLYTable, get_render_type
from cogs.utils impo... |
# -*- coding: utf-8 -*-
""" S3 Notifications
@copyright: 2011-2021 (c) Sahana Software Foundation
@license: MIT
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
re... |
import struct
import unittest
from typing import List
import pyparcel
DATA: List[int] = [
-1 << 31,
-1000,
-57,
-26,
-20,
-5,
-2,
-1,
0,
1,
2,
5,
20,
57,
1000,
(1 << 31) - 1,
]
class MyTestCase(unittest.TestCase):
def test_pack(self):
for i... |
"""
AdamP
Copyright (c) 2020-present NAVER Corp.
MIT license
"""
import torch
import torch.nn as nn
from torch.optim.optimizer import Optimizer, required
import math
class SGDP(Optimizer):
def __init__(self, params, lr=required, momentum=0, dampening=0,
weight_decay=0, nesterov=False, eps=1e-8, d... |
from flask import Flask, jsonify, send_file, url_for
import data_functions
from datetime import datetime
app = Flask(__name__) #__name__ is a special variable in python that creates an instance of the web app
@app.route("/", methods =['GET'])
def hello():
return ("Hello World")
@app.route("/hello")
def helloo():... |
class ConfigurationError(Exception):
"""
The exception raised by any object when it's misconfigured
(e.g. missing properties, invalid properties, unknown properties).
"""
def __init__(self, message):
super().__init__()
self.message = message
def __str__(self):
return re... |
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from setuptools import find_packages, setup
__version__ = '4.3.1'
requirements = [
"neo4j-driver>=1.7.2,<4.0",
"pytz>=2018.4",
"statsd>=3.2.1",
"retrying>=1.3.3",
"requests>=2.23.0,<3.0",
"elasticsearch>... |
# coding=utf-8
# Copyright 2021 The Google Research 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# Copyright 1999-2021 Alibaba Group Holding 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 a... |
load(
"@rules_mono//dotnet/private:providers.bzl",
"DotnetLibrary",
)
def _make_runner_arglist(dotnet, source, output):
args = dotnet.actions.args()
args.add("/useSourcePath")
if type(source) == "Target":
args.add_all(source.files)
else:
args.add(source)
args.add(output)
... |
import pathgraph
import robotsearch
import unittest
class TestGraphMethods(unittest.TestCase):
def test_create_undirected_graph(self):
self.assertTrue(isinstance(pathgraph.graph_by_type("undirected"), pathgraph.UndirectedGraph))
def test_create_directed_graph(self):
self.assertTrue(isinst... |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
# date: 2019.04.21
# https://stackoverflow.com/a/55778640/1832058
import requests
# not need Sessions
s = requests.Session()
s.headers.update({
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'pl,en-US;q=0.7,en;q=0.3',
... |
import re
import copy
import warnings
import operator
import numpy as np
from astropy import _erfa as erfa
from astropy.utils.compat.misc import override__dir__
from astropy import units as u
from astropy.constants import c as speed_of_light
from astropy.utils.data_info import MixinInfo
from astropy.utils import Shap... |
# Copyright (c) 2012 Adi Roiban.
# See LICENSE for details.
"""
Unit tests for empirical package.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
import astropy.units as u
from astropy.table import Table
from gammapy.catalog.fermi import SourceCatalog3FGL
from gammapy.estimators import FluxPoints
from gammapy.modeling.models ... |
import os
from os.path import join, dirname
from dotenv import load_dotenv
from urllib.parse import urlparse
# loading .env file
env_path = join(dirname(__file__), '.env')
load_dotenv(env_path)
# use function
def url_path_check(path):
sample_host = 'http://localhost'
sample_url = sample_host + path
if urlparse(... |
import numpy as np
from util import util
from config.draco3_lb_config import PnCConfig, WBCConfig
from pnc.wbc.ihwbc.ihwbc import IHWBC
from pnc.wbc.ihwbc.joint_integrator import JointIntegrator
class Draco3LBController(object):
def __init__(self, tci_container, robot):
self._tci_container = tci_containe... |
#!/usr/local/bin/python
# encoding: utf-8
"""
*Convert the HTML export of kindle notebooks (from kindle apps) to markdown*
:Author:
David Young
:Date Created:
October 17, 2016
"""
################# GLOBAL IMPORTS ####################
import sys
import os
import re
import collections
os.environ['TERM'] = 'vt10... |
from collections import defaultdict
from threading import local
import pymantic.primitives
class BaseParser(object):
"""Common base class for all parsers
Provides shared utilities for creating RDF objects, handling IRIs, and
tracking parser state.
"""
def __init__(self, environment=None):
... |
from huobi.exception.huobiapiexception import HuobiApiException
from huobi.impl.restapiinvoker import call_sync
from huobi.model.user import User
class AccountInfoMap:
user_map = dict()
account_id_type_map = dict()
account_type_id_map = dict()
def update_user_info(self, api_key, request_impl):
... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.stats import pearsonr
from bin_data import bin_data
# import pixel data
right_z_pixel_change = np.load("right_z_pixel_change.npy")
left_z_pixel_change = np.load("left_z_pixel_change.npy")
front_z_pixel_change = np.load("front_z_pixel_... |
"""A set of classes used during the parsing of VB code"""
StopSearch = -9999 # Used to terminate searches for parent properties
class VBElement(object):
"""An element of VB code"""
def __init__(self, details, text):
"""Initialize from the details"""
# import pdb; pdb.set_trace()
sel... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Iterable
import hydra
import numpy as np
import omegaconf
import torch
import mbrl.algorithms.mbpo as ... |
__copyright__ = \
"""
Copyright ©right © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation.
All rights reserved.
This software is covered by US patents and copyright.
This source code is to be used for academic research purposes only, and no commercial use is allowed.
For any ... |
"""
Copyright (c) 2022 Intel 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 applicable law or agreed to in writin... |
{
'includes': [
'common.gypi',
],
'targets': [
{
'target_name': 'animator',
'type': 'static_library',
'include_dirs': [
'../include/config',
'../include/core',
'../include/effects',
'../include/animator',
'../include/views',
'../include/xml... |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""Top-level package for santa-helpers."""
__author__ = """Magdalena Rother"""
__email__ = 'rother.magdalena@gmail.com'
__version__ = '0.0.1'
from .neighbors import neighbors # noqa
from .parse import parse_grid_to_dict # noqa |
import os
import sys
import pytest
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from base import TestBaseClass
class TestClassOelintVarsBugtrackerIsUrl(TestBaseClass):
@pytest.mark.parametrize('id', ['oelint.vars.bugtrackerisurl'])
@pytest.mark.parametrize('occurrence', [1])
@pytest.... |
from django.apps import AppConfig
class SpacetradingConfig(AppConfig):
name = 'spacetrading' |
#!/usr/bin/python3
"""
Beautiful command line parsing
@author chairs
"""
import inspect, sys
from collections import namedtuple
from collections import defaultdict
from subprocess import DEVNULL
class Cookie (object):
"""
Main decorator object
@param name of application
"""
def __init__ (self, app_name, notes=... |
# -*- coding: utf-8 -*-
import time
import datetime
from aiocron import asyncio
from aiocron import crontab
import pytest
class CustomError(Exception):
pass
def test_str():
loop = asyncio.new_event_loop()
@crontab('* * * * * *', loop=loop)
def t():
pass
assert '* * * * *' in str(t)
... |
# 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 compliance with the License. You may obtain
# a copy of t... |
"""Several HTML builders."""
import html
import os
import posixpath
import re
import sys
from datetime import datetime
from os import path
from typing import IO, Any, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Type
from urllib.parse import quote
from docutils import nodes
from docutils.core import publish_... |
from __future__ import division, absolute_import, print_function
import pytest
import numpy as np
import numpy.ma as ma
from numpy.ma.mrecords import MaskedRecords
from numpy.ma.testutils import assert_equal
from numpy.testing import assert_, assert_raises
from numpy.lib.recfunctions import (
drop_fields, rename_... |
# Copyright (c) 2016 Universidade Federal Fluminense (UFF)
# Copyright (c) 2016 Polytechnic Institute of New York University.
# This file is part of noWorkflow.
# Please, consult the license terms in the LICENSE file.
"""Diff Object"""
from __future__ import (absolute_import, print_function,
div... |
# Copyright 2018-2022 Streamlit 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 agreed to in wr... |
def concat(s1, s2):
if not s1:
return s2
return s1[0:1] + concat(s1[1:], s2)
def reverse(s1):
if not s1:
return s1
return concat(reverse(s1[1:]), s1[0])
def prefix(s1, s2):
if s1 == '' and s2 != '':
return True
if s1[:1] == s2[:1]:
return prefix(s1[1:], s2... |
# coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... |
# -*- coding: utf-8 -*-
"""Pylab (matplotlib) support utilities."""
from __future__ import print_function
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from io import BytesIO
from IPython.core.display import _pngxy
from IPython.utils.decorators import flag_calls... |
# 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 ... |
# -*- coding: utf-8 -*-
"""The VFS back-end CLI arguments helper."""
from __future__ import unicode_literals
from plaso.cli import tools
from plaso.cli.helpers import interface
from plaso.cli.helpers import manager
from plaso.lib import errors
class VFSBackEndArgumentsHelper(interface.ArgumentsHelper):
"""VFS bac... |
from .constants import ALL_ROLES, DB_ROLE, WEB_ROLE
from .database import setup_db
from .django import update_db, update_python_libs
from .nginx import stop_nginx, start_nginx
from .ssh import setup_ssh_key
from .supervisor import stop_supervisor, start_supervisor, update_supervisor
from .utils import get_ip
from .webs... |
# TunaBot Ext - Help
from discord.ext import commands
import discord
from aiofiles import open as async_open
from ujson import load, loads
from data import is_admin
JSON_PATH = "data/help.json"
class Help(commands.Cog):
def __init__(self, bot):
self.bot, self.tuna = bot, bot.data
with open(JS... |
import os
from requests.utils import requote_uri
from pyrogram import Client, filters
Bot = Client(
"Requote-URL-Bot",
bot_token = os.environ["BOT_TOKEN"],
api_id = int(os.environ["API_ID"]),
api_hash = os.environ["API_HASH"]
)
@Bot.on_message(filters.text)
async def filter(bot, update):
await u... |
""" This is magic glue for integrating the frontend and backend.
This is NOT the place for backend customizations. Go to
api/historic_hebrew_dates_ui/settings.py instead.
"""
import os.path as op
here = op.dirname(op.abspath(__file__))
# First, import the standard backend settings. This requires some
# magi... |
# Copyright 2020 The SODA 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 License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import functools
import os
import textwrap
required_conan_version = ">=1.43.0"
class Hdf5Conan(ConanFile):
name = "hdf5"
description = "HDF5 is a data model, library, and file format for storing and managing data."... |
from eventsourcing.domain import Aggregate, event
from uuid import uuid5, NAMESPACE_URL
class Account(Aggregate):
"""A simple-as-can-be bank account"""
@event('Created')
def __init__(self):
self.balance = 0
@event('Credited')
def credit(self, amount: int):
self.balance += amount
... |
"""
Takes a [Notion.so](https://notion.so) export .zip and enhances it
"""
import tempfile
import sys
import os
import time
import re
import argparse
import zipfile
import urllib.parse
from datetime import datetime
from pathlib import Path
import backoff
import requests
from emoji_extractor.extract import Extractor as... |
# https://github.com/RomanMichaelPaolucci/AI_Stock_Trading/blob/master/IBM.csv
import abc
import threading
import time
import pandas as pd
import numpy as np
from keras.layers import Dense
from keras.models import Sequential, model_from_json
from sklearn.model_selection import train_test_split
from sklearn.metrics impo... |
class Calculator:
""""
This calculator performs the following basic mathematical operations:
* Addition
* Subtraction
* Division
* Multiplication
* nth root of number
* exponent
Attributes
----------
__value : (int or float)
the calculator memory value
Methods
... |
"""The Logitech Harmony Hub integration."""
import asyncio
import logging
from homeassistant.components.remote import ATTR_ACTIVITY, ATTR_DELAY_SECS
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_NAME
from homeassistant.core import HomeAssistant, callback
from home... |
import os
import yaml
import numpy as np
import torch
import shutil
import torchvision.transforms as transforms
from torch.autograd import Variable
from collections import namedtuple
class MyDumper(yaml.Dumper):
def increase_indent(self, flow=False, indentless=False):
return super(MyDumper, self).increase... |
#!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, 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 applicab... |
#
# This file is part of pysmi software.
#
# Copyright (c) 2015-2020, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pysmi/license.html
#
import sys
import os
import tempfile
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
import StringIO
except ImportError:
... |
# -*- coding: utf-8 -*-
import binascii
from copy import copy
from .codec import size_for_addr
from .codec import string_to_bytes
from .codec import bytes_to_string
from .codec import protocol_with_name
from .protocols import protocol_with_code
from .protocols import read_varint_code
class ProtocolNotFoundException(... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.profile, name='profile'),
path(
'order_history/<order_number>',
views.order_history,
name='order_history'),
] |
# -*- encoding: utf-8 -*-
import abc
import numpy as np
import scipy.sparse
from autosklearn.pipeline.implementations.OneHotEncoder import OneHotEncoder
from autosklearn.util import predict_RAM_usage
def perform_one_hot_encoding(sparse, categorical, data):
predicted_RAM_usage = float(
predict_RAM_usage(d... |
# Generated by Django 3.0.5 on 2020-04-11 04:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
... |
"""
Django settings for travel_blog project.
Generated by 'django-admin startproject' using Django 1.10.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
impor... |
# -*- coding: UTF-8 -*-
from django.test import Client, TestCase
from django.contrib.auth.models import Group
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.utils import simplejson
from privilege.core.config import GROUP_... |
import os
import time
from pathlib import Path # from path home
import schedule
print(Path.home()) # C:\Users\angel
old_files_folder_name = "old_files"
print("Hello ")
def clean_up_downloads():
print("Cleaning up Downloads")
# get all items from the downloads filder
download_folder_path = os.path.join(P... |
from nutils.testing import *
import nutils.types
import inspect, pickle, itertools, ctypes, stringly, tempfile, io, os
import numpy
class apply_annotations(TestCase):
def test_without_annotations(self):
@nutils.types.apply_annotations
def f(a, b):
return a, b
a, b = f(1, 2)
self.assertEqual(a,... |
import importlib
import xarray as xr
import numpy as np
import pandas as pd
import sys
from CASutils import filter_utils as filt
from CASutils import readdata_utils as read
from CASutils import calendar_utils as cal
importlib.reload(filt)
importlib.reload(read)
importlib.reload(cal)
expname=['SASK_CLM5_CLM5F_01.001... |
#!/usr/bin/env python
"""
Import experiments into the database
* Configuration parameters:
- The ones required by intogen.data.entity.EntityManagerFactory
"""
from wok.task import Task
from wok.element import DataElementList
from intogen.data.entity import types
from intogen.data.entity.server import EntityServer
... |
from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
"""Test creating a new user with email """
email = "test@aqurds.com"
password = "aqurds123"
user = get_user_model().objects... |
# -*- coding: utf-8 -*-
# NOTES:
# - this file is all about the trust model for the HODL contracts. TRUST NO ONE. VALIDATE ALL.
from __future__ import annotations
import dataclasses
import decimal
import re
import time
import typing as th
import hddcoin.hodl
from clvm_tools.binutils import disassemble, int_to_bytes ... |
from django.apps import AppConfig
class DjangoFiltersMergerConfig(AppConfig):
name = 'django_filtersmerger' |
from django.apps import AppConfig
class KullisharifappConfig(AppConfig):
name = 'KulliSharifapp' |
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2021 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# =============================================================================
"""... |
# Generated by Django 3.2 on 2021-05-05 06:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={'verbose_name': '用户管理', 'verbose... |
import unittest
import random
import math
import io
import struct
from mitmproxy.io import tnetstring
MAXINT = 2 ** (struct.Struct('i').size * 8 - 1) - 1
FORMAT_EXAMPLES = {
b'0:}': {},
b'0:]': [],
b'51:5:hello,39:11:12345678901#4:this,4:true!0:~4:\x00\x00\x00\x00,]}':
{b'hello': [12345678901, b'this... |
import os
import sys
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(base_path)
from torch import optim
from metallic.data.benchmarks import get_benchmarks
from metallic.data.dataloader import MetaDataLoader
from metallic.models import OmniglotCNN
from metallic.metalearners... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('workshops', '0048_auto_20150916_0441'),
]
operations = [
migrations.AlterField(
model_name='person',
... |
# Copyright 2021 The Bazel 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 applicable la... |
from __future__ import print_function, absolute_import
import unittest
from conda.version import ver_eval, VersionSpec, VersionOrder, normalized_version
class TestVersionSpec(unittest.TestCase):
def test_version_order(self):
versions = [
(VersionOrder("0.4"), [[0], [0], [4]]),
... |
import logging
def say(n):
logging.basicConfig(level=logging.DEBUG)
for i in range(n):
logging.info(str(i) + ": Hello world")
say(1)
if __name__=="__main__":
say(3) |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Bundle class with support for npm dependencies."""
from __future__ import absolut... |
from typing import Tuple
import torch
from torch import Tensor
def homogeneous(A: Tensor, b: Tensor) -> Tensor:
"""
Converts heterogeneous matrix into homogeneous matrix.
:param A: Heterogeneous matrix of shape [*, N, N].
:param b: Heterogeneous vector of shape [*, N, 1].
:return: Homogeneous mat... |
#!/usr/bin/env python
# Run the various build scripts
import sys
import os
from parse import parse_machines
from machines import machines
from assemblies import assemblies
from vitamins import vitamins
from printed import printed
from guides import guides
from publish import publish
def build(do_publish=0):
prin... |
"""CouchDB Models"""
from kai.model.blog import Article
from kai.model.documentation import Documentation
from kai.model.generics import Comment, Rating
from kai.model.human import Human
from kai.model.paste import Paste
from kai.model.snippet import Snippet
from kai.model.traceback import Traceback |
from flask import render_template
from flask import request
from flask import send_file
from flask import make_response
import cv2
import urllib
import numpy as np
# Add the pytorch folder to our script path
import sys
# insert at 1, 0 is the script path (or '' in REPL)
sys.path.insert(1, '/Users/danielblackburn/space... |
# coding: utf-8
#
# Copyright 2014 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... |
#!/usr/bin/env python
# coding=utf-8
from .traj_gen_base import TrajGen
import numpy as np
import casadi as ca
from scipy.interpolate import interp1d
class CHOMPTrajGen(TrajGen):
def __init__(self, knots_, dim_, pntDensity_):
super().__init__(knots_, dim_)
self.pntDensity = pntDensity_
asse... |
"""Package setup script."""
from setuptools import setup, find_packages
# Python packaging constants
CLASSIFIERS = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.... |
"""
WSGI config for DiscordOauth2 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... |
"""
A module to show off a timed animation using coroutines
Making timed animations is messy, because we have to add a lot of
class attributes for all of the loop variables. A cleaner way is
to do this with coroutines. Each animation is its own coroutine.
The advantage of the coroutine is that yield allows you to p... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
#from lib2to3.pytree import convert
import socket
import sys
import _thread
import json
import os
import time
import zmq
IP_ADDRESS = '127.0.0.1'
TOPIC = None
fila_msgs = []
conf = []
# Envia os dados
def enviar():
ctx = zmq.Context()
sock = ctx.socket(zmq.PUB)
sock.connect(f"tcp://{IP_ADDRESS}:5500")
... |
# Authors:
# Trevor Perrin
# Martin von Loewis - python 3 port
# Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2
#
# See the LICENSE file for legal information regarding use of this file.
"""cryptomath module
This module has basic math/crypto code."""
from __future__ import print_function
import os
impor... |
"""
Files for testing.
"""
import base64
import tempfile
from PIL import Image
from six import BytesIO
__all__ = (
'BASE64_PREFIX',
'TEMPORARY_FILE_LIST',
'TEMPORARY_FILE_LIST_FILE_CONTENT',
'TEMPORARY_FILE_LIST_FILE_BASE64',
'TEMPORARY_FILE_VIEW',
'TEMPORARY_FILE_VIEW_FILE_CONTENT',
'TEM... |
# -*- coding: utf-8 -*-
from unisim import DB
class DummyDB(DB):
def connect(self):
pass
def disconnect(self):
pass
def init_table(self):
pass
def store(self, tick, objects):
pass |
# Copyright 2012 Enrico Franchi
#
# 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 and the following disclaimer.
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.