filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_106_22716 | import numpy as np
import os
conf_file = './conf'
param_file = './param'
name = []
value = []
#for l in open(conf_file, 'r'):
with open(conf_file, 'r') as f1:
lines = f1.readlines()
cnt = len(lines)
for l in lines:
l = l.strip().split(' ')
if l[0] == 'des_var':
nam... |
the-stack_106_22717 | #!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the preciousblock RPC."""
from test_framework.test_framework import BitcoinTestFramework
from tes... |
the-stack_106_22718 | import os
import sys
import unittest
here = os.path.dirname(__file__)
sys.path.extend((
os.path.join(here, os.path.pardir),
os.path.join(here, 'versioned-libs')
))
class SimpleTestCase(unittest.TestCase):
def test_basic_functionality(self):
import using_testlib_10 as v1
import using_tes... |
the-stack_106_22719 | import unittest2 as unittest
import simplejson
from celery.app import app_or_default
from celery.task import Task
from celery.task.sets import subtask, TaskSet
from celery.tests.utils import execute_context
from celery.tests.compat import catch_warnings
class MockTask(Task):
name = "tasks.add"
def run(sel... |
the-stack_106_22722 | #!/usr/bin/env python3
import argparse
try:
import Tkinter
except ImportError:
import tkinter as Tkinter
import yaml
import os
import subprocess
import re
import time
import threading
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
"--configpath",
type=str,
default=os.path... |
the-stack_106_22725 | import logging
logger = logging.getLogger("pyfb")
logger.setLevel(logging.DEBUG)
from django.core.urlresolvers import reverse
from django.http import *
from django.shortcuts import *
from django.template.context import RequestContext
from pyfb import auth
import config
auth_denied_template = config.get("PYFB_AUTH_DE... |
the-stack_106_22726 | # Copyright 2018 Datawire. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
the-stack_106_22727 | # coding=utf-8
# Copyright 2018 Sascha Schirra
#
# 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 di... |
the-stack_106_22729 | """Structural data from FreeSurfer output."""
from itertools import product
import os
from ..utils import run_fs
def get_structural_data(subjects_dir, subject, out_dir):
"""Extract structural data.
The data includes cortical sickness, cortical surface area,
and subcortical volumes from FreeSurfer proces... |
the-stack_106_22733 | import wx
from book_manager.bookpanel import BookPanel
class BookFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, style=wx.MINIMIZE_BOX | wx.CAPTION | wx.CLOSE_BOX)
self.__width, self.__height = 555, 460
screen_size = wx.DisplaySize()
self.SetPosition(((scre... |
the-stack_106_22735 |
import json
import os
from functools import partial
from PySide2 import QtWidgets, QtCore
import hotbox_designer
from hotbox_designer.commands import OPEN_COMMAND, CLOSE_COMMAND, SWITCH_COMMAND
from hotbox_designer.reader import HotboxReader
from hotbox_designer.designer.application import HotboxEditor
from hotbox_de... |
the-stack_106_22736 | import cv2,os,glob
import SimpleITK as sitk
import numpy as np
segs='/mnt/data9/independent_segs/lungs'
raw='/mnt/data9/independent_data'
out_path='/mnt/data9/independent_crop'
for type in os.listdir(segs):
for volume in os.listdir(os.path.join(segs,type)):
person=volume.split('_')[1]
stage = volume... |
the-stack_106_22737 | # -*- coding: utf-8 -*-
'''
Query and modify an LDAP database (alternative interface)
=========================================================
.. versionadded:: 2016.3.0
This is an alternative to the ``ldap`` interface provided by the
:py:mod:`ldapmod <salt.modules.ldapmod>` execution module.
:depends: - ``ldap`` P... |
the-stack_106_22738 | import numpy as np
from sklearn.neighbors import KNeighborsClassifier as SKKNeighborsClassifier
from skopt.space import Integer
from evalml.model_family import ModelFamily
from evalml.pipelines.components.estimators import Estimator
from evalml.problem_types import ProblemTypes
class KNeighborsClassifier(Estimator):... |
the-stack_106_22740 | """
ModelAccounts API
Allow clients to fetch ModelAccounts Analytics through APIs. # noqa: E501
The version of the OpenAPI document: 3
Contact: analytics.api.support@factset.com
Generated by: https://openapi-generator.tech
"""
import json
import atexit
import mimetypes
from multiprocessing.pool... |
the-stack_106_22742 | import unittest
import X4_parser as X4
import TI_parser as TI
class TestParser(unittest.TestCase):
def test_iq(self):
"""
Method to test if .dat binary file was converted successfully to .csv file with in-phase and quadrature
components together.
:return:
converted
... |
the-stack_106_22743 | import copy
import json
import logging
import time
from pathlib import Path
from threading import RLock
from uuid import uuid4
from typing import Any, Dict, List
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
from azure.mgmt.network import NetworkManagementClie... |
the-stack_106_22744 | import argparse
import json
import os
import random
import numpy as np
import torch
from ilqr_utils import (
backward,
compute_latent_traj,
forward,
get_x_data,
latent_cost,
random_actions_trajs,
refresh_actions_trajs,
save_traj,
seq_jacobian,
update_horizon_start,
)
from mdp.ca... |
the-stack_106_22745 | from typing import List, Dict, Optional, Callable, Awaitable, Union
from aiogram.types import InlineKeyboardButton, CallbackQuery
from aiogram_dialog.deprecation_utils import manager_deprecated
from aiogram_dialog.dialog import Dialog, ChatEvent
from aiogram_dialog.manager.protocols import DialogManager
from aiogram_... |
the-stack_106_22746 | import gc
import os
import pickle
import subprocess
import sys
import pytest
from shapely.errors import ShapelyDeprecationWarning
from shapely.geometry import Point, Polygon
from shapely.geos import geos_version
from shapely import strtree
from shapely.strtree import STRtree
from .conftest import requires_geos_342
... |
the-stack_106_22748 | import torch
import torch.nn as nn
from glasses.interpretability import GradCam
from glasses.models.base import Freezable, Interpretable
def test_Freezable():
class MyModel(nn.Sequential, Freezable, Interpretable):
def __init__(self):
super().__init__(nn.Conv2d(3, 32, kernel_size=3, bias=False... |
the-stack_106_22753 | # -*- coding: utf-8 -*-
# !/usr/bin/env python
from data_structures.graphs.utils import *
import queue
def bfs_list(g, s):
"""
Breadth First Search algorithm for adjacency lists.
:param g: the graph to visit. It is assumed the list only contains int data type.
:type g: list(list(int))... |
the-stack_106_22754 | """Display a "Pastebin" menu that allows you to pastebin files easily.
If a part of the file is selected when you click something in the "Pastebin"
menu, then only the selected part of the file is shared.
"""
# TODO: make this work with pythonprompt plugin?
from __future__ import annotations
import logging
import soc... |
the-stack_106_22756 | import traceback
import logging
from datetime import datetime, time, date, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.template.loader import get_template, render_to_string
from django.template import Template, TemplateDoesNotExist, RequestContext
from django.core... |
the-stack_106_22757 | import gym
from collections import deque
from agent import DQNAGENT
import numpy as np
import random
import os
random.seed(2212)
np.random.seed(2212)
EPISODES = 10000
REPLAY_MEMORY_SIZE = 100000
MINIMUM_REPLAY_MEMORY = 1000
MINIBATCH_SIZE = 12
EPSLION = 1
EPSLION_DECAY = 0.99
MINIMUM_EPSLION = 0.001
... |
the-stack_106_22758 | import re
class Conjugator:
def calculate_lemma_model(self, lemma):
if lemma == 'être':
return 'être'
elif lemma == 'avoir':
return 'avoir'
elif lemma == 'aller':
return 'aller'
elif lemma.endswith('er'):
appeler_exceptions = ['agneler... |
the-stack_106_22759 | from .blur import BoxBlur, box_blur
from .blur_pool import BlurPool2D, MaxBlurPool2D, blur_pool2d, max_blur_pool2d
from .canny import Canny, canny
from .filter import filter2d, filter2D, filter2d_separable, filter3d, filter3D
from .gaussian import GaussianBlur2d, gaussian_blur2d
from .kernels import (
gaussian,
... |
the-stack_106_22762 | """ --- Day 3: Toboggan Trajectory ---
With the toboggan login problems resolved, you set off toward the airport. While travel by toboggan might be easy, it's certainly not safe: there's very minimal steering and the area is covered in trees. You'll need to see which angles will take you near the fewest trees.
Due to ... |
the-stack_106_22764 | import __builtin__
__builtin__.process = 'ai'
__builtin__.__dict__.update(__import__('panda3d.core', fromlist = ['*']).__dict__)
from direct.extensions_native import HTTPChannel_extensions
from toontown.toonbase import ToonPythonUtil as PythonUtil
import argparse
parser = argparse.ArgumentParser()
parser.add_arg... |
the-stack_106_22767 | import unittest
import time
from drone_inner_comms.rabbit.rabbit_inner_comms import RabbitInnerComms, Endpoint
class RabbitCommsCase(unittest.TestCase):
def setUp(self) -> None:
self.rabbitComms = RabbitInnerComms()
self.message = None
def _message_handler(self, msg):
sel... |
the-stack_106_22769 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
the-stack_106_22770 | import responses
import json
from .helpers import mock_file, ClientTestCase
class TestCapturePayment(ClientTestCase):
def setUp(self):
super(TestCapturePayment, self).setUp()
self.base_url = '{}/payments/capture'.format(self.base_url)
@responses.activate
def test_capture_payment(self):
... |
the-stack_106_22771 | from django.urls import path
from . import views
app_name = "user"
urlpatterns = [
path('create/', views.CreateUserView.as_view(), name="create"),
path('token/', views.CreateTokenView.as_view(), name='token'),
path('me/', views.ManageUserView.as_view(), name='me'),
]
|
the-stack_106_22774 |
import cPickle
from kiko.constants import SERIALIZATION
from kiko.exceptions import (KikoDeserializeException,
InvalidDeserializerException)
from kiko.io.basedeserializer import BaseDeserializer
from . import v1
class DeserializerManager:
_deserializers = {}
@classmethod
de... |
the-stack_106_22775 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Dario Zanzico (git@dariozanzico.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
module: doc... |
the-stack_106_22778 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 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 derivat... |
the-stack_106_22780 | # Copyright 2013 IBM Corp.
#
# 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 agree... |
the-stack_106_22781 | from parser_class import parse_all
from gen_sent_event import gen_sent
from mem import MemoryGraph
from manipState import *
from storyenv import *
import random
import time, pickle
from datetime import datetime
#########################
# TO BE IMPLEMENTED #
#########################
local_story = storyEnv()
memo... |
the-stack_106_22785 | import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
import pickle
import numpy as np
import pandas as pd
lemmatizer = WordNetLemmatizer()
'''
polarity 0 = negative. 2 = neutral. 4 = positive.
id
date
query
user
tweet
'''
def init_process(fin,fout):
outfile = open(fout,'a')
w... |
the-stack_106_22787 | """
Contains sync flow implementation for Auto Dependency Layer
"""
import hashlib
import logging
import os
import tempfile
import uuid
from typing import List, TYPE_CHECKING, Dict, cast, Optional
from samcli.lib.bootstrap.nested_stack.nested_stack_builder import NestedStackBuilder
from samcli.lib.bootstrap.nested_sta... |
the-stack_106_22788 | """
This module implements sums and products containing the Kronecker Delta function.
References
==========
- http://mathworld.wolfram.com/KroneckerDelta.html
"""
from __future__ import print_function, division
from sympy.core import Add, Mul, S, Dummy
from sympy.core.cache import cacheit
from sympy.core.compatibili... |
the-stack_106_22789 | import datetime
import random
from faker.utils.checksums import calculate_luhn
from .. import Provider as SsnProvider
class Provider(SsnProvider):
@staticmethod
def _org_to_vat(org_id):
org_id = org_id.replace('-', '')
if len(org_id) == 10:
org_id = '16' + org_id
return ... |
the-stack_106_22790 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of restful-distributed-lock-manager released under the MIT license.
# See the LICENSE file for more information.
from rdlm.request_handler import RequestHandler, admin_authenticated
from rdlm.lock import LOCK_MANAGER_INSTANCE
from rdlm.hal import Reso... |
the-stack_106_22791 | # __BEGIN_LICENSE__
# Copyright (C) 2008-2010 United States Government as represented by
# the Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# __END_LICENSE__
from django.conf.urls.defaults import url, patterns
urlpatterns = patterns(
'mapFastenApp.views',
url(r'^... |
the-stack_106_22795 | import numpy as np
from scipy.spatial.distance import cdist, pdist, squareform
def apply_sequence_kernel(seq_emb, kernel_radius=1, eplison=0.01):
'''
Method applies fuzzy graph kernels to sequence vectors. This is used to naively propagate
local information of neighbors within a specified kernel radius. Al... |
the-stack_106_22798 | from __future__ import annotations
import json
from functools import lru_cache
from pathlib import Path
from typing import Any, Iterable, List, Set, Tuple, Union, cast
from packaging.version import Version as PackageVersion
from pip._vendor.packaging.specifiers import SpecifierSet
from pdm.exceptions import InvalidP... |
the-stack_106_22800 | import time
import torch
from reinvent_scoring import ScoringFuncionParameters
from reinvent_models.reinvent_core.models.model import Model
from reinvent_scoring.scoring.diversity_filters.reinvent_core.base_diversity_filter import BaseDiversityFilter
from running_modes.automated_curriculum_learning.logging.base_auto_cl... |
the-stack_106_22802 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
the-stack_106_22803 | """The interface between scenes and ffmpeg."""
__all__ = ["SceneFileWriter"]
import datetime
import os
import shutil
import subprocess
from pathlib import Path
from time import sleep
import numpy as np
from PIL import Image
from pydub import AudioSegment
from manim import __version__
from .. import config, logger
... |
the-stack_106_22804 | # Copyright Clayton Brown 2019. See LICENSE file.
from ..internal import GameObject, Box
from ..utilities import recursiveSplit
from .textLine import TextLine
from typing import List
from dataclasses import dataclass
@dataclass
class TextLineData:
'''
Handles the meta information necessary fo... |
the-stack_106_22805 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2020 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This software cons... |
the-stack_106_22807 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sentiment', '0004_auto_20160130_2357'),
]
operations = [
migrations.AlterField(
model_name='tweetgroup',
... |
the-stack_106_22808 | # 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
# d... |
the-stack_106_22810 | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test defid shutdown."""
from test_framework.test_framework import DefiTestFramework
from test_framework.uti... |
the-stack_106_22811 | load("@fbcode_macros//build_defs/lib:visibility.bzl", "get_visibility")
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
def _java_protoc_compile_srcs(
name,
srcs,
generated_src_zip_rule_name):
cmd = (
"include=; for s in `dirname $SRCS|sort|uniq`; do include=\... |
the-stack_106_22813 | import datetime
import uuid
from unittest.mock import Mock, patch
import pytest
from flask import get_flashed_messages, url_for
from tests.factories import *
from tests.mock_azure import mock_azure
from tests.utils import captured_templates
from werkzeug.datastructures import ImmutableMultiDict
from atst.database imp... |
the-stack_106_22815 | #!/usr/bin/env python3
###############################################################################
# Copyright 2018 The Apollo 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... |
the-stack_106_22818 | try:
from userbot.modules.sql_helper import BASE, SESSION
except ImportError:
raise AttributeError
from sqlalchemy import Column, String
class Mute(BASE):
__tablename__ = "muted"
chat_id = Column(String(14), primary_key=True)
sender = Column(String(14), primary_key=True)
def __i... |
the-stack_106_22819 | import numpy as np
from gym.spaces import Box
from metaworld.envs.asset_path_utils import full_v1_path_for
from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
class SawyerFaucetOpenEnv(SawyerXYZEnv):
def __init__(self):
hand_low = (-0.5, 0.40, -0.15)
han... |
the-stack_106_22821 | #!/usr/bin/env python
import os
import sys
sys.path = ["lib", "pytests", "pysystests"] + sys.path
import time
from xunit import XUnitTestResult
import glob
import xml.dom.minidom
import logging
log = logging.getLogger(__name__)
logging.info(__name__)
logging.getLogger().setLevel(logging.INFO)
import argparse
def fil... |
the-stack_106_22822 | from datetime import date, datetime
import csv
import numpy as np
import pandas as pd
from utils.helpers import is_two_digit_year, is_multiple_date_data, add_years, year_in_front
def convert_raw_data_to_matrix(fixed_df, current_gauge_column_index, start_date):
"""Summary Function
"""
current_gauge_class,... |
the-stack_106_22823 | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Editor Plugin"""
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disable=R0201
# Standard library imports
import ... |
the-stack_106_22824 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
the-stack_106_22827 | from __future__ import print_function
from keras.models import Model
from keras.layers import Input, LSTM, Dense
import numpy as np
batch_size = 64
epochs = 500
latent_dim = 256
num_samples = 10000
data_path = 'reverse_train_data'
# prepare datasets
# -------------------------------------------------
inpu... |
the-stack_106_22828 | from datetime import datetime
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.core.mail import mail_admins
from django.db import models
from dennis.translator import Translator
from statsd import statsd
import waff... |
the-stack_106_22829 | import bpy
import struct
import mathutils
import math
def write_indices(f, o, mesh, face, index, offset):
f.write(struct.pack("I", face.vertices[index] + offset))
def write_some_data(context, filepath, use_some_setting):
print(filepath)
f = open(filepath, 'wb')
meshes = []
vertex_count = 0
face_... |
the-stack_106_22830 | from typing import Any
from ply.lex import LexToken
from windyquery.ctx import Ctx
from windyquery.validator import ValidationError
from ._base import Base
TOKEN = 'JOIN'
class JoinToken(LexToken):
def __init__(self, value):
self.type = TOKEN
self.value = value
self.lineno = 0
se... |
the-stack_106_22833 | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import time
from pathlib import Path
import ezdxf
from ezdxf.addons import iterdxf
BIGFILE = Path(ezdxf.EZDXF_TEST_FILES) / "GKB-R2010.dxf"
# BIGFILE = Path(ezdxf.EZDXF_TEST_FILES) / 'ACAD_R2000.dxf'
OUTDIR = Path("~/Desktop/Outbox").expanduser()
t0 = time.p... |
the-stack_106_22835 | from fabric import task
from benchmark.local import LocalBench
from benchmark.logs import ParseError, LogParser
from benchmark.utils import Print, BenchError
from benchmark.plot import Ploter, PlotError
from benchmark.instance import InstanceManager
from benchmark.remote import Bench
@task
def local(ctx, debug=True)... |
the-stack_106_22836 | import ast
import csv
import os
import pandas as pd
import pickle
import tarfile
import xml.etree.ElementTree as ET
import korbinian
import korbinian.utils as utils
import sys
import zipfile
import xml
from multiprocessing import Pool
# import debugging tools
from korbinian.utils import pr, pc, pn, aaa
def run_parse_s... |
the-stack_106_22840 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="brazilpinpoint",
version="1.0.7",
author="Newton Galiza",
author_email="newtonjgaliza@gmail.com",
description="Using a latitude and longitude a pin point is marked on Brazil map",
long... |
the-stack_106_22841 | import pytest
from django.urls import resolve, reverse
from peer_lending.users.models import User
pytestmark = pytest.mark.django_db
def test_user_detail(user: User):
assert (
reverse("api:user-detail", kwargs={"username": user.username})
== f"/api/users/{user.username}/"
)
assert resolv... |
the-stack_106_22842 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020-2022 Barcelona Supercomputing Center (BSC), Spain
#
# 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... |
the-stack_106_22843 | # Copyright 2020 The Magenta 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 ... |
the-stack_106_22844 | import random
from ..exceptions import DriverNotFound
from .BaseConnection import BaseConnection
from ..query.grammars import MSSQLGrammar
from ..schema.platforms import MSSQLPlatform
from ..query.processors import MSSQLPostProcessor
from ..exceptions import QueryException
CONNECTION_POOL = []
class MSSQLConnectio... |
the-stack_106_22845 | #########
# Copyright (c) 2019 Cloudify Platform Ltd. 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... |
the-stack_106_22847 | # shelve.py - save/restore working directory state
#
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""save and restore changes to the working directory
The "hg shelve" command saves changes made ... |
the-stack_106_22848 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 clowwindy
#
# 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 r... |
the-stack_106_22850 | # The MIT License (MIT)
#
# Copyright (c) 2019 Carter Nelson for Adafruit Industries
#
# 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 ri... |
the-stack_106_22851 | #!/usr/bin/python
"""This program parses various source files and extracts the comment texts.
Currently supported languages:
Bash/sh
C
C++
Go
HTML
Java
Javascript
Ruby
XML
Dependencies:
python-magic: pip install python-magic (optional)
"""
import sys
try:
import magic
has_magic = True
except... |
the-stack_106_22853 | import helpers
# get input
raw_input = helpers.read_input_at_once(__file__)
# initialize parameters
stride = 3
count = 0
# initialize depths with first window
depths = []
for i in range(stride):
depths.append(int(raw_input[i]))
# getting first sum
aggregate_depth = sum(depths)
# looping over the rest
for i in ... |
the-stack_106_22855 | import contextlib
from distutils.version import StrictVersion
import functools
import inspect
import os
from pathlib import Path
import shutil
import sys
import unittest
import warnings
import matplotlib as mpl
import matplotlib.style
import matplotlib.units
import matplotlib.testing
from matplotlib import cbook
from ... |
the-stack_106_22856 | import random
import string
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.mail import send_mail
from django.shortcuts import render, redirect
from django.urls import reverse_lazy
from django.views.generic import ListView, UpdateView... |
the-stack_106_22861 | # https://github.com/tensorflow/tensorflow/blob/r1.7/tensorflow/python/ops/array_grad.py#L725
from math import ceil
from tensorflow.python.framework import sparse_tensor
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import sparse_ops
def _ExtractIm... |
the-stack_106_22862 | import os
import os.path as osp
import random
from math import floor
import dataset_split.dir_utils as utils
#CONVENTION: args come in (train, test, val) format
COPY_FOLDER = '_split_'
def replicate_classes(path, classes, subdirs):
'''
Will create all classes (dirs) inside every
subdir found in path.
... |
the-stack_106_22864 | import os
import requests
import operator
import re
import nltk
from flask import Flask, render_template, request
from flask.ext.sqlalchemy import SQLAlchemy
from stop_words import stops
from collections import Counter
from bs4 import BeautifulSoup
app = Flask(__name__)
app.config.from_object(os.environ['APP_SETTINGS... |
the-stack_106_22865 | import tensorflow as tf
from numpy import random
from glob import glob
from custom_models import VGG19
from ImageLoader import *
from functools import reduce
VGG_MEAN = [103.939, 116.779, 123.68, 102.32]
HPF_risks = []
class COX_model_with_VGG(object, VGG19):
def build(self, rgb, train_mode=None):
"... |
the-stack_106_22866 | #!/usr/bin/env python3
# Copyright 2004-present Facebook. 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.
"""Downloads binary tar files from S3 and unpacks them locally.
Takes paths that corresponds to credentials ... |
the-stack_106_22867 | # Copyright 2012 OpenStack Foundation
# 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 requ... |
the-stack_106_22868 | # qubit number=2
# total number=7
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as... |
the-stack_106_22869 | import unittest, sys
sys.path.append('src')
from ganon import ganon
from ganon.config import Config
base_dir = "tests/ganon/"
sys.path.append(base_dir)
from utils import *
data_dir = base_dir + "data/"
class TestBuildOnline(unittest.TestCase):
results_dir = base_dir + "results/integration_online/build/"
... |
the-stack_106_22871 | """Transfer Out item definition."""
from gaphas.geometry import Rectangle
from gaphor.core.modeling import DrawContext
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
from_package_str,
)
from gaphor.diagram.shapes import Box, IconBox, Text, stroke
from gaphor.diagram.support imp... |
the-stack_106_22872 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2020, Jim Miller'
__docformat__ = 'restructuredtext en'
import collections
from functools import reduce
from io import StringIO
import loggi... |
the-stack_106_22873 | """Built in actions for Jaseci"""
from jaseci.actions.live_actions import jaseci_action
from jaseci.jac.jac_set import jac_set
@jaseci_action()
def max(item_set: jac_set):
ret = None
if (not len(item_set)):
return None
items = item_set.obj_list()
max_val = items[0].anchor_value()
ret = ite... |
the-stack_106_22874 | from mldp.pipeline import Pipeline
from mldp.steps.readers import CsvReader
from mldp.steps.transformers.nlp import TokenProcessor,\
VocabMapper, Padder
from mldp.steps.transformers.field import FieldSelector
from mldp.utils.helpers.nlp.token_cleaning import twitter_text_cleaner
from mldp.utils.tools import Vocabul... |
the-stack_106_22875 | import random
import time
from airtest.core.api import *
from airtest.core.error import TargetNotFoundError
from airtest.core.helper import (G, delay_after_operation)
def connect_windows(name):
""" 连接win设备
"""
try:
connect_device("windows:///?title_re=%s" % name)
except Exception as e:
... |
the-stack_106_22876 | import click
from os import path
from .base import cli
from ..client import ProtectClient
from ..sync import ProtectSync
@cli.command(
"sync", help="Synchronize your UniFi Protect footage to a local destination"
)
@click.argument("dest", type=click.Path(exists=True, writable=True, resolve_path=True))
@click.opt... |
the-stack_106_22877 | # Copyright (c) 2018 PaddlePaddle 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 app... |
the-stack_106_22881 | from jumpscale import j
from gevent.pywsgi import WSGIServer
from geventwebsocket.handler import WebSocketHandler
import sys
import os
from .JSWebLoader import JSWebLoader
JSConfigBase = j.tools.configmanager.base_class_config
TEMPLATE = """
host = "localhost"
port = 5050
port_ssl = 0
secret_ = ""
... |
the-stack_106_22882 | from datetime import datetime
import pytest
from opentrons.types import MountType
from pydantic import ValidationError
from opentrons.protocol_engine import commands as pe_commands
from robot_server.service.session.models import command, command_definitions
@pytest.mark.parametrize(
argnames="command_def",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.