text stringlengths 1 927k |
|---|
import sys
import operator
import pytest
import ctypes
import gc
import numpy as np
from numpy.core._rational_tests import rational
from numpy.core._multiarray_tests import create_custom_field_dtype
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_raises, HAS_REFCOUNT)
from numpy.compa... |
from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@gmail.com',
... |
import re
from io import StringIO
from contextlib import contextmanager
import snowflake.connector
import snowflake.connector.errors
import dbt.compat
import dbt.exceptions
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from dbt.adapters.base import C... |
#!/usr/bin/env python
#
# Copyright 2018 Espressif Systems (Shanghai) PTE 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 req... |
import json
from tornado import web
from jupyterhub.apihandlers import APIHandler, default_handlers
class BatchSpawnerAPIHandler(APIHandler):
@web.authenticated
def post(self):
"""POST set user's spawner port number"""
user = self.get_current_user()
data = self.get_json_body()
... |
load("@bazel_skylib//lib:paths.bzl", "paths")
# we disable implicit native rules by default for antlir things, but for
# third-party cxx rules it is easier to just use the buck native ruleset
cxx_library = native.cxx_library
prebuilt_cxx_library = native.prebuilt_cxx_library
def subdir_glob(glob_specs):
# Simple ... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2018 New Vector 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.... |
# Copyright 2020 Toyota Research Institute. All rights reserved.
# Adapted from monodepth2
# https://github.com/nianticlabs/monodepth2/blob/master/networks/depth_decoder.py
from __future__ import absolute_import, division, print_function
import numpy as np
import torch
import torch.nn as nn
from collections import... |
# -*- coding: utf-8 -*-
from django.apps import AppConfig
class OrganizationsConfig(AppConfig):
name = "organizations"
verbose_name = "Organizations" |
"""Molecule tests for the default scenario."""
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_rustup_init_installed(host):
"""Ensure that rustup-init was installed."""
rus... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('scd_app', '0003_auto_20151025_2136'),
]
operations = [
migrations.CreateModel(
name='ScdComutador',
... |
# Copyright (c) 2022 Mira Geoscience Ltd.
#
# This file is part of geoapps.
#
# geoapps is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
from uuid import UUID
from geoh5py.data import FloatData
from geoh5py.groups import ContainerGroup
... |
from django.db import models
# models from other Apps
from account.models import User
# python packages
import datetime
# ------------------------- COURSE MODEL -----------------------------------------
class Course(models.Model):
course_name = models.CharField("course name", max_length=60)
course_code = m... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 9 21:25:15 2020
@author: lenovouser
"""
import matplotlib.pyplot as plt
import numpy as np
N_MOVES = 150
DNA_SIZE = N_MOVES*2 # 40 x moves, 40 y moves
DIRECTION_BOUND = [0, 1]
CROSS_RATE = 0.8
MUTATE_RATE = 0.0001
POP_SIZE = 100
N_GENERATIONS = 200
GOAL_POINT =... |
#!/usr/bin/env python3
# date: 2019.12.08
# https://stackoverflow.com/questions/59238605/finding-page-element-using-seleniumpython
import selenium.webdriver
url = 'https://www.textnow.com/login'
driver = selenium.webdriver.Firefox()
driver.get(url)
item = driver.find_element_by_xpath('//input[@id="txt-use... |
"""
Basic tool parameters.
"""
import contextlib
import json
import logging
import os
import os.path
import re
from webob.compat import cgi_FieldStorage
import galaxy.model
from galaxy import util
from galaxy.tool_util.parser import get_input_source as ensure_input_source
from galaxy.util import (
dbkeys,
sa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.