text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
from model.group import Group
def test_add_group(app, data_groups):
group = data_groups #загружаем данные из файла C:\python_traning\python_traning\data\groups.py но через conftest
old_groups = app.group.get_group_list()
#[TEST]
app.group.create(group)
assert len(old_group... |
"""users and news tavles
Revision ID: f94644732e1d
Revises:
Create Date: 2022-04-06 11:49:54.106755
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f94644732e1d'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands a... |
from .blob import *
|
# -*- coding: utf-8 -*-
from zerver.lib.test_classes import WebhookTestCase
class GoogleCodeInTests(WebhookTestCase):
STREAM_NAME = 'gci'
URL_TEMPLATE = "/api/v1/external/gci?&api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'gci'
def test_abandon_event_message(self) -> None:
expected_top... |
#!/usr/bin/env python3
"""
classification type (books.py)
"""
from enum import Enum
from typing import Dict
class BookType(Enum):
"""
Enum to store nlp types
"""
dostoyevsky = "dostoyevsky"
doyle = "doyle"
austen = "austen"
class StartEnd:
"""
start and end lines for book
"""
... |
from abc import ABC, abstractmethod
from collections import abc as cabc
from typing import Union, Optional, Type, ClassVar, TypeVar # Special types
from typing import Iterator, Mapping, Sequence # ABCs
from typing import Tuple, List, Dict # Generic base types
import numpy as np
import pandas as pd
from scipy.sparse... |
import streamlit as st
import streamlit_book as stb
import time
import random
st.title("To Do List")
# Default
st.header("Question with minimal arguments")
c1, c2 = st.columns([5,5])
with c1:
st.code("""
stb.to_do_list(
tasks={"a":True, "b":False, "c":False} # required argument
... |
import argparse
import json
import os
from core_data_modules.logging import Logger
from core_data_modules.traced_data.io import TracedDataJsonIO
from core_data_modules.util import IOUtils
from storage.google_cloud import google_cloud_utils
from storage.google_drive import drive_client_wrapper
from src import CombineR... |
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
path('admin/', admin.site.urls),
path('shop/', include('shop.urls')),
path('blog/', include('blog.urls')),
path('', vie... |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Product(models.Model):
_id = models.AutoField(primary_key=True, editable=False)
name = models.CharField(max_length=200)
category = models.CharField(max_length=200, blank=True, null=True)
descript... |
#! /usr/bin/env python
"""
Python wrapper to execute c++ tSNE implementation
for more information on tSNE, go to :
http://ticc.uvt.nl/~lvdrmaaten/Laurens_van_der_Maaten/t-SNE.html
HOW TO USE
Just call the method calc_tsne(dataMatrix)
Created by Philippe Hamel
hamelphi@iro.umontreal.ca
October 24th 2008
"""
from stru... |
import io
import zipfile
import os
import random
from telenet.config import get as tn_config
RND_SEED = tn_config('train.random_seed')
os.environ['PYTHONHASHSEED'] = str(RND_SEED)
random.seed(RND_SEED)
import numpy as np
import pandas as pd
np.random.seed(RND_SEED)
import tensorflow as tf
import tensorflow_addons... |
from argparse import (
SUPPRESS,
ArgumentDefaultsHelpFormatter,
ArgumentParser,
FileType,
Namespace,
)
from asyncio import (
CancelledError,
create_task,
get_event_loop,
run,
set_event_loop_policy,
)
from logging import DEBUG, INFO, basicConfig
from pathlib import Path
from signa... |
from flask import Flask,redirect,render_template,request
# EB looks for an 'application' callable by default.
application = Flask(__name__)
@application.route('/')
def index():
return render_template('index.html')
@application.route('/search_largest_n', methods=['GET'])
def largest_n(number=5):
number = requ... |
import eos
import numpy as np
def main():
"""Demo for running the eos fitting from Python."""
landmarks = read_pts('D:/Develop/opensources/eos/examples\data/image_0010.pts')
image_width = 1280 # Make sure to adjust these when using your own images!
image_height = 1024
model = eos.morphablemodel.lo... |
"""
Module: 'math' on esp32 1.10.0
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.10.0', version='v1.10 on 2019-01-25', machine='ESP32 module with ESP32')
# Stubber: 1.3.2
def acos():
pass
def acosh():
pass
def asin():
pass
def asinh():
pass
def atan():
pass
def atan2():
pass
de... |
from flask import Flask
from flask_restful import Api
from flask_sqlalchemy import SQLAlchemy
from flask_jwt_extended import JWTManager
from flask_cors import CORS
from datetime import timedelta
from messengers.telegram_messenger.telegram_messenger import TelegramMessenger
from notification_handler import NotificationH... |
from rest_framework.authtoken import views as rest_views
from django.urls import path
from . import views
urlpatterns = [
path('register/', views.Register.as_view()),
path('login/', rest_views.obtain_auth_token),
path('update_password/', views.UpdatePassword.as_view()),
path('forgot_password/', views.F... |
# 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, ... |
# Program to show various ways to read and
# write data in a file.
import math
import numpy as np
import struct
import random
# opcodes
# Bit shift values must go to B Input on the execute
# 000001 or = shift left
# 000100 = shift right
# 001000 = equivalence check
# 000000 = branching ie < or >
# 000111 or 000101... |
#! /usr/bin/env python3
#Import modules needed for Python version check, date/time, timer, file/folder exists, sqlite, truncate number to non-fractional digits, OS/host check
import sys, datetime, time, os.path, sqlite3, math, platform, shutil
#from tkinter import *
#from tkinter import ttk
#window = Tk()
#window.titl... |
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""CARLA Settings"""
import io
import random
import sys
if sys.version_info >= (3, 0):
from ... |
/home/runner/.cache/pip/pool/73/d1/38/70311a709fee29bb84e41a805687285a9eabb2e0464e488d0d0ab7cd5e |
from django.db import models
class Talk (models.Model):
topic = models.TextField()
speaker = models.TextField()
scheduled_at = models.DateTimeField()
|
from bs4 import BeautifulSoup
from ... import helpers
def parse(body):
try:
soup = BeautifulSoup(body, "lxml")
except HTMLParser.HTMLParseError as e:
return helpers.err(str(e))
tables = soup.find_all('table')
# tables[0] == welcome message
# tables[1] == profile
if not len(tables) == 2:
return helpers... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
for amimoto_alexa
"""
def debug_logger(*args):
""" outputs args to log
"""
for x in args:
print(repr(x))
|
import sys
import json
if __name__ == "__main__":
f_in = sys.argv[1]
f_out = f_in.replace(".csv.tmp", ".json")
#print(os.listdir(ori_dir))
json_data = []
with open(f_in, 'r') as f:
json_data = json.load(f)
#print(json.dumps(json_list, indent=4))
json_data = [ dict(d, **{ 'title'... |
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Education, obj[4]: Occupation, obj[5]: Bar, obj[6]: Coffeehouse, obj[7]: Restaurant20to50, obj[8]: Direction_same, obj[9]: Distance
# {"feature": "Occupation", "instances": 23, "metric_value": 0.9986, "depth": 1}
if obj[4]<=10:
# {"fea... |
import numpy as np
from pettingzoo.test import api_test, seed_test, parallel_test
from pettingzoo.mpe import simple_push_v2, simple_world_comm_v2
from pettingzoo.butterfly import knights_archers_zombies_v10
from pettingzoo.classic import chess_v5
from pettingzoo.magent import combined_arms_v6
import supersuit
import p... |
import multiprocessing
pool = None
def initPool():
global pool
pool = multiprocessing.Pool(int(multiprocessing.cpu_count()))
def execInPool(func, params):
return pool.map(func, params)
|
from __future__ import absolute_import
import re
import os
from datetime import datetime
from .data import Data
NAME_REGEX = re.compile(
r'^:(?P<attribute>[a-z\-_]+)'
r'(?:\[(?P<type>[a-z]+)\])?:'
r'\s*(?P<value>.*)$'
)
def _read_file(path):
with open(path) as fp:
return fp.readlines()
de... |
from panda3d.core import TextNode
from direct.gui.DirectButton import DirectButton
from direct.gui.OnscreenText import OnscreenText
from direct.task.Task import Task
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.parties import PartyUtils
from toontown.parties impo... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'profielp.settings')
try:
from django.core.management import execute_from_command_line
except Imp... |
# Copyright (c) 2019 Vyom Fadia
#
# 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 use, copy, modify, merge, publish, distribu... |
"""
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Pycord Development
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 limit... |
from superQuery import superQuery
client = superQuery.Client()
#----------------------------------------------------
# Set your Google Cloud billing project
#----------------------------------------------------
client.project("yourBillingProjectId")
#----------------------------------------------------
# Select a des... |
# encoding: utf-8
# module RevitServices.Threading calls itself Threading
# from RevitServices, Version=1.2.1.3083, Culture=neutral, PublicKeyToken=null
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class RevitSchedulerThread(object, ISchedulerThread):
""" RevitSchedulerThread(rev... |
import argparse
import logging
import pprint
import mxnet as mx
import numpy as np
import os
import importlib
from six.moves import reduce
from six.moves import cPickle as pkl
from core.detection_module import DetModule
from utils import callback
from utils.memonger_v2 import search_plan_to_layer
from utils.lr_schedu... |
import pyvista
from pyvista import demos
pl = pyvista.Plotter()
pl.disable_parallel_projection()
pl.parallel_projection
# Expected:
## False
|
# -*- coding: utf-8 -*-
import serial
import time
import json
import ast
import json_parser
process_flag=0
s = None
config = None
sendup_package={"can_id":0, "struct_id":0, "data_lens":0, "upload_lens":0,"data_val": [0,0]}
json_package=json.dumps(sendup_package)
dict_object=None
def load_config():
with open('dat... |
import matplotlib.pyplot as plt
from com.simulation.lift.api.CostDict import cost_dict
fig = plt.figure()
fig.canvas.set_window_title('Advance Case Graph')
fig.suptitle("""Cost
in function of
Lift Capacity, Floor Number and Passenger Number""")
ax = fig.add_subplot(111, projection='3d')
x = []
y = []
z = []
c = []
... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
"""The Apple System Log Parser."""
import construct
import logging
import os
from plaso.lib import errors
from plaso.lib import event
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers import interface
from plaso.parsers import manager
__author__ = 'Joaquin More... |
a, b = [int(x) for x in input().split()]
# if (a == 1) and (b == 1):
# print('Ooops!')
# else:
print(a-b)
|
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# cds-migrator-kit is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Pytest configuration."""
from __future__ import absolute_import, print_f... |
"""
1666. Change the Root of a Binary Tree
Medium
Given the root of a binary tree and a leaf node, reroot the tree so that the leaf is the new root.
You can reroot the tree with the following steps for each node cur on the path starting from the leaf up to the root excluding the root:
If cur has a left child, the... |
"""
Current Report Base Tests
"""
# stdlib
import unittest
# module
from avwx import current
from avwx.structs import Code
class BaseTest(unittest.TestCase):
"""Current report base test class"""
def test_wxcode(self):
"""Tests expanding weather codes or ignoring them"""
for code, value in (... |
import subprocess
import humanize
import random
from datetime import datetime
from discord.ext import commands
class Others(commands.Cog, name='Others'):
"""
Others module
Other random commands that don't fit neatly into one of the other modules
"""
def __init__(self, bot):
self.bot = b... |
import copy
import os
import sys
from contextlib import contextmanager
import pytest
import taichi as ti
@contextmanager
def patch_os_environ_helper(custom_environ: dict, excludes: dict):
"""
Temporarily patch os.environ for testing.
Originally created by @rexwangcc in test_cli.py
@archibate tweaked... |
from keras.datasets import mnist
from keras.utils import np_utils
import numpy as np
import h5py
import matplotlib.pylab as plt
def normalization(X):
return X / 127.5 - 1
def inverse_normalization(X):
return (X + 1.) / 2.
def get_nb_patch(img_dim, patch_size, image_dim_ordering):
assert image_dim_... |
# Copyright 2013 Red Hat, 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 agre... |
"""A friendly Python SFTP interface."""
from __future__ import print_function
import os
from contextlib import contextmanager
import ntpath
import posixpath
import socket
from stat import S_IMODE, S_ISDIR, S_ISREG
import tempfile
import warnings
import paramiko
from paramiko import SSHException # make av... |
"""simplehttpplugin.py :: Fauxmo plugin for simple HTTP requests.
Fauxmo plugin that makes simple HTTP requests in its `on` and `off` methods.
Comes pre-installed in Fauxmo as an example for user plugins.
For more complicated requests (e.g. authentication, sending JSON), check out
RESTAPIPlugin in `https://github.com... |
# -*- coding: utf-8 -*-
#
# Copyright 2016 Erik Bernhardsson
#
# 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 l... |
"""HDL Module."""
from hdltools.abshdl import HDLObject
from hdltools.abshdl.builtin import HDLBuiltins
from hdltools.abshdl.scope import HDLScope
from hdltools.abshdl.signal import HDLSignal
from hdltools.abshdl.macro import HDLMacro
from hdltools.abshdl.port import HDLModulePort, HDLModuleTypedPort
from hdltools.abs... |
import requests
import eel
import os
import sys
import json
import subprocess
import ctypes
import time
import sys
import math
server = "INSERT_DEFAULT_SERVER_HERE"
port = "8080"
clientver = "1.1.0" #Required as the server will block out of date clients
app_port = 17755
minToTimeout = 10 #Number of minutes to check s... |
#!/usr/bin/env python
from pwn import *
import os
TEAM_N = 400
flags_file = open('flags.txt', 'w')
for i in range(TEAM_N):
rands = os.urandom(32)
token = rands.encode('base64').strip()
p = process('./bin/keygen')
p.sendline(token)
p.recvuntil('You key is: ')
key = p.recvall().strip()
fl... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Invenio App ILS Circulation views."""
from flask import Blueprint
from invenio_circulation.links import loan_l... |
# 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
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import pytest
from windtalker.cipher import BaseCipher
from windtalker.tests import BaseTestCipher
class MyCipher(BaseCipher):
def encrypt(self, binary, *args, **kwargs):
return (base64.b64encode(binary... |
"""This module implements the security group helper module for AWSHeet that is aimed at providing idempotent AWS EC2 security groups.
Currently, it only supports Security Groups that are in a VPC.
Rules are created using the SecurityGroupRule type and then they are collected together inside an iterable (usually a set ... |
"""Main driver for the SHADHO framework.
Classes
-------
Shadho
Driver class for local and distributed hyperparameter optimization.
"""
from shadho.configuration import ShadhoConfig
from shadho.hardware import ComputeClass
from shadho.managers import create_manager
from collections import OrderedDict
import json
... |
from collections import OrderedDict
# output from elife-kitchen-sink.xml
expected = [
OrderedDict(
[
("doi", "10.7554/eLife.00013.001"),
("doi_url", "https://doi.org/10.7554/eLife.00013.001"),
(
"content",
"Bacterially-produced small molec... |
import json
from zope import interface
from twisted.internet import defer
from piped.plugins.status_testing import statustest, processors
from piped import processing
class TestClientProcessor(processors.StatusTestProcessor):
interface.classProvides(processing.IProcessor)
name = 'test-client'
class Tes... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from timm.models.registry import register_model
from timm.models.vision_transformer import _cfg
__all__ = [
'pvt_tiny', 'pvt_small', 'pvt_medium', 'pvt... |
"""
add timestamped entries with cs count at 5 minutes for training type
add new training type
add new session of entries
"""
import os
import time
import json
import click
default_directory = str()
default_filename = str()
config_data = dict()
path = os.path.abspath(os.path.relpath('../data/config.json'))
with open... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
Sometimes we want object_id/room_id --> category_name, e.g. for semantic segmentation.
We construct such mapp... |
import numpy as np
import experimental_data_utils as edu
import pyabf
class reader:
def __init__(self, filedir):
"""
Initialize reader
:param filedir: string. Relative or absolute path to directory
"""
self.filedir = filedir
self.PY_spike_times = []
self.LP... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import zmq
def ServerSocket(port=5556):
# opens server socket and returns it
# use this socekt for send recv functions
# see zmq doc for more options
if not isinstance(port, int):
raise TypeError("port should be integer")
context = zmq.Context... |
# Generated by Django 2.2 on 2021-11-12 11:54
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
na... |
# Generated by Django 2.1.7 on 2019-09-11 09:27
from django.db import migrations
def update_reporting_standard(apps, schema_editor):
# Change any existing BASIC_4_7_RETROACTIVE articles to the new BASIC_4_7_RETROACTIVE
Article = apps.get_model('curate', 'Article')
for article in Article.objects.filter(re... |
#!/usr/bin/python -Es
import sys, os
import subprocess
import Overc
if __name__ == '__main__':
overc=Overc.Overc()
overc.agency.clean_essential()
overc.agency.clean_container()
|
import os
import sublime
import sublime_plugin
from .core.protocol import Request
from .core.registry import LspTextCommand
from .core.typing import List, Optional, Dict, Any
from .core.url import uri_to_filename
from .symbols import format_symbol_kind
class SymbolQueryInput(sublime_plugin.TextInputHandler):
def... |
# -*- coding: utf-8 -*-
import logging
import re
import requests
from django.http import HttpResponse
from django.utils.six.moves import urllib
from django.views.generic import View
from django.urls import reverse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.decorators.csrf import csrf_e... |
# Var name is left, value right
price_per_item = 0.5
amount = 10
total_price = amount * price_per_item
print(total_price)
|
#!/usr/bin/env python
import os
import re
from setuptools import setup
from setuptools import find_packages
from setuptools.command.sdist import sdist as _sdist
from setuptools.extension import Extension as _Extension
cmdclass = {}
ext_modules = []
cython_modules = [
'thriftrw._buffer',
'thriftrw._cython',
... |
import logging
logging.basicConfig(level=logging.DEBUG)
# export SLACK_API_TOKEN=xoxb-***
# python3 integration_tests/samples/basic_usage/channels.py
import os
from slack_sdk.web import WebClient
client = WebClient(token=os.environ["SLACK_API_TOKEN"])
response = client.conversations_list(exclude_archived=1)
chann... |
import unittest
from translator import english_to_french,french_to_english
class Testfr2eng(unittest.TestCase):
def test1(self):
self.assertEqual(french_to_english('Bonjour'), 'Hello')
self.assertNotEqual(french_to_english('Bonjour'), 'potato')
class Testeng2fr(unittest.TestCase):
def te... |
from . import self
async def fetch_weverse():
"""Fetch all weverse subscriptions."""
return await self.conn.fetch("SELECT channelid, communityname, roleid, commentsdisabled, mediadisabled"
" FROM weverse.channels")
|
#
# Copyright 2016-2021 Razorbill Instruments Ltd.
# This file is part of the Razorbill Lab Python library which is
# available under the MIT licence - see the LICENCE file for more.
#
"""
Module for interfacing with Rigol Instruments
"""
from . import ScpiInstrument, ChildInstrument, _scpi_property, _logger
import ma... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import u... |
from ParseEmailFiles import MsOxMessage, main, convert_to_unicode, unfold, handle_msg
from CommonServerPython import entryTypes
import demistomock as demisto
import pytest
def exec_command_for_file(file_path, info="RFC 822 mail text, with CRLF line terminators", file_name=None):
"""
Return a executeCommand fu... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... |
"""
This module contains the mlflow resource provided by the MlFlow
class. This resource provides an easy way to configure mlflow for logging various
things from dagster runs.
"""
import atexit
import sys
from itertools import islice
from os import environ
from typing import Any, Optional
import mlflow
from mlflow.ent... |
import numpy as np
from typing import List
from scipy.cluster.hierarchy import fcluster, linkage
from sklearn.metrics.pairwise import cosine_similarity
import plotly.express as px
import plotly.graph_objects as go
def visualize_heatmap(topic_model,
topics: List[int] = None,
... |
"""Connection protocol messages and helpers."""
import json
import re
import uuid
import base64
from collections import namedtuple
from voluptuous import Schema, Optional, And, Extra, Match, Any, Exclusive
from aries_staticagent import Message, crypto, route
from ..schema import MessageSchema, AtLeastOne
from .. impo... |
#!/usr/bin/env python
# Copyright (c) 2018 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Extract generated templates into a signac project for simplified inspection."""
import argparse
import os
import generate_template_reference_data a... |
from . import util, ga_utils
|
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'modana.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are y... |
"""Depth and outlyingness ABCs and implementations for multivariate data."""
from __future__ import annotations
import abc
import math
from typing import Generic, Optional, TypeVar
import numpy as np
import scipy.stats
import sklearn
from scipy.special import comb
from typing_extensions import Literal
T = TypeVar("... |
"""
For também suporta else e While/Else também
"""
lista = ['Rafael', 'Paula', 'The Walking Dead', 'Malhação']
for n in lista:
if n.lower().startswith('s'):
break
else:
print('Nenhuma das palavras comçam com "s"')
|
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_lin_demolitionmech.iff"
result.attribute_template_id = 9
resu... |
from helpers import assert_equality
def plot():
import numpy as np
from matplotlib import pyplot as plt
def f(t):
s1 = np.cos(2 * np.pi * t)
e1 = np.exp(-t)
return np.multiply(s1, e1)
fig = plt.figure()
t1 = np.arange(0.0, 5.0, 0.4)
t2 = np.arange(0.0, 5.0, 0.1)
... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... |
# coding=utf-8
# Copyright 2022 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... |
from __future__ import division
import numpy as np
from six.moves import range
def normalize(theta, start=0):
"""
Normalize an angle to be in the range :math:`[0, 2\pi]`
Parameters
-----------
theta : float
input angle to normalize
start: float
input start angle (optional, ... |
import cupy as cp
"""Module file that contains necessary functions for solving the spin-1 GPE using a symplectic method. These functions
use CuPy to wrap around CUDA for a fast and efficient evolution."""
def rotation(wfn, Nx, Ny, alpha, beta, gamma):
"""Function that performs a spin rotation with angles alpha, ... |
import logging
import json
import time
from html.parser import HTMLParser
try:
import requests
except ImportError:
print('установите библиотеку requests')
class vk:
app_id = ''
user_id = ''
access_token = ''
v = '5.64'
def authorize(self, app_id, login, password, scope, v):
self... |
from django.views.generic import TemplateView
class DashboardView(TemplateView):
template_name="dashboard/index.html"
class StateView(TemplateView):
template_name="dashboard/state.html"
class CountyView(TemplateView):
template_name="dashboard/county.html"
class FacilityView(TemplateView):
templa... |
from typing import Sequence, Optional
from molfunc.fragments import _frag_smiles_to_xyz_filenames
from molfunc_ext import (c_print_combined_from_names,
c_print_combined_from_xyz_filenames,
c_print_all_combined_molecules)
def print_combined_molecule(core_xyz_filename: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.