text stringlengths 2 999k |
|---|
import os
from pathlib import Path
import tempfile
import subprocess
import idaapi
import copy
from externals import get_external
from .brick_utils import temp_env, temp_patch, set_directory, execfile
from contextlib import contextmanager
import sqlite3
DIAPHORA_DIR = get_external('diaphora')
def _export_this_idb(exp... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe import _
from frappe.desk.form.document_follow import follow_document
from frappe.desk.doctype.notification_log.notification_log import enqueue_create_notification,\
get_title, get_title_html
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab
#
# ==================================================================
#
# Copyright (c) 2005-2014 Parallels Software International, Inc.
# Released under the terms of MIT license (see LICENSE for details)
#
# ======================================... |
"""Avoid passing data down long trees as props by using a Context API."""
from viewdom import Context
from viewdom import html
from viewdom import render
from viewdom import use_context
def Todo(label):
"""Render a to do."""
prefix = use_context("prefix")
return html("<li>{prefix}{label}</li>")
def Todo... |
import unittest
from recipe8 import *
class RomanNumeralTest(unittest.TestCase):
def setUp(self):
self.cvt = RomanNumeralConverter()
def test_convert_to_decimal(self):
self.assertEquals(0, self.cvt.convert_to_decimal(""))
self.assertEquals(1, self.cvt.convert_to_decimal("I"))
s... |
#
# 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... |
# -*- coding:utf8 -*-
try:
import simplejson as json
except ImportError:
import json
import uuid
from datetime import date, datetime
from decimal import Decimal
from .exceptions import SerializationError
from .compat import string_types
__all__ = ["JSONSerializer"]
class JSONSerializer(object):
def def... |
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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... |
'''
BLINC Adaptive Prosthetics Toolkit
- Bionic Limbs for Improved Natural Control, blinclab.ca
anna.koop@gmail.com
A toolkit for running machine learning experiments on prosthetic limb data
This module file environments
# TODO: expand to handle ros environments
'''
import os
import pandas as pd
import numpy.random a... |
# Definition for a binary tree node
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# @param root : root node of tree
# @param k : integer
# @return an integer
def __init__(self):
self.count = 0
def recurs... |
import unittest
from linty_fresh.linters import passthrough
from linty_fresh.problem import Problem
class PassthroughTest(unittest.TestCase):
def test_empty_parse(self):
self.assertEqual(set(), passthrough.parse(''))
def test_parse_errors(self):
test_string = [
' Something... |
import datetime
import json as jsonlib
import logging
import re
import urlparse
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static as django_static
from django.core.urlresolvers import reverse as django_reverse
from django.http import QueryDict
from django.template.... |
"""
@package mi.instrument.uw.hpies.ooicore.driver
@file marine-integrations/mi/instrument/uw/hpies/ooicore/driver.py
@author Dan Mergens
@brief Driver for the ooicore
Release notes:
initial_rev
"""
__author__ = 'Dan Mergens'
__license__ = 'Apache 2.0'
import time
import re
import tempfile
from mi.core.exceptions i... |
'''
## Train ##
# Code to train Deep Q Network on gym-sokoban environment
@author: Kolin Guo
'''
from datetime import datetime
import json, os, sys, argparse, logging, random, time, shutil
import gym, gym_sokoban
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from utils.experience_replay i... |
# coding: utf-8
"""Provides a place for functions/modules which have been reogranized in the
python 2/3 switch use in this library to be located regardless of their
location in the running Python's standard library."""
__all__ = ['cookielib', 'urllib2', 'HTTPError', 'URLError', 'urlsplit',
'urljoin', ... |
a = 0
b = 0
c = 0 |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
# Copyright (c) 2018,2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Provide accessors to enhance interoperability between xarray and MetPy.
MetPy relies upon the `CF Conventions <http://cfconventions.org/>`_. to provide helpful
attributes an... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
from datetime import datetime
import urlparse
import urllib2
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
... |
#!/usr/bin/env python
# Copyright 2019 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 or a... |
"""Decoder modules that help interfacing model states with output data.
All decoder modules generate a function that given an specific model state
return the observable data of the same structure as provided to the Encoder.
Decoders can be either fixed functions, decorators, or learned modules.
"""
from typing import... |
# Copyright 2019-2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... |
"""
"""
#
# Set all run arguments
#
BACKEND_NAME = 'aer_simulator'
N_QUBITS = 8
DEPTH = 10
TYPE_CIRCUIT = 3
TYPE_DATASET = 5
N_REPEAT = 100
APPLY_STRATIFY = True
RESCALE_FACTOR = 1.
N_PCA_FEATURES = 0
N_BOOTSTRAPS = 0
CIRCUIT_RANDOM_SEED = None
DATA_RANDOM_SEED = None
CROSSFID_RANDOM_SEED = 53
CIRCUIT_INITIAL_ANGLES ... |
# 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.
{
'targets': [
{
'target_name': 'json_schema_compiler_tests',
'type': 'static_library',
'variables': {
'chromium_code': 1... |
from .initializer import initialize_processors
from .registry import register
__all__ = ['register']
|
# -*- coding: utf-8 -*-
"""An-Automated-Traditional-Chinese-Dialogue-Generating-System Main file"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from builtins import range
import argparse
import time
import os
import sys
import random
import math
import j... |
# -*- coding: utf-8 -*-
"""Each process has an environment block (which may be empty). It
consists of a set of key-value pairs, each of which is a string.
The value string may be formed partly or wholly from other environment
variables using the %envvar% notation. By default, this module will
reinterpret those embedded... |
__author__ = 'NoNotCar'
import pygame, sys
pygame.init()
screen = pygame.display.set_mode((640, 704))
import World
import Tiles
import Img
clock = pygame.time.Clock()
selmenu=0
selobjs=[0 for _ in Tiles.tilemenus+Tiles.objmenus]
w=World.World(True)
expimg=Img.img2("Exp")
pexpimg=Img.img2("ExpPen")
bombimg=Img.img2("Bo... |
# Copyright Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" fil... |
#!/usr/bin/python3
import sqlite3
import time
import praw
import prawcore
import requests
import os
import datetime
import Config
import logging
import re
import dateparser
import yaml
os.environ['TZ'] = 'UTC'
from bs4 import BeautifulSoup
reddit = praw.Reddit(client_id=Config.cid,
client_secret... |
# Copyright (C) 2012-2013 Andy Balaam and The Pepper Developers
# Released under the MIT License. See the file COPYING.txt for details.
from libpepper.values import PepValue
class PepTuple( PepValue ):
def __init__( self, items ):
PepValue.__init__( self )
self.items = items
def construction... |
# import os
# import boto3
# import json
# import sys
# import time
#
# AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
# AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY")
# region_name = "us-west-1"
#
#
# class VideoDetect:
# """Analyze videos using Rekognition Video API."""
#
# rek = boto3.client(... |
import logging
import sys
import traceback
from functools import (
partial,
)
from pathlib import (
Path,
)
import jinete as jit
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def main():
logger.info("Starting...")
file_path = Path(sys.argv[1])
solver = jit.Solver(
... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v6/common/user_lists.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection ... |
# Copyright (c) 2017 Mark D. Hill and David A. Wood
# 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 conditio... |
import math
a=eval(raw_input("enter an inteager:>>"))
c=0
for i in range(4):
b=a%10
a=a/10
c=c+b*(math.pow(10,3-i))
print(c)
|
""" Connected Component Consolidation """
import numpy as np
from .. import continuation
from ... import utils
from ... import colnames as cn
def pair_continuation_files(contin_files):
pairs = dict()
for contin_file in contin_files:
if contin_file.face.hi_index:
hash_input = (*contin_... |
import os
def create_project_folder(dir): # Create seperate folder for each website
if not os.path.exists(dir):
print('Creating directory ' + dir)
os.makedirs(dir)
def create_data_files(folder_name, start_link): # Append to queue and crawled list
queue = os.path.join(folder_nam... |
#!/usr/bin/env python3
import re
import sys
import os
import platform
from setuptools import setup
SRC = os.path.abspath(os.path.dirname(__file__))
def get_version():
with open(os.path.join(SRC, 'instaloader/__init__.py')) as f:
for line in f:
m = re.match("__version__ = '(.*)'", line)
... |
# Copyright 2016 Coursera
#
# 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, sof... |
import asyncio
from types import TracebackType
from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union
import asyncpg
from buildpg import BuildError, render
ValuesType = Union[Dict[str, Any], List[Any], None]
class UndefinedParameterError(Exception):
pass
class Transaction:
def __init__... |
"""
inclusive-or-expression:
exclusive-or-expression
inclusive-or-expression | exclusive-or-expression
"""
import glrp
from ....parser import cxx98
from be_typing import TYPE_CHECKING
@glrp.rule('inclusive-or-expression : exclusive-or-expression')
@glrp.rule('inclusive-or-expression : inclusive-or-expression... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... |
#
# Copyright (c) 2015 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
# Copyright (c) 2015, Imperial College London
# All rights reserved.
#
# 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 o... |
from base import BaseTest
import os
import shutil
import subprocess
class Test(BaseTest):
def test_base(self):
"""
Basic test with exiting Mockbeat normally
"""
self.render_config_template(
)
proc = self.start_beat()
self.wait_until(lambda: self.log_contai... |
import pynbody
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
import readcol
import astropy.units as u
import pylab
import itertools as it
from itertools import tee
import warnings
import decimal
import statistics
import numpy.core.defchararray as npd
resultdataset = npd.equal(... |
# -*- coding=utf-8 -*-
# Copyright © Mhank BarBar (Muhamad Royyani)
# Recode ? Silahkan
# Tolong Kembangkan Lagi Tools Ini, Meskipun Unfaedah:v
# Maaf Kalo Ada Yang Error Wkwk
# Tools Ini Di Cari² Para Recoder
# Banyak Yang Memperjual Belikan Tools Seperti Ini
# Tapi Disini Free Dan Juga Open Source :)
# ------------* ... |
######################################################################
# 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 app... |
print(
'-----------------------------------------\n'\
'Practical python education || Exercise-15:\n'\
'-----------------------------------------\n'
)
print(
'Task:\n'\
'-----------------------------------------\n'\
'Write a Python program to get the the volume of a sphere with radius 6."\n'
)
print(
... |
#!/usr/bin/env python
import argparse
import sys
import os
import json
from collections import defaultdict
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa
sys.path.insert(0, pkg_root) # noqa
"""A script to add/subtract auth from the data-store's swagger file."""
default_auth = {"/f... |
'''An example of functional test.
Note that the declarations
`
MASTER = MasterAccount()
HOST = Account()
ALICE = Account()
BOB = Account()
CAROL = Account()
`
are abundant: they are in place to satisfy the linter, whu complains about
dynamically created objects.
'''
import unittest
from e... |
import sys
sys.path.insert(0, '/home/rhou/caffe/python')
import caffe
import numpy as np
from os import mkdir
from os.path import exists, join
import cv2
import matplotlib.pyplot as plt
class DataLayer():
def __init__(self, net, model):
self._batch_size = 1
self._depth = 8
self._height = 240
self._wi... |
"""Testing methods that need Handle server read access"""
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import requests
import json
import mock
import b2handle
from b2handle.handleclient import EUDATHandleClient
from b2handle.handleexceptions import *
# Load some... |
# Copyright © 2019 Province of British Columbia
#
# 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... |
#!/usr/bin/python
import os
import sys
import getopt
import signal
import logging
from DICOMHandler import DICOMListener
from logsetting import getHandler
# create logger
logger = logging.getLogger('serverWrapper')
logger.setLevel(logging.INFO)
#########################################################
#
"""
Wrapper... |
import time
import logging
from collections import OrderedDict
from pyinstrument import Profiler
from django.http import HttpResponse, HttpRequest
LOG = logging.getLogger(__name__)
_PROFILER_RECORDS = OrderedDict()
class RssantProfilerMiddleware:
def __init__(self, get_response):
self.get_response = g... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import signal
from sppm import settings
from sppm.cmd_action import action_shutdown
from sppm.process_status_lock import ProcessStatusLock
from sppm.settings import hlog, SPPM_CONFIG
# noinspection PyUnusedLocal
def sigint_handler(sig, frame):
hlog.debug('收到 Ctrl+... |
from .import_vtf import load_texture, texture_from_data
from ...content_providers.content_manager import ContentManager
from ...utilities.thirdparty.equilib.cube2equi_numpy import run as convert_to_eq
from ..vmt.valve_material import VMT
import numpy as np
def pad_to(im: np.ndarray, s_size: int):
new = np.zeros((... |
from common import BaseTestCase
from struct import pack
from binascii import unhexlify
from mtpdevice.mtp_proto import ContainerTypes, ResponseCodes
from mtpdevice.mtp_exception import MtpProtocolException
from mtpdevice.mtp_msg import msg_from_buff
class CommandMessageTest(BaseTestCase):
def buildVanillabuffer(... |
class Come_on_over:
def __init__(self, come, on, over):
print come, on, over
come = 'come'
on = 'on'
over = 'over'
a = Come_on_over(come, on, over)
|
#!/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.
"""Verify that starting mudracoin with -h works as expected."""
from test_framework.test_framework import Bitc... |
# -*- coding: utf-8 -*-
"""
This module contains form fields to work with.
"""
from django import forms
from django.core.exceptions import ValidationError, FieldError
from django.utils.translation import gettext_lazy as _
# Feel free to extend this, see
# http://www.iana.org/assignments/media-types/media-types.xhtml... |
# -*- coding: utf-8 -*-
import sys
import numpy as np
from numpy import exp
from scipy.special import erf
from math import factorial as fact
from math import pi, sqrt
def Hermite(m,x):
if m < 0:
value = 0
elif m == 0:
value = 1
elif m == 1:
value = 2*x
else:
i = 1
... |
'''
download_data.py
Adapted from https://github.com/paarthneekhara/text-to-image
'''
import os
import sys
import errno
import tarfile
if sys.version_info >= (3,):
from urllib.request import urlretrieve
else:
from urllib import urlretrieve
DATA_DIR = 'Data'
# http://stackoverflow.com/questions/273192/how-t... |
from fastapi import HTTPException, status
from fastapi.security import HTTPBearer
from jose import jwt
from jose.exceptions import ExpiredSignatureError, JWTError
from settings import Settings
settings = Settings()
class CredentialException(HTTPException):
def __init__(
self,
status_code: int =... |
import logging
from pyzabbix import ZabbixAPI
from monitor_provider.credentials.zabbix import (
CredentialZabbix, CredentialAddZabbix
)
from monitor_provider.providers.base import ProviderBase
from monitor_provider.settings import LOGGING_LEVEL
logging.basicConfig(
level=LOGGING_LEVEL,
format='%(a... |
"""
type-requirement:
typename nested-name-specifier? type-name ;
"""
import glrp
from .....parser import cxx20
from motor_typing import TYPE_CHECKING
@glrp.rule('type-requirement : type-name ";"')
# TODO: template not allowed
@glrp.rule('type-requirement : nested-name-specifier template? type-name ";"')
@cxx20
... |
# Generated by Django 2.0.10 on 2019-01-25 21:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classy', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='classification',
name='notes',
... |
# Copyright (c) 2020 NVIDIA CORPORATION.
# Copyright (c) 2018-2020 Chris Choy (chrischoy@ai.stanford.edu).
#
# 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 wit... |
from typing import Dict, Iterable, Sequence, Tuple, NamedTuple, Union, Any
class Stat(NamedTuple):
st_dev: int = None
st_ino: int = None
st_nlink: int = None
st_mode: int = None
st_uid: int = None
st_gid: int = None
st_rdev: int = None
st_size: int = None
st_blksize: int = None
... |
import altair as alt
import pandas as pd
tuples = []
with open(snakemake.input[0], "r") as infile:
sample = "???"
for l in infile.read().splitlines():
split = l.split("\t")
if len(split) > 1:
if len(split) == 7:
tuples.append(
(
... |
from django.contrib import admin
from .models import Offer
@admin.register(Offer)
class OfferAdmin(admin.ModelAdmin):
pass
|
from flask import Flask
app = Flask(__name__)
# Setup the app with the config.py file
app.config.from_object('app.config')
# Setup the logger
from app.logger_setup import logger
# Setup the database
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy(app)
# Setup the mail server
from flask.e... |
# Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
from statsmodels.tsa.holtwinters import ExponentialSmoothing
from Load_And_Visualize_Time_Data import Load_and_Visualize_Time_Data
import sys
import numpy as np
import pandas as pd
from sktime.forecasting.model_selection import temporal_train_test_split
from sklearn.metrics import mean_absolute_error
from sktime.utils.... |
#!/usr/bin/env python
DEBUG = False
if DEBUG:
# This code only exists to help us visually inspect the images.
# It's in an `if DEBUG:` block to illustrate that we don't need it for our code to work.
from PIL import Image
import numpy as np
def read_image(path):
return np.asarray(Image.op... |
from __future__ import print_function, division
import numpy as np
import unittest
"""
Do reddening and de-reddening of optical emission-line fluxes using the
equations in the appendix of Vogt 2013
http://adsabs.harvard.edu/abs/2013ApJ...768..151V
There are 3 public functions; these are to redden and deredden fluxes ... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dmp_project.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. ... |
# 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 ... |
KIND_ASSETS = {
"0.10.0": {
"linux": (
"https://github.com/kubernetes-sigs/kind/releases/download/v0.10.0/kind-linux-amd64",
"74767776488508d847b0bb941212c1cb76ace90d9439f4dee256d8a04f1309c6",
),
"darwin": (
"https://github.com/kubernetes-sigs/kind/release... |
# 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 numpy as np
from openmdao.api import Component
class Inverter(Component):
def __init__(self):
super(Inverter, self).__init__()
self.add_param('efficiency', 1.0, desc='power out / power in')
self.add_param('output_voltage',
120.0,
desc='... |
from pprint import pprint
from cloudmesh.common.console import Console
from cloudmesh.common.util import path_expand
from cloudmesh.shell.command import PluginCommand
from cloudmesh.shell.command import command
import importlib
class RegisterCommand(PluginCommand):
# noinspection PyUnusedLocal
@command
... |
# -*- coding: utf-8 -*-
import sublime
import sublime_plugin
import os
import sys
import json
import functools
import webbrowser
import tempfile
import traceback
import threading
import shutil
PY3 = sys.version > '3'
if PY3:
from .request import *
from .settings import *
from .helpers import *
from .... |
import os, sys
import pytest
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../src')
from key_file import KeyFile
class TestKeyFile:
def file_path(self):
return os.path.join(os.getcwd(), 'test', 'fixtures', 'example.key')
def test_read_key_file(self):
with ... |
from django.shortcuts import render
from django.http import HttpRequest, HttpResponse, JsonResponse
from .models import Station,Data,MeanDay,Intensity, MeanWeek, MeanYear
from datetime import timedelta, date, datetime
# Create your views here.
def dynamic_lookup_view(request: HttpRequest, my_id) -> HttpResponse:
... |
import tarfile
from fastai import *
from fastai.vision import *
from fastai.text import *
__all__ = ['DATA_PATH', 'MNIST_PATH', 'IMDB_PATH', 'ADULT_PATH', 'ML_PATH', 'DOGS_PATH', 'PLANET_PATH',
'untar_data', 'get_adult', 'get_mnist', 'get_imdb', 'get_movie_lens', 'download_wt103_model']
URL = 'http://files... |
config = {
"interfaces": {
"google.ads.googleads.v1.services.AdGroupAdService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": []
},
"retry_params": {
"default": {
... |
import json
import os
config = {}
settings_file_wd = os.path.join(os.getcwd(), ".cdash-client.json")
home_directory = os.path.expanduser("~")
settings_file_home = os.path.join(home_directory, ".cdash-client.json")
settings_file = ""
# First of all, we look for our settings file inside the user's home folder.
# This ... |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.sites.shortcuts import get_current_site
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import (HttpResponseRedirect, HttpResponsePermanentRedirect,
... |
# Uses python3
import sys
def get_change(m):
minNumCoins = [0] * (m + 1)
for i in range(1, m + 1):
minNumCoins[i] = float('inf')
for j in [1, 3, 4]:
if i >= j:
NumCoins = minNumCoins[i - j] + 1
if NumCoins < minNumCoins[i]:
minNum... |
import click
from virl.api import VIRLServer
from subprocess import call
from virl import helpers
from virl.helpers import get_mgmt_lxc_ip, get_node_from_roster
@click.command()
@click.argument('node', nargs=-1)
def ssh(node):
"""
ssh to a node
"""
if len(node) == 2:
# we received env and node... |
# -*- coding: utf-8 -*-
import argparse
import torch
from tqdm import tqdm
from models.embedding import ProtoNetEmbedding
from protoNet.prototy_head import ClassificationHead
from utilities import set_gpu, count_accuracy, log, setup_seed
import numpy as np
import os
from dataloaders.tieredImageNet impo... |
import pandas as pd
from sklearn.model_selection import RandomizedSearchCV
from sklearn.ensemble import RandomForestRegressor
import warnings
warnings.filterwarnings("ignore")
if __name__ == "__main__":
dataset = pd.read_csv("./datasets/felicidad.csv")
# La razón de eliminar el rank y el score,
... |
#!/usr/bin/env python3
##############################################################################
# EVOLIFE http://evolife.telecom-paris.fr Jean-Louis Dessalles #
# Telecom Paris 2021 www.dessalles.fr #
# ----------------------------------------------------------... |
from itertools import permutations
from functools import reduce
def swap(a, b):
return (b, a)
def build_chain(chain, domino):
if chain is not None:
last = chain[-1]
if len(chain) == 1 and last[0] == domino[0]:
return [swap(*last), domino]
elif len(chain) == 1 and last[0] ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.