text stringlengths 2 999k |
|---|
import os
import shutil
import json
import pathlib
def make(containing_folder: str, resourcepack_subfolder: str = None, datapack_name: str = None):
mcfunction, nbt, ogg = _get_file_lists(containing_folder)
if len(mcfunction) or len(nbt):
datapack_name = _get_datapack_name(containing_folder) if da... |
import base64
import hmac
import sha
import json
from datetime import datetime, timedelta
from django.utils.translation import ugettext as _
from django.http.response import JsonResponse, HttpResponseBadRequest
from boto.s3.connection import S3Connection
from anima.conf import anima_settings
from . import FileBrowser... |
#!/usr/bin/env python
import fileinput
import csv
import sys
# This prevents prematurely closed pipes from raising
# an exception in Python
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)
# allow large content in the dump
csv.field_size_limit(sys.maxsize)
def is_insert(line):
"""
Returns... |
# this is cancer, why oh god why
import re
bagTypes = {}
def createBagType(name):
bagTypes[name] = {"parents": [], "children": []}
def addParent(name, parent):
if name not in bagTypes:
createBagType(name)
bagTypes[name]["parents"].append(parent)
def addChild(name, child, count):
if name not ... |
# Generated by Django 2.2.2 on 2020-01-07 01:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Desk",
"category": "Administration",
"label": _("Meeting"),
"color": "#FFF5A7",
"reverse": 1,
"icon": "octicon octicon-calendar",
"type": "module",
"description": "... |
from Foo.foo.Test import main
|
import urllib.request,json
from .models import Articles,Sources
sources_url = None
articles_url = None
def configure_request(app):
global api_key,sources_url,articles_url
api_key = app.config['NEWS_API_KEY']
sources_url = app.config['SOURCES_URL']
articles_url = app.config['ARTICLES_URL']
def get_so... |
"""
===========================
Formaldehyde mm-line fitter
===========================
This is a formaldehyde 3_03-2_02 / 3_22-221 and 3_03-2_02/3_21-2_20 fitter.
It is based entirely on RADEX models.
This is the EWR fork of the fitter in pyspeckit.
Module API
^^^^^^^^^^
"""
from __future__ import print_function
im... |
from __future__ import print_function
import os
from csv import DictReader
from flask import Flask
import pyproj
import threading
import sys
import re
def init_flask(name):
"""
initializes a Flask instance with default values
:param name: the name of the instance
"""
app = Flask(name)
app.conf... |
"""Farthest Point Sampler for pytorch Geometry package"""
#pylint: disable=no-member, invalid-name
from .. import backend as F
from ..base import DGLError
from .capi import _farthest_point_sampler
__all__ = ['farthest_point_sampler']
def farthest_point_sampler(pos, npoints, start_idx=None):
"""Farthest Point S... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import time
from common import chrome_proxy_metrics
from common import network_metrics
from common.chrome_proxy_metrics import ChromeProxyMet... |
import os
from pip._internal.cache import WheelCache
from pip._internal.models.format_control import FormatControl
from pip._internal.models.link import Link
from pip._internal.utils.compat import expanduser
from pip._internal.utils.misc import ensure_dir
def test_expands_path():
wc = WheelCache("~/.foo/", None)... |
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import chat.routing
application = ProtocolTypeRouter({
# (http->django views is added by default)
'websocket': AuthMiddlewareStack(
URLRouter(
chat.routing.websocket_urlpatterns
... |
from django.test import TestCase, tag
from django.utils import timezone
from django.core.management import call_command
from django.core.exceptions import ValidationError
from django_fsm import TransitionNotAllowed
from apps.cases.models import Case, CaseHistory
from apps.arranges.models import Arrange
class CaseMo... |
from heatmiserV3.config import Config
from heatmiserV3.devices import Device, Master
import unittest
class TestLive(unittest.TestCase):
def test_request_all(self):
master = Master(Config.MASTER_IRQ_ADDRESS)
location = Config.MASTER_LOCATION['location']
if Config.MASTER_LOCAT... |
# -*- coding: utf-8 -*-
# Copyright 2015-2016 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FIWARE project.
#
# 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:
#
# htt... |
# What is the smallest number that can be divided evenly by all the numbers from 1-20?
from __future__ import print_function
import timeit
from functools import partial
from operator import mod
try:
range = xrange
except NameError:
pass
start = timeit.default_timer()
def euler_5():
dividend = 20
... |
# Generated by Django 2.0.9 on 2019-03-18 04:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('salary', '0010_remove_salarydata_standardmonth'),
]
operations = [
migrations.AlterField(
model_name='salarydata',
n... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pushy', '0002_auto_20141011_1703'),
]
operations = [
migrations.AddField(
model_name='pushnotification',
... |
# Copyright (c) 2010-2014 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('photo_sharpness/', views.photo_sharpness, name='photo_sharpness'),
path('photo_saturation/', views.photo_saturation, name='photo_saturation'),
path('photo_transpose/', views.photo_transpose, nam... |
#!/usr/bin/env python
# MIT License
#
# Copyright (c) 2018 Ulrich Noebauer
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to ... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
from .action import UploadVulnerabilitySyncFile
|
# encoding: utf-8
from opendatatools import gaokao
if __name__ == '__main__':
# 查询学校列表/模糊查询
#df, msg = gaokao.get_school_list('北京')
# 获取学校基本信息
#df, msg = gaokao.get_school_baseinfo('北京大学')
# 获取专业信息
#df, msg = gaokao.get_school_major('北京大学')
# 获取录取分数线信息
#df, msg = gaokao.get_school... |
# Copyright 2019 The TensorFlow Probability 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 o... |
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2020-2022 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from tests.lib.testcase import ConfluenceTestCase
from tests.lib.testcase import setup_builder
from tests.lib import parse
import os
class TestConfluenceRstHighlights(Conf... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
# Startup
appname = "python-graph-dot"
appversion = "1.8.2"
setup(
name = appname,
version = appversion,
namespace_packages = ["pygraph"],
packages = ["pygraph"] + [ os.path.join("pyg... |
from networkx import DiGraph, shortest_path
from vrpy.clarke_wright import ClarkeWright, RoundTrip
from vrpy.greedy import Greedy
class TestsInitialSolution:
"""
Initial solution can be computed with:
- a round trip;
- Clarke & Wright;
- Greedy.
"""
def setup(self):
se... |
def isInfiniteProcess(a, b):
return (a + b) % 2 != 0 or a > b |
import logging
import requests
logging.captureWarnings(True)
response = requests.get('https://www.12306.cn', verify=False)
print(response.status_code) |
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... |
"""Test cases for the WikiStats dataset."""
#
# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
import sys
import unittest
from contextlib import suppress
from pywikibot.data.wikistats import WikiStats
from tests.aspects import TestCase
class WikiStatsTestCase(TestCase):
"""T... |
import enum
import re
import inspect
import sys
from textwrap import dedent
from termcolor import cprint, colored
class Verbosity(enum.Enum):
COMMENT = ['green', None, []]
INFO = ['blue', None, []]
TRACE = ['cyan', None, []]
ERROR = ['red', None, ['reverse']]
ERROR_TESTING = ['green', None, ['reve... |
from collections import defaultdict, Counter
import qcportal as ptl
## failures and incompletes
def get_optimizations(dataset, spec, client, dropna=False):
ds = dataset
while True:
try:
ds.status(spec)
except:
pass
else:
break
if dropna:
... |
# ---------------------------------------------------------------------
# Cisco.IOS.get_copper_tdr_diag
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# P... |
import torch
import torch.nn as nn
from utils import binary_accuracy
from sklearn.metrics import precision_recall_fscore_support
import numpy as np
only_one_iteration = False
def train(model, iterator, optimizer, criterion, device):
epoch_loss = 0
epoch_acc = 0
precission = 0
recall = 0
f1 = 0
... |
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
# based on
# openbsd_pkg
# (c) 2013
# Patrik Lundin <patrik.lundin.swe@gmail.com>
#
# yum
# (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
#
# This... |
#!/usr/bin/env python3
# https://www.hackerrank.com/challenges/py-set-intersection-operation
_ = input ().strip ()
a = set (map (int, input ().strip ().split ()))
_ = input ().strip ()
b = set (map (int, input ().strip ().split ()))
print (len (a.symmetric_difference (b)))
|
from django.contrib import admin
from projects.abstract_models import ProjectAttachment
from projects.forms import ProjectRoleNewAdminForm, ProjectRoleEditAdminForm
from .models import Project, ProjectRole, ProjectTechnicalRequest, ProjectLog, \
ProjectRating, ProjectFavorite
class ProjectAdmin(admin.ModelAdmin)... |
# -*- coding: utf-8 -*-
import os
from configparser import ConfigParser
# Config key
_CONFIG_KEY_DOWNLOAD_HOT_MAX = 'download.hot_max'
_CONFIG_KEY_DOWNLOAD_DIR = 'download.dir'
_CONFIG_KEY_SONG_NAME_TYPE = 'song.name_type'
_CONFIG_KEY_SONG_FOLDER_TYPE = 'song.folder_type'
# Base path
_CONFIG_MAIN_PATH = os.path.join... |
# -*- coding: utf-8 -*-
import re
import numpy as np
from copy import deepcopy
from convlab.evaluator.evaluator import Evaluator
from convlab.modules.util.multiwoz.dbquery import dbs
requestable = \
{'attraction': ['post', 'phone', 'addr', 'fee', 'area', 'type'],
'restaurant': ['addr', 'phone', 'post', 'ref', 'pric... |
#!/usr/bin/env python
import os
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
README = read('README.rst')
class PyTest(TestCommand):
def finalize_options(s... |
xs1 = [
1,
2,
3
]
xs2 = {
1,
2,
3
}
xs3 = {
1: None,
2: None,
3: None,
}
xs4 = (
1,
2,
3
)
|
#!/usr/bin/env python
# coding=utf-8
###############################################################################
import os
import sys
import unittest
import inspect
import traceback
import optparse
import logging
import configobj
try:
import cPickle as pickle
except ImportError:
import pickle as pickle
t... |
from product import Product
class Unknown(Product):
def __init__(self, raw_product):
Product.__init__(self, raw_product)
bib_info = raw_product.get('slides', {})
self._parse_bib_info(bib_info)
def _parse_bib_info(self, bib_info):
self._free_fulltext_url = str(bib_info.get ('fr... |
from epidemiology_models.compartmental_models import SIRModel
from epidemiology_models.compartmental_models import SISModel
from epidemiology_models.compartmental_models import SEIRModel
from epidemiology_models.compartmental_models import BaseModel
from pytest import approx
from pytest import raises
from datetime impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pyphot documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 5 11:25:47 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... |
# -*- coding: utf-8 -*-
import unittest
from collections import OrderedDict
from Model.DbTableModel.BaseModel import *
class BaseModelNonAccessorTest(unittest.TestCase):
def test_get_column_names(self):
with self.assertRaises(NotImplementedError):
BaseModel.get_column_names()
def test_g... |
import numpy as np
import matplotlib.pyplot as plt
import os
from sklearn.ensemble import GradientBoostingClassifier
import GMCluster as gml
import discr_utils as du
from matplotlib import cm
from operator import add, sub
import pickle
from matplotlib import rc
def cm2inch(value):
return value/2.54
#%%
##############... |
# Generated by Django 3.2.7 on 2021-10-29 11:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0004_auto_20210905_1349'),
]
operations = [
migrations.AddField(
model_name='category',
name='short_de... |
# (C) Datadog, Inc. 2013-present
# (C) Patrick Galbraith <patg@patg.net> 2013
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from __future__ import division
import traceback
from collections import defaultdict
from contextlib import closing, contextmanager
from typing import Any, Dict
imp... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
import sys
import types
import concat.level0.stdlib.importlib
from typing import List, Callable, cast
# make this module callable
sys.modules[__name__].__class__ = concat.level0.stdlib.importlib.Module
def dict(stack: List[object], stash: List[object]) -> None:
"""$inst -- $inst$.__dict__"""
stack.append(sta... |
# 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... |
"""Unit tests for the command-line interface entry point."""
import os
import sys
import unittest
import webbrowser
from unittest.mock import patch, mock_open, call
from next_action import next_action, __version__
from next_action.arguments import config
from .arguments.test_parser import USAGE_MESSAGE
@patch.obje... |
from PyQt4 import QtCore, QtGui
import time
from Realtime_Server import Databaze_2
import MySQLdb
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
file = os.path.join(os.path.realpath('../..'), 'tmp', 'p12out')
df = pd.read_csv(file, header=None)
print(df[0].value_counts())
def is_prime(n):
if n<=3:
return n > 1
elif n%2==0 or n%3==0:
return False
i = 5
while... |
from moverscore import MoverScore, MoverScoreV2
data = [
{
"reference": "The issue isn’t about skin color, it’s about culture. Because light-skinned people have historically pushed dark-skinned people down not just in the US, or even just in European-descended cultures, look at India’s Caste system, being ... |
from rsrc_web.models import WebStream
from .paths import (readable_web_url_strings,
web_url_strings,
writeable_web_url_strings)
readable_web_streams = readable_web_url_strings.map(WebStream.from_string)
writeable_web_streams = writeable_web_url_strings.map(WebStream.from_string)... |
# Anthony Krivonos
# src/algorithms/skeleton.py
# Global Imports
import numpy as np
import math
# Local Imports
from utility import *
from enums import *
from mathematics import *
# Local Model Imports
from models.portfolio import *
from models.price import *
from models.quote import *
# Parent Class Import
from al... |
# Generated by Django 4.0.1 on 2022-03-26 09:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('challenges', '0006_alter_challenge_challenge'),
]
operations = [
migrations.AlterField(
model_name='challenge',
name... |
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
class ResNetSimCLR(nn.Module):
def __init__(self, base_model, out_dim):
super(ResNetSimCLR, self).__init__()
self.resnet_dict = {"resnet18": models.resnet18(pretrained=False),
"re... |
#!python
import math
# line = "{type:4} {serialNumber:5} {AtomName:4} {ReidueName:3} {Chain:1}{ResId:4} {x:8.3f}{y:8.3f}{z:8.3f}{1:6.2f}{0:6.2f} {element} \n"
def dotproduct(v1, v2):
return sum((a*b) for a, b in zip(v1, v2))
def length(v):
return math.sqrt(dotproduct(v, v))
def read_lammps(lammps_file=... |
"""
Example script that utilizes EDSProvider to search XBL marketplace
"""
import argparse
import asyncio
from pprint import pprint
import sys
from aiohttp import ClientResponseError, ClientSession
from xbox.webapi.api.client import XboxLiveClient
from xbox.webapi.authentication.manager import AuthenticationManager
... |
''' Dictionary
A dictionary is a collection of key value pairs.
The values can be changed (mutable)
The values have unique keys.
Using the constructor method # 29
Built-in dictionary Methods
Method Description
get() Returns the value of a specific key.
Update() Inserts a s... |
import torch
import deform_conv_cuda
device = torch.device("cuda:0")
a_list = [ torch.zeros([10,10],device=device) for _ in range(6)]
b_list = [int(0)] * 15
#print(deform_conv_cuda.deform_conv_forward_cuda(*a_list, *b_list))
print(deform_conv_cuda.deformable_im2col(*a_list[:2],*b_list[:13],a_list[3]))
|
'''
URLs for accounts in accounts/views.py
.
'''
# views: register, dashboard, edit, edit_password, password_reset_confirm, password_reset
from fcsSimpleMooc.accounts.views import *
from django.urls import path, include
from django.contrib.auth.views import LoginView
# from django.contrib.auth import logout
f... |
# def pair_sum(numbers, target_sum):
# """
# :param numbers: (list of ints) The list of numbers.
# :param target_sum: (int) The required target sum.
# :returns: (a tuple of 2 ints) The indices of the two elements whose sum is equal to target_sum
# """
# if len(numbers) < 2:
# return None... |
from collections import defaultdict
from .images import release_key
class Index:
def __init__(self, images=None):
self.images = set()
self.version = defaultdict(set)
self.platform = defaultdict(set)
self.release = defaultdict(set)
self.architecture = defaultdict(set)
... |
# Getting the normal admin routines, classes, and `site` instance.
from django.contrib.admin import (
autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline,
HORIZONTAL, VERTICAL,
)
# Geographic admin options classes and widgets.
from django.contrib.gis.admin.options import GeoModelAdmin, OSMGe... |
from django.contrib import admin
from .models import *
class OfferAdmin(admin.ModelAdmin):
list_display = ('seller', 'title', 'publish_date', 'measure', 'quantity', 'price')
admin.site.register(Offer, OfferAdmin)
admin.site.register(Balance)
admin.site.register(UserProfile)
class TotalBalanceAdmin(admin.ModelAd... |
import unittest
class TestTracker(unittest.TestCase):
def test_create_tracker(self):
pass
|
"""This module contains the general information for AdaptorMenloEthErrorStatsHist ManagedObject."""
from ...ucscentralmo import ManagedObject
from ...ucscentralcoremeta import UcsCentralVersion, MoPropertyMeta, MoMeta
from ...ucscentralmeta import VersionMeta
class AdaptorMenloEthErrorStatsHistConsts():
MOST_REC... |
# 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 ... |
#!/usr/bin/env python
# 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... |
"""Extractor for "arxiv" identifiers.
Regular expressions taken from `python-mwcites` by Aaron Halfaker.
See https://github.com/mediawiki-utilities/python-mwcites
"""
import regex as re
from typing import Iterator
from .common import CaptureResult, Identifier, Span
__all__ = ('extract',)
# From http://arxiv.org/hel... |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Read and write transforms."""
from . import afni, fsl, itk, lta
from .lta import LinearTransform, LinearTransformArray, VolumeGeometry
__all__ = [
"afni",
"fsl",
"itk",
"lta",
... |
from typing import Tuple
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from dashboard.models import ObservationComment, Alert, Area
class AlertForm(forms.ModelForm):
def __init__(self, for_user, *args, **kwargs):
... |
# Apache v2 license
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# This file is copied from https://github.com/clovaai/length-adaptive-transformer
# with roberta model added
# Length-Adaptive Transformer
# Copyright (c) 2020-present NAVER Corp.
# Apache License v2.0
from transformers... |
# --------------
#Code starts here
import pandas as pd
import numpy as np
import math
class complex_numbers:
def __init__(self,real,imag):
self.real=real
self.imag=imag
def __repr__(self):
if self.real == 0.0 and self.imag == 0.0:
... |
cidade = input('Digite o nome da cidade em que você mora: ').strip()
print(cidade[:5].upper() == 'SANTO') |
import geopandas as gpd
import glob
import numpy as np
import pandas as pd
import rasterstats
from shapely.geometry import Point
from DeepTreeAttention.utils.paths import find_sensor_path
def non_zero_99_quantile(x):
"""Get height quantile of all cells that are no zero"""
mdata = np.ma.masked_where(x < 0.5, x... |
import pathlib
import logging
import os
import re
import signal
import subprocess
import threading
from functools import wraps
from itertools import chain
from funcy import decorator
from voluptuous import Any, Schema, MultipleInvalid
import dvc.dependency as dependency
import dvc.output as output
import dvc.prompt ... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
#!/usr/bin/env python
import rospy
import time
import actionlib
from move_base_msgs.msg import *
from nav_msgs.msg import OccupancyGrid
import matplotlib.pyplot as plt
import math
from A_star_class import AStarPlanner
from nav_msgs.msg import Odometry
from nav_msgs.srv import GetMap
from geometry_msgs.msg import Pose
f... |
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'learnCookiecutter.users'
verbose_name = "Users"
def ready(self):
"""Override this to put in:
Users system checks
Users signal registration
"""
pass
|
import socket
import sys
import time
import os
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
from sharestore_lib.SharestorePool import SharestorePool
from sharestore_lib.SharestorePool import HashType
if __name__ == "__main__":
#options = {'host': '172.26.83.192', 'port': 9090}
options = {'host': ... |
import keras
from keras.models import Sequential, Model, load_model
from keras import backend as K
import tensorflow as tf
import os
import numpy as np
from scipy.signal import convolve as sp_conv
from scipy.signal import correlate as sp_corr
from scipy.signal import find_peaks
class OneHotEncoder :
def __init... |
###################################################################
# Summary: Cantor Pairing function and Reverse Cantor used in MMP code
#
# Notes:
# - Allows us to fold a vector of integer values onto a single integer value reversibly
# http://stackoverflow.com/questions/919612/mapping-two-integers-to-one-in-a-uni... |
# Coding is all about making things easier for ourselves.
# Some times you will be writing the same code over and
# over again. When this happens, it is often best to write
# a function.
# functions are defined with the def keyword:
def paulsFunction():
# anything inside the function will execute when I call it
... |
import os
import glob
import bchlib
import numpy as np
from PIL import Image, ImageOps
import torch
from tqdm import tqdm
BCH_POLYNOMIAL = 137
BCH_BITS = 5
def main():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--model', type=str, default=r"saved_models/crop/encoder.pth")
... |
import setuptools
with open("README.md") as f:
long_description = f.read()
requirements = [
"tortoise-orm>=0.17.2",
"pypika-gis>=1.3.0",
"shapely>=1.7.1",
"geojson>=2.5.0",
]
setuptools.setup(
name="tortoise-gis",
version="0.1.2",
author="Eduardo Ribeiro Rezende",
author_email="e... |
"""
# UI/UX Authoring Tool
# @license http://www.apache.org/licenses/LICENSE-2.0
# Author @ Jamil Hussain
"""
from django.conf.urls import url, include
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$',views.homeView, name='home'),
url(r'^overview',views.overviewView, n... |
from rllab_maml.misc import ext
from rllab_maml.misc.overrides import overrides
import rllab.misc.logger as logger
from sandbox.ours.algos.MAML.batch_maml_polopt import BatchMAMLPolopt
from sandbox.ours.optimizers.maml_ppo_optimizer import MAMLPPOOptimizer
from sandbox_maml.rocky.tf.misc import tensor_utils
import tens... |
#! /usr/bin/env python
sources = """
eNrsvWt3JMlxKMZ7/bi+betKsuXr17FPscejqtpt1GCGS4nC3d7VcDhDjrjcmTMPcXVAqKfQXQCK
KFT1VFUPAFH08Xd/8T/wj7g/wv/Gv8HxymdldTdmd0n5HK/EAdCdGZkZGRkZERmP//1f//79D5K3
f7a+zRZVc54tFmVd9ovF+3/19u+m02kEn52X9Xn0+OXzKInXbbPaLIu2i6O8XkXxsqm7zRX9Db/W
xbIvVtGHMo8ui9vrpl11aQRAJpP3//rtv8ERun71/j9583/9qx/... |
from ..build_specific_dfs import find_replaced_modules
from ..build_specific_dfs import swapped_mod_dataframes
import pandas as pd
directory = 'test_data_after_sorted/'
def test_find_replaced_modules_1():
'''
Tests to determine that the returned object is a dictionary
'''
replaced_dict = find_replaced... |
"""
Pay to delegated conditions
In this puzzle program, the solution must be a signed list of conditions, which
is returned literally.
"""
from pipscoin.types.blockchain_format.program import Program
from .load_clvm import load_clvm
MOD = load_clvm("p2_delegated_conditions.clvm")
def puzzle_for_pk(public_key: Pr... |
"""Init is required to do relative import of async_tools from test modules"""
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.