text stringlengths 1 927k |
|---|
import logging
import pickle
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional, Union
from numpy.typing import NDArray
from sklearn.preprocessing import LabelEncoder
from predictions.face_recognizer import ModelType
from settings import output
logger = logging.getLogger(__name__)
def... |
import pytest
from modeltestSDK import Client
@pytest.fixture(scope="module")
def client():
"""
Expose an SDK API client configured for testing
"""
client = Client() # TODO: Konfigurer en test API (lokalt?)
return client |
from django.contrib import admin
from .models import Ticket, Review, UserFollows
admin.site.register(Ticket)
admin.site.register(Review)
admin.site.register(UserFollows) |
#Main code |
#####################################################
#
# breakout game with pygame
# for Python stage in Technofutur TIC (Belgium)
# Authors : Bastien Wiaux and Benoit Ronval
#
#####################################################
import pygame
from constants import *
from player import Player
from ball import Ball... |
# ==============================================================================
# Copyright 2018-2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## You may use this file under the terms of the BSD license as follows:
##
## "Redistrib... |
# -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowSpResResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): ... |
# Generated by Django 2.2.10 on 2020-04-23 10:29
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("common", "0020_auto_20200409_1653"),
("contacts", "0004_contact_teams"),
]
operations = [
migratio... |
""" Entry point for tsrc push """
import argparse
import itertools
from typing import cast, Any, List, Optional, Set # noqa
from gitlab import Gitlab
from gitlab.v4.objects import Group, User, Project, ProjectMergeRequest # noqa
from gitlab.exceptions import GitlabGetError
import ui
import tsrc
import tsrc.config... |
import json
from mock import patch
from seahub.base.accounts import UserPermissions
from seahub.invitations.models import Invitation
from seahub.test_utils import BaseTestCase
from seahub.api2.permissions import CanInviteGuest
class InvitationsTest(BaseTestCase):
def setUp(self):
self.login_as(self.user)... |
"""Creates a data/tile footprint"""
import json
import logging
import os
import subprocess
import tempfile
import rasterio
from geojson import Polygon
from pystac.utils.io import get_tempdir
logger = logging.getLogger(__name__)
def generate_thumbnail(prefix: str, tif_path: str) -> str:
"""Generates thumbnail f... |
from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyexcel
from openpyexcel.descriptors.serialisable import Serialisable
from openpyexcel.descriptors import (
Typed,
Float,
Integer,
Bool,
MinMax,
Set,
NoneSet,
String,
Alias,
)
from openpyexcel.descriptors.excel imp... |
#!/usr/bin/env python
# Usage: get_diffmetric.py img1 img2
#
# Helper script that calculates the DiffMetric between two given images.
# For debugging purposes only.
#
# Note: This requires PIL or Pillow to be installed.
from __future__ import print_function
import sys
from PIL import Image
## Main program.
img1_pat... |
# -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
from unittest import TestCase
import pandas as pd
import numpy as np
from tsfresh.transformers.feature_selector import F... |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... |
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'jessica42.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Ar... |
from os import environ
import base64
from multiprocessing import Process, Queue
from scrapy.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
from scrapy_splash import SplashRequest
import scrapy.crawler as crawler
from twisted.internet import reactor
from ..captcha import captcha_solver
cla... |
# VMware vSphere Python SDK
# Copyright (c) 2008-2014 VMware, Inc. 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
#
# ... |
# -*- coding: utf-8 -*-
#/usr/bin/python2
'''
June 2017 by kyubyong park.
kbpark.linguist@gmail.com.
https://www.github.com/kyubyong/transformer
'''
from __future__ import print_function
import tensorflow as tf
import numpy as np
def normalize(inputs,
epsilon = 1e-8,
scope="ln",
... |
import random
from pylons.i18n import set_lang
import sqlalchemy.exc
import ckan.logic
from ckan.lib.search import SearchError
from ckan.lib.base import *
from ckan.lib.helpers import url_for
CACHE_PARAMETER = '__cache'
class HomeController(BaseController):
repo = model.repo
def __before__(self, action, **... |
# coding=utf-8
# Copyright 2020 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... |
# Copyright (c) MONAI Consortium
# 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, so... |
from kraken import plugins
from kraken.core.maths import Xfo, Vec3, Quat
from kraken.core.configs.config import Config
from kraken_components.biped.arm_component import ArmComponentGuide, ArmComponentRig
class CustomConfig(Config):
"""Base Configuration for Kraken builders."""
def __init__(self):
su... |
#!/usr/bin/env python2
from __future__ import print_function
import fnmatch
import sys
import os
import ssg
import argparse
import ssg.build_cpe
import ssg.id_translate
import ssg.xml
# This script requires two arguments: an OVAL file and a CPE dictionary file.
# It is designed to extract any inventory definitions ... |
# -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "",
"(active)": "",
"Also available in:": "",
"Archive": "",
"Categories": "",
"Comments": "",
"LANGUAGE": "Ingles",
"Languages:": "Mga Wika:",
"More posts about %s": "",
"N... |
from typing import List
from backend.infrastructure.contracts import QueryProduct
from backend.infrastructure.schemas import ProductSchema
class MockProductRepository:
def select_one(self, query: QueryProduct) -> ProductSchema:
return None
def select_all(self, query: QueryProduct) -> List[ProductSch... |
#!/usr/bin/env python
# Copyright 2010 Google Inc. 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... |
from __future__ import print_function
import json
from argh import ArghParser, arg
from ghtools import cli
from ghtools.api import GithubAPIClient
parser = ArghParser(description="Browse the GitHub API")
@arg('github', nargs='?', help='GitHub instance nickname (e.g "enterprise")')
@arg('url', help='URL to browse')... |
"""
Test scheme parsing.
"""
from map_machine.scheme import Scheme
def test_verification() -> None:
assert (
Scheme(
{
"colors": {"default": "#444444"},
"node_icons": [{"tags": [{"tags": {"a": "b"}}]}],
}
)
.node_matchers[0]
.... |
# The While Loop
monty = 0
python = 10
# While the value of monty is smaller than python's value
# everything within the loop will be executed
while monty < python:
print('Currently at: ' + str(monty))
# Python does not allow the increment operator: monty++ won't work
monty += 1
# A loop that cause... |
import capstone as cp
from elftools.elf.elffile import ELFFile
import bisect
from diffObjdump import FunctionFeatures
class Objdump:
__local_code_begin = 0
__local_code_end = 0
__linked_code_begin = 0
__linked_code_end = 0
def __init__(self, filename):
self.__name = filename
with open(filename, 'rb'... |
# ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
import date... |
# This an autogenerated file
#
# Generated with SumForceResponseStorage
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.sumforceresponsestorage import SumForceResponseStorageBlueprint
from typing import Dict
from sima.riflex.additionalfileformatc... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-07-01 05:05
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('slot', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_... |
import qmmlpack as qmml
import numpy as np
import ase.io as asio
import csv
from cmlkit.dataset import Dataset, Subset
import cmlkit.indices as cmli
# The following assumes that you have downloaded the Kaggle dataset from
# https://www.kaggle.com/c/nomad2018-predict-transparent-conductors/data,
# in particular train.c... |
#!env python
import sys
from typing import List
import os
import re
from better_profanity import profanity
class SecurityReviewValidator:
results = None
def __init__(self):
pass
def validate_path(self, path: str) -> List[str]:
results = []
for root, _, files in os.walk(path, topd... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.1)
#
# WARNING! All changes made in this file will be lost!
from Qt import QtCore
qt_resource_data = b"\
\x00\x00\x00\x74\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1f\x00\x... |
import matplotlib.pyplot as plt
import numpy as np
def before_and_after(f, h, x_min=-1, x_max=1, y_min=-1, y_max=1):
fig, ax = plt.subplots(1, 2, figsize=(8, 3))
x = np.linspace(x_min, x_max, 500)
y = np.linspace(y_min, y_max, 500)
X, Y = np.meshgrid(x, y)
Z = np.array([[f(xi, yi) for xi in x] fo... |
# @l2g 2078 python3
# [2078] Two Furthest Houses With Different Colors
# Difficulty: Easy
# https://leetcode.com/problems/two-furthest-houses-with-different-colors
#
# There are n houses evenly lined up on the street,and each house is beautifully painted.
# You are given a 0-indexed integer array colors of length n,
# ... |
#!/usr/bin/env python
# Usage: ./parse_scheme_table.py filename1 [filename2 filename3 ...]
# Input: fortran filenames with doxygen-compliant and CCPP-compliant physics schemes; the argument tables should have the following format:
# !! \section arg_table_schemename_run
# !! | local_name | standard_name ... |
import sys
import os
import argparse
import subprocess
class CommandLineParser:
def __init__(self):
self.term_width = 100
self.formater = lambda prog: argparse.HelpFormatter(prog, max_help_position=int(self.term_width / 2), width=self.term_width)
self.commands = {}
self.hidden_comma... |
#!/usr/bin/env python3
""" Remove dead domains from list. """
import argparse
import asyncio
import collections
import errno
import itertools
import random
import resource
from typing import Dict, List, Optional
import aiodns
import tqdm
DNS_SERVERS = (
("8.8.8.8", "8.8.4.4"), # Google DNS
("208.67.222.222... |
# Generated by Django 3.2 on 2021-04-20 21:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0097_githubrepository_permissions"),
]
operations = [
migrations.AddField(
model_name="task",
name="assigned_de... |
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... |
#!/usr/bin/env python
"the benchmark with date features only"
"0.30421 on public leaderboard"
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression
#
train_file = '../data/train.csv'
test_file = '../data/test.csv'
output_file = 'linear_regression_with_date_features_only.csv'
lo... |
#!/usr/bin/python3
from __future__ import annotations
from typing import Dict
from requests import get
from json import dumps
from os.path import join, abspath, dirname, exists, realpath
from os import mkdir
def build(target_file: str = abspath(join(dirname(realpath(__file__)), '../data/country.json'))) -> Dict[str,... |
# Copyright 2017 Google Inc. 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 ... |
from presidio_analyzer import EntityRecognizer
def test_to_dict_correct_dictionary():
ent_recognizer = EntityRecognizer(["ENTITY"])
entity_rec_dict = ent_recognizer.to_dict()
assert entity_rec_dict is not None
assert entity_rec_dict["supported_entities"] == ["ENTITY"]
assert entity_rec_dict["supp... |
# Authors: Pierre Ablin <pierre.ablin@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Jean-Francois Cardoso <cardoso@iap.fr>
#
# License: BSD (3-clause)
import numbers
import numpy as np
from scipy.linalg import expm
def gradient(Y, psiY):
'''
Compute the gradient for the cu... |
# 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 ... |
'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Mts20140618QueryAnalysisJobListRequest(RestApi):
def __init__(self,domain='mts.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.AnalysisJobIds = None
def getapiname(self):
return 'mts.aliyuncs.com.QueryAnalysisJ... |
"""ๅๅ
ฅๆไปถ"""
file_name = 'user_input.txt'
user_input = input('่ฏท่พๅ
ฅๆจ่ฆๅญๅจ็ไฟกๆฏ:\n')
with open(file_name, 'w',encoding='utf8') as file_object:
file_object.write(user_input)
print('ๅๅ
ฅๆๅ') |
from Tkinter import *
import ttk, tkFont, tkMessageBox
import itertools
import datetime
from Connect_Brisco_DB import Connect_DB
from DB_searchandFill import DB_search
from psycopg2 import sql
import serial
from psycopg2.extensions import AsIs
class GUIatFrontDesk:
def __init__(self,master):
from PIL imp... |
import os
import pandas as pd
import pytest
import polars as pl
from .. import read_sql
@pytest.fixture(scope="module") # type: ignore
def postgres_url() -> str:
conn = os.environ["POSTGRES_URL"]
return conn
def test_modin(postgres_url: str) -> None:
query = "SELECT * FROM test_table"
df = read_s... |
from __future__ import unicode_literals
import logging
from urllib import urlencode
from urlparse import parse_qsl, urlparse, urlunparse
def rewrite_location_header(name, value, params):
"""
Rewrite "Location" header to append params to the URL's query string.
Returns other headers unmodified.
:par... |
# 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... |
# -*- mode: python; coding: utf-8; -*-
"""Common services code"""
import os
AVAILABLE_SERVICES = ['habit_list', 'idonethis', 'nikeplus', 'pedometerpp',
'sleep_cycle']
def get_service_module(service_name):
"""Import given service from dayonetools.services package"""
import importlib
... |
# 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
# "License"); you may not u... |
import sys
import json
import click
import anchorecli.clients.apiexternal
import anchorecli.cli.utils
config = {}
@click.group(name="repo", short_help="Repository operations")
@click.pass_obj
def repo(ctx_config):
global config
config = ctx_config
try:
anchorecli.cli.utils.check_access(config)
... |
from sklearn import datasets
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
loaded_data = datasets.load_boston()
data_x = loaded_data.data
data_y = loaded_data.target
model = LinearRegression()
model.fit(data_x, data_y)
## print(model.predict(data_x[:4, :]))
print(model.coef_)
pr... |
import re
"""
์ด์ฑ ์ค์ฑ ์ข
์ฑ ๋ถ๋ฆฌ ํ๊ธฐ
์ ๋์ฝ๋ ํ๊ธ์ 0xAC00 ์ผ๋ก๋ถํฐ
์ด์ฑ 19๊ฐ, ์ค์21๊ฐ, ์ข
์ฑ28๊ฐ๋ก ์ด๋ฃจ์ด์ง๊ณ
์ด๋ค์ ์กฐํฉํ 11,172๊ฐ์ ๋ฌธ์๋ฅผ ๊ฐ๋๋ค.
ํ๊ธ์ฝ๋์ ๊ฐ = ((์ด์ฑ * 21) + ์ค์ฑ) * 28 + ์ข
์ฑ + 0xAC00
(0xAC00์ 'ใฑ'์ ์ฝ๋๊ฐ)
๋ฐ๋ผ์ ๋ค์๊ณผ ๊ฐ์ ๊ณ์ฐ ์์ด ๊ตฌํด์ง๋ค.
์ ๋์ฝ๋ ํ๊ธ ๋ฌธ์ ์ฝ๋ ๊ฐ์ด X์ผ ๋,
์ด์ฑ = ((X - 0xAC00) / 28) / 21
์ค์ฑ = ((X - 0xAC00) / 28) % 21
์ข
์ฑ = (X - 0xAC00) % 28
์ด ๋ ์ด์ฑ,... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RockETS_Basestation.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensu... |
import graphene
from graphene import relay
from ...payment import models
from ..core.connection import CountableDjangoObjectType
from ..core.types import Money
from .enums import OrderAction, PaymentChargeStatusEnum
class Transaction(CountableDjangoObjectType):
amount = graphene.Field(Money, description="Total a... |
from __future__ import print_function
import sys
from collections import OrderedDict
import numpy as np
#vm_word = get_plate_stress_strain(
#model, key, is_stress, vm_word, itime,
#oxx, oyy, txy, max_principal, min_principal, ovm, is_element_on,
#header_dict, keys_map)
class StressObject(object):
def ... |
"""
"""
import sys
import os
import pkgutil
from ast import NodeTransformer
from abc import ABCMeta, abstractproperty
from inspect import isabstract
from importlib import import_module
from ..utils import classproperty
__all__ =\
[ "BasicOptimization"
, "ASTOptimization"
, "ByteCodeOptimi... |
of the published Quick2Wire API.
#
# Converted from <asm-generic/ioctl.h>
# ioctl command encoding: 32 bits total, command in lower 16 bits,
# size of the parameter structure in the lower 14 bits of the
# upper 16 bits.
#
# Encoding the size of the parameter structure in the ioctl request
# is useful for catching prog... |
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import json
import pytest
import requests
from celery.canvas import Signature
from flexmock import flexmock
from ogr.abstract import CommitStatus
from ogr.services.github import GithubProject
from ogr.utils import RequestResponse
from pack... |
# Copyright (c) 2016 Hewlett Packard Enterprise Software, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
import gzip
import json
from hashlib import md5
from concurrent import futures
from operator import itemgetter
import requests
from .utils import prepare_url
from . import BASE
class InvalidReferenceData(Exception):
pass
def _load_single_file(url):
r = requests.get(url['url'])
data = gzip.decompress(r... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import unittest
from packaging import version
import numpy as np
import transformers
from transformers import AutoTokenizer
import datasets
from datasets import DatasetDict, load_dataset
try:
from transformers.testing_ut... |
from django.db import models
# Create your models here.
class Product(models.Model):
product_brand = models.CharField(max_length=50)
product_article_code = models.CharField(max_length=20)
product_code= models.IntegerField()
product_name= models.CharField(max_length=150)
product_unit_packaging_number = models.Inte... |
"""Google config for Cloud."""
import asyncio
import logging
from hass_uniocloud import cloud_api
from hass_uniocloud.google_report_state import ErrorResponse
from homeassistant.components.google_assistant.helpers import AbstractConfig
from homeassistant.const import (
CLOUD_NEVER_EXPOSED_ENTITIES,
EVENT_HOME... |
#!/usr/bin/env python
from setuptools import setup
import re
script_content = open('docx-replace').read()
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", script_content))
setup(
name="docx-replace",
version=metadata['version'],
description="Replace text inside docx file",
url="https://gith... |
from flask import Blueprint
"""
Admin Blueprint
"""
blueprint = Blueprint(
'admin_blueprint',
__name__,
url_prefix = '/admin'
)
from app.api.admin.views import admin |
# 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
# "License"); you may not u... |
# This file is used to configure the behavior of pytest when using the Astropy
# test infrastructure.
from astropy.version import version as astropy_version
if astropy_version < '3.0':
# With older versions of Astropy, we actually need to import the pytest
# plugins themselves in order to make them discoverabl... |
from setuptools import setup, find_packages
setup(
name="FakeApp",
version="1.0",
packages=find_packages(),
entry_points={
'paste.app_factory': """
basic_app=fakeapp.apps:make_basic_app
other=fakeapp.apps:make_basic_app2
configed=fakeapp.configapps:SimpleApp.make_app
... |
#!/usr/bin/env vpython3
# Copyright (c) 2012 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.
"""Unit tests for gclient_scm.py."""
# pylint: disable=E1103
from __future__ import unicode_literals
from subprocess import P... |
import re
import os
import socket
import logging
import platform
import tempfile
import subprocess
from os.path import expanduser
import six
from boto3 import Session
from localstack.constants import (
DEFAULT_SERVICE_PORTS, LOCALHOST, DEFAULT_PORT_WEB_UI, TRUE_STRINGS, FALSE_STRINGS,
DEFAULT_LAMBDA_CONTAINER_R... |
import logging
import os
from pprint import pprint
from shutil import rmtree
import pandas as pd
from dask.distributed import Client
from prompt_toolkit.shortcuts import button_dialog
from utoolbox.io import open_dataset
from utoolbox.io.dataset import BigDataViewerDataset, TiledDatasetIterator
logger = logging.getL... |
import hashlib
from pathlib import Path
import torch
import pandas as pd
import torchio as tio
from tqdm import tqdm
from resector import RandomResection
from sklearn.model_selection import KFold
from utils import sglob, get_stem
class DataModule:
def __init__(
self,
datasets_dir,
... |
# encoding: utf-8
# module PySide.QtGui
# from C:\Python27\lib\site-packages\PySide\QtGui.pyd
# by generator 1.147
# no doc
# imports
import PySide.QtCore as __PySide_QtCore
import Shiboken as __Shiboken
from QAbstractItemView import QAbstractItemView
class QTreeView(QAbstractItemView):
# no doc
def allColu... |
"""
Validator for a regular language.
"""
from typing import Dict
from prompt_toolkit.document import Document
from prompt_toolkit.validation import ValidationError, Validator
from .compiler import _CompiledGrammar
__all__ = [
"GrammarValidator",
]
class GrammarValidator(Validator):
"""
Validator which... |
"""
This file offers the methods to automatically retrieve the graph opsahl-powergrid.
The graph is automatically retrieved from the NetworkRepository repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime:... |
from ctypes import c_char_p, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
double_output, int_output, srs_output, string_output, void_output)
## Shortcut generation for routines with known parame... |
import numpy as np
import scipy.special
import os
import math
import logging
import pandas as pd
import warnings
import time
import json
import pickle
import functools
import tqdm
from typing import Tuple
from autogluon.core.scheduler.scheduler_factory import scheduler_factory
from autogluon.core.utils import set_logg... |
import pymysql
import time
import os
import socket
import threading
from time import sleep
from copy import deepcopy
from contextlib import closing
from json import loads
from queue import Queue
from datetime import datetime
from binascii import hexlify
from src.retranslators import Wialon, EGTS, WialonIPS, GalileoSk... |
import sys, py
from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC
class Test__ffi(BaseTestPyPyC):
def test__ffi_call(self):
from rpython.rlib.test.test_clibffi import get_libm_name
def main(libm_name):
try:
from _rawffi.alt import CDLL, types
... |
#!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/aghast/blob/master/LICENSE
import sys
import unittest
import numpy
from aghast import *
class Test(unittest.TestCase):
def runTest(self):
pass
def test_getitem_twodim(self):
a = Histogram(
[Axis(In... |
from datetime import datetime
from django.db import models
from django.utils.translation import ugettext as _
from dimagi.utils.couch import CriticalSection
from dimagi.utils.parsing import ISO_DATE_FORMAT
from corehq.apps.case_importer import exceptions
PROPERTY_TYPE_CHOICES = (
('date', _('Date')),
('pla... |
import os
import tweepy
from pprint import pprint as pp
consumer_key = os.environ['TWITTER_CONSUMER_KEY']
consumer_secret = os.environ['TWITTER_CONSUMER_SECRET']
access_token = os.environ['TWITTER_ACCESS_TOKEN']
access_token_secret = os.environ['TWITTER_ACCESS_SECRET']
auth = tweepy.OAuthHandler(consumer_key, consum... |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~... |
from pathlib import Path
import halfling
build_options = halfling.builders.CxxBuildOptions(
executable_name="compile_error.out",
compiler="clang++",
build_dir=Path(__file__).parent / "build",
sources=["main.cpp"],
)
halfling.shortcuts.add_build_and_clean_tasks(halfling.builders.CxxBuilder(build_optio... |
# -*- coding: UTF-8 -*-
import sys
import platform
if platform.python_version() < '2.7':
import unittest2 as unittest
else:
import unittest
from os.path import dirname
import keypress_mock as kp
if __name__ == '__main__':
here = dirname(__file__)
sys.path.insert(0, here + '/..')
# keypress mock
... |
import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="name",
parent_name="treemap.marker.colorbar.tickformatstop",
**kwargs
):
super(NameValidator, self).__init__(
plotly_name=... |
# Generated by Django 2.2.4 on 2019-08-20 14:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sendmail', '0003_auto_20190820_1420'),
]
operations = [
migrations.AlterField(
model_name='email',
name='reply_to',
... |
import random
import socket
import sys
import crypto
class Client:
def __init__(self, name: str):
self.name = name
def register(self):
sock = socket.socket()
sock.connect(('localhost', 8081))
n = int.from_bytes(sock.recv(16), sys.byteorder)
sock.send('register'.encode... |
import unittest
import struct
import sys
import os
import pywintypes
import win32event, win32api
import os
from pywin32_testutil import TestSkipped
import win32com.directsound.directsound as ds
import pythoncom
# next two lines are for for debugging:
# import win32com
# import directsound as ds
WAV_FORMAT_PCM = 1
WAV... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.