text stringlengths 2 999k |
|---|
from function_defs import *
from pickle import dump, load
from os.path import exists
from tkinter.simpledialog import messagebox
import tkinter
try:
from decoder import PyDecoder
decoder = PyDecoder()
except:
decoder = None
decoder_fitted = False
OPCODE = 'OPCODE' # For identifying ins... |
import os
import re
import numpy as np
from six.moves import cPickle
import time
import opts
# -----------------------------------------------------------------
# Borrowed this function from NeuralTalk:
# https://github.com/karpathy/neuraltalk/blob/master/driver.py#L16
# ----------------------------------------------... |
from tkinter import *
import sys
import os.path
import math
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from search import *
from search import breadth_first_tree_search as bfts, depth_first_tree_search as dfts, \
depth_first_graph_search as dfgs, breadth_first_search as bfs, uniform_cost_search ... |
from typing import Optional, Literal
from pydantic import BaseModel, Field
class Recipe(BaseModel):
ID: int = Field(..., title="Recipe ID")
carbonSource: Literal["CH4", "C2H4", "C2H2", "C6H6"] = Field(..., title="Carbon Source",
description='''
- choices: ["CH4", "C2H4", "C2H2", "C6H6"]
''',
max... |
from django.apps import AppConfig
class FamilyrosterConfig(AppConfig):
name = 'familysite_linux.familyroster'
|
import tensorflow as tf
print(tf.__version__)
import os
from . import converter
DEBUG_OUTPUT = False
def model_id_to_ord(model_id):
if 0 <= model_id < 4:
return model_id # id is already ordinal
elif model_id == 50:
return 0
elif model_id == 75:
return 1
elif model_id == 100... |
# Copyright 2017 The TensorFlow 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 applica... |
import random
from django.test import TestCase
from .. import models
class CachedResourceTest(TestCase):
def setUp(self):
# A base query set which returns all non-deletes cached videos
self.videos = models.CachedResource.videos
# A base query set which returns all non-deletes cached chan... |
#!/usr/local/bin/env python3
import collections
from settings import personal_settings
AUTOMATION_PROJECT_PATH = '/home/pi/Programming/Automation/' # end with '/'
TEMPCONTROLLER_MEASUREMENTS_PATH = AUTOMATION_PROJECT_PATH + \
'measurements/temperature_controller/'
AUTOMATION_EXECUTABLES_PATH = AUTOMATION_PROJECT... |
# Generated by Django 3.0.4 on 2020-09-22 04:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
('carts', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
import unittest
from singer_encodings import csv
class TestRestKey(unittest.TestCase):
csv_data = [b"columnA,columnB,columnC", b"1,2,3,4"]
def test(self):
row_iterator = csv.get_row_iterator(self.csv_data)
rows = [r for r in row_iterator]
self.assertEqual(rows[0]['_sdc_extra'], ['4'])... |
from pypuppetdb.types import (Catalog, Edge, Event, Fact, Inventory, Node, Report, Resource)
from pypuppetdb.utils import json_to_datetime
class TestNode(object):
"""Test the Node object."""
def test_without_status(self):
node = Node('_', 'node',
report_timestamp='2013-08-01T09:57:... |
### Drawing line using Digital Differential Analyzer Line Drawing Algorithm in Computer Graphics.
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
w, h = 25,25
m=0
def ROUND(a):
return int(a + 0.5)
def drawDDA(x1,y1,x2,y2):
x,y = x1,y1
length = abs((x2-x1) if abs(x2-x1) > abs(y2-y... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.com>
# (c) 2018 Genome Research Ltd.
# 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
DOCUMENTATIO... |
# Generated by Django 3.1.2 on 2020-10-12 09:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0006_auto_20201012_0937'),
]
operations = [
migrations.RenameField(
model_name='task',
old_name='result... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
"""
A scratch pad for workflow design
"""
# support
import pyre
# a component
class component(pyre.component, family='pyre.flow.raw'):
"""
A configurational node: raw meta-data
"""... |
"""Unit tests for email service in Superset"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
import logging
import tem... |
"""
Django settings for SSO_2 project.
Generated by 'django-admin startproject' using Django 3.0.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Bui... |
import re
import sys
import requests
import threading
from JShoter.core.args import web_url
from concurrent.futures import ThreadPoolExecutor
from bs4 import BeautifulSoup
from JShoter.core.colors import GRAY, GRAY, RED, RESET, GREEN
html = requests.get(web_url).content
soup = BeautifulSoup(html, "html.parser")
js_fi... |
# Class definition:
# AMSTaiwanExperiment
# This class is the AMSTaiwan experiment class inheriting from Experiment
# Instances are generated with ExperimentFactory via pUtil::getExperiment()
# Implemented as a singleton class
# http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern
# Impo... |
import wx
from wx.dataview import DataViewListCtrl
class WeekOverview(wx.Panel):
def __init__(self, parent):
super().__init__(parent)
self.dayrow = ['Montag', '', '', '']
self.data = ['Creadis', 'HOURS', '9.5h', 'Viel Arbeit']
self._init_controls()
self._init_sizers... |
# Copyright 2021 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
import pathlib
import setuptools
__version__ = "0.2.dev1"
setuptools.setup(
name="quickstart-vdk",
version=__version__,
url="https://github.com/vmware/versatile-data-kit",
description="Versatile Data Kit SDK packaging containing com... |
# Copyright (c) 2021 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... |
# Import ini
from model import *
from update import updateRun
""""
TODO
"""
def main():
gameName = "Magic Towers"
screen.fill((255, 255, 255))
pygame.display.set_caption(gameName)
# Text
font = pygame.font.SysFont("impact", 24)
font2 = pygame.font.SysFont("impact", 36)
fontTitle = pyg... |
import serial, time
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft, ifft, fftshift
Fs = 6250 # Hz
Ts = 1/Fs
NFFT = 4*1024
OFFSET = int(0.1*NFFT)
# Time vector
t = np.linspace(0, NFFT-1, NFFT)*Ts
# Frequency vector
f = np.linspace(0, int(NFFT/2)-1, int(NFFT/2))*Fs/NFFT
#ser=seria... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stagifyapi.settings")
try:
from django.core.management import execute_from_command_line
except I... |
# qubit number=4
# total number=30
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... |
import logging
from datetime import date
from django.test import TestCase
from django.utils import timezone
from django_dynamic_fixture import G
from apps.authentication.models import OnlineUser as User
from apps.marks.models import Mark, MarkUser, _get_with_duration_and_vacation
class MarksTest(TestCase):
def... |
# -*- coding: utf-8 -*-
import os
import pytest
import nipype.workflows.fmri.fsl as fsl_wf
import nipype.interfaces.fsl as fsl
import nipype.interfaces.utility as util
from nipype.interfaces.fsl import no_fsl, no_fsl_course_data
import nipype.pipeline.engine as pe
import warnings
import tempfile
import shutil
from ni... |
import pydantic
from fhirzeug.generators.python_pydantic.templates.resource_header import (
camelcase_alias_generator,
)
def test_special_names():
assert camelcase_alias_generator("class_") == "class"
def test_camel_case():
assert camelcase_alias_generator("this_is_a_test") == "thisIsATest"
def test_c... |
def _sorted_keys(container, keys, reverse):
''' return list of 'keys' sorted by corresponding values in 'container' '''
aux = [ (container[k], k) for k in keys ]
aux.sort()
if reverse: aux.reverse()
return [k for v, k in aux]
|
from django.contrib.syndication.views import Feed
from blogg.models import Post
class LatestPosts(Feed):
title = "Blog"
link = "/rss/"
description = "Latest Posts"
def items(self):
return Post.objects.published()[:5]
def item_title(self, item):
return item.title
def item_des... |
#!/usr/bin/env python
import os
import logging
import subprocess
import json
import rule_utils
from terrautils.sensors import Sensors
from terrautils.metadata import get_terraref_metadata
from pyclowder.datasets import download_metadata
# setup logging for the exctractor
logging.getLogger('pyclowder').setLevel(logg... |
r"""
.. module:: scipy.optimize.nonlin
=================
Nonlinear solvers
=================
.. currentmodule:: scipy.optimize
This is a collection of general-purpose nonlinear multidimensional
solvers. These solvers find *x* for which *F(x) = 0*. Both *x*
and *F* can be multidimensional.
Routines
========
Large-... |
from src.utils.get_data import load_data
from src.utils.get_data import get_datasets
from src.utils.get_data import concatenate_datasets
from src.utils.get_data import split_data
from src.classifiers.decision_tree_classifier import setup_decision_tree_classifier
from src.classifiers.decision_tree_classifier import pred... |
from scapy.all import *
class TestPkt2(Packet):
name="TestPkt2"
fields_desc = [ IntField("pkt_id",101),
IPField("next_hop","0.0.0.0") ]
def extract_padding(self, p):
return "", p
class TestSLF(Packet):
fields_desc=[ FieldLenField("len", None, length_of="data"),
StrLenField("data", "", length_from=lambd... |
from collections import Mapping, Hashable
from itertools import chain
import six
from pyrsistent._pvector import pvector
from pyrsistent._transformations import transform
class PMap(object):
"""
Persistent map/dict. Tries to follow the same naming conventions as the built in dict where feasible.
Do not i... |
from django.db.models.signals import post_migrate
from django.dispatch import receiver
from mantistablex.models import Tables
from mantistablex.process.utils.assets.assets import Assets
from mantistablex.process.utils.assets import importer
@receiver(post_migrate)
def on_init_db(**kwargs):
filenames = Assets().l... |
mem1 = {}
mem2 = {}
mask_or = 0
mask_and = -1
posx = []
with open('input14.txt') as f:
for line in f:
if line[1] == 'a':
mask = line[7:-1]
mask_or = int(mask.replace('X', '0'), 2) # or-mask (set bits where mask=1)
# Part 1
mask_and = int(mask.replace('X', '1'), 2) # and-mask (unset bits where mask=0... |
import textwrap
import pytest
from conftest import needs_latexmk
from conftest import skip_on_github_actions_with_win
from pytask import main
@needs_latexmk
@skip_on_github_actions_with_win
@pytest.mark.end_to_end
def test_infer_dependencies_from_task(tmp_path):
task_source = """
import pytask
@pytask.m... |
import numpy as np
import torch
import torch.nn as nn
import random
import torch.distributions as D
class GenerativeFlow(nn.Module):
"""
Generative flow base class
For models performing density estimation and matching
"""
def __init__(self, args):
super(GenerativeFlow, self).__init__()
... |
__author__ = 'leif'
from django.conf.urls import patterns, url
import views
urlpatterns = patterns('',
url(r'^$', views.leaderboards, name='leaderboards'),
) |
import functools
import inspect
import typing
from .users import _NOT_A_REQUEST
from .. import helpers, utils
from ..tl import functions, TLRequest
if typing.TYPE_CHECKING:
from .telegramclient import TelegramClient
# TODO Make use of :tl:`InvokeWithMessagesRange` somehow
# For that, we need to use :tl:`Ge... |
# --------------------------------------------------------------------------
# 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 cause incor... |
# -*- coding: utf-8 -*-
"""
@brief: Extract judicial acts from `bsr.sudrf.ru` (update database)
@package: judicial
@file: update.py
@author: dmryutov (dmryutov@gmail.com)
@version: 1.0
@date: 03.11.2017 -- 04.11.2017
"""
import re
import sqlite3
from selenium import webdriver
from selenium.common.exceptions i... |
from enum import Enum
class State(Enum):
GAME_BEGIN = 1 #Initialising Game, distribute money and stuff
TURN_BEGIN = 2 #Turn of a player/bot begins
TURN_END = 3 #End a player's turn, and ask everyone if they wanna build houses somewhere
GAME_END = 4 #End the game if anyone person has been bankrupt... |
from sys import argv
from os.path import exists
script, from_file, to_file = argv
print "Copying from %s to %s" % (from_file, to_file)
#we could do these two on one line too, how?
in_file = open(from_file)
indata = in_file.read()
print "The input file is %d bytes long" % len(indata)
print "Does the output file exi... |
# Copyright 2018 The TensorFlow 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... |
import sys
sys.path.append("../")
import gym
import time
import torch
import random
import unittest
import rl_models
import numpy as np
from rl_models.models.AtariCNN import AtariCNN
from rl_models.agents.DQNAgent import DQNAgent
from rl_models.common.utils.RingBuffer import RingBuffer
from rl_models.common.wrappers.A... |
# coding: utf-8
# In[1]:
from keras import applications
from keras.models import Sequential
from keras.models import Model
from keras.layers import Dropout, Flatten, Dense, Activation
from keras.callbacks import CSVLogger
import tensorflow as tf
from scipy.ndimage import imread
import numpy as np
import random
fro... |
import json
import os
from ..readabilipy import simple_json_from_html_string
from ..readabilipy.simplifiers import strip_html_whitespace
from ..readabilipy.simple_json import extract_text_blocks_as_plain_text
def get_normalised_html_output(test_fragment, expected_output=None):
"""Get normalised HTML output."""
... |
#!/usr/bin/env python3
from configparser import ConfigParser
import yaml # needs the `pyyaml` package
import sys
def main():
if len(sys.argv) < 2:
print("Usage: {} <input-rc> [output-rc.yaml]".format(sys.argv[0]))
sys.exit(1)
old_config = ConfigParser()
old_config.read(sys.argv[1])
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2006-2010, 2012-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2008 pyves@crater.logilab.fr <pyves@crater.logilab.fr>
# Copyright (c) 2010 Julien Jehannet <julien.jehannet@logilab.fr>
# Copyright (c) 2013 Google, Inc.
# Copyright (c) 2013 John McGehee <jmc... |
"""Visitors for Struct ASTs. Analogous to the visitors in the
standard library 'ast' module, with some enhancements.
"""
__all__ = [
'NodeVisitor',
'AdvNodeVisitor',
'NodeTransformer',
'AdvNodeTransformer',
'ChangeCounter',
]
from .node import AST
class NodeVisitor:
"""Walk a tree, di... |
import pickle
import sys, os
import torch
from config import run_config, train_config, data_config, model_config
from util.logging import Logger
from util.data.load_data import load_data
from lib.models import load_model
from util.eval import eval_model
def start_evaluating(run_config, train_config, data_config, model... |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from std_msgs.msg import Int32
from styx_msgs.msg import Lane, Waypoint
from scipy.spatial import KDTree
import numpy as np
import math
'''
This node will publish waypoints from the car's current position to some `x` distance ahead.
As menti... |
#!/usr/bin/env python3
from requests import exceptions
import ethercalc
import json
import logging
import pprint
import datetime
import time
import random
import os
import babel.dates
from foodsoft import FSConnector
import export
import sys
from mail_logger import get_mail_logger
pp = pprint.PrettyPrinter(indent=4)
... |
"""
This file includes the global configurations
"""
"""
Logging:
- Configurations for different logs
- Formatting
"""
# formatting in case of info
INFO_FORMAT = '%(asctime)s -%(levelname)s'
# formatting for debugging
DEBUG_FORMAT = "[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s"
"""
Data Struc... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Dependency imports
import numpy as np
import six
import tensorflow.compat.v1 as tf1
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.bijectors import affine_scalar
from tensorflow_probabi... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import GCNConv, GATConv
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.nn.inits import glorot
from torch_geometric.utils import softmax
class HGTConv(MessagePassing):
def __init__(self,... |
"""Support VM lifecycle operation in an OpenStack Cloud."""
import socket
from datetime import datetime, timedelta
from time import sleep
from typing import List, Optional, Union
from uuid import UUID
from libcloud.compute.base import Node, NodeDriver, NodeImage, NodeSize
from libcloud.compute.drivers.openstack import... |
"""
created by: Donghyeon Won
"""
import os
import numpy as np
import pandas as pd
from PIL import Image
from torch.utils.data import Dataset
import torch.nn as nn
import torchvision.transforms as transforms
import torchvision.models as models
import torch
import argparse
class ProtestDataset(Datas... |
# -*- Python -*-
# Return the options to use for a C++ library or binary build.
# Uses the ":optmode" config_setting to pick the options.
load(
"//tensorflow/core:platform/default/build_config_root.bzl",
"if_dynamic_kernels",
"if_static",
"tf_additional_grpc_deps_py",
"tf_additional_xla_deps_py",
... |
# Copyright 2016 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 ag... |
# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2018
import unittest
from streamsx.topology.topology import *
from streamsx.topology.tester import Tester
import streamsx.spl.op as op
import streamsx.spl.toolkit
import spl_tests_utils as stu
class TestRemote(unittest.TestCase):
""" Tes... |
# Start the game
# included in pythonista
from scene import *
from ui import *
# python std
from pathlib import Path
from random import randint, seed
# project modules
from lib.game import Game
from lib.interface import Interface
HERE_FP = Path(__file__).parent
if __name__ == "__main__":
iface = Interface()
... |
# Copyright (c) BioniDL@SUSTECH. All Rights Reserved
"""
This is a demo to run effcientnet trained on waste sorting dataset on a test image paper.png
Please download the pretrained weights and put it under ./weight folder before run the code
"""
from efficientnet_predictor import efficientnet
import cv2
import numpy a... |
from collections import defaultdict
import graphene
from django.core.exceptions import ValidationError
from django.db import transaction
from django.db.models import Q
from graphene.types import InputObjectType
from ....attribute import AttributeInputType
from ....attribute import models as attribute_models
from ....... |
"""
Django settings for example_project project.
Generated by 'django-admin startproject' using Django 4.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
impo... |
import os
import shutil
import sys
import glob
from pathlib import Path
import pandas as pd
# -----------------
# STEP 0: variables
# -----------------
root_dir = '/exports/fsw/Bendlab/SamenUniek'
raw_sessions = ['MCC_ses01-lab']
bids_sessions = ['ses-w01lab']
file_type = ['3DT1', 'SNAT1', 'SNAT2', 'SNAT3', 'PCG1', '... |
# -*- coding: utf-8 -*-
from tccli.services.cloudhsm.cloudhsm_client import action_caller
|
# 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... |
#!/usr/bin/env python
from __future__ import division
# Import the PCA9685 module.
import Adafruit_PCA9685
# Initialise the PCA9685 using the default address (0x40).
pwm = Adafruit_PCA9685.PCA9685()
# Set the PWM frequency to 60hz.
pwm.set_pwm_freq(60)
mot = 4
fwd = 6
rev = 5
def duty_cycle(channel, cycle):
... |
import numpy as np
from helpers.lib import mygis
from helpers.lib.bunch import Bunch
def vcoord(filename):
"""compute the vertical coordinate in space and time for a given file"""
na=np.newaxis
a = mygis.read_nc(filename,"pressure").data
z = a
return z
|
from builtins import str
from builtins import object
from lib.common import helpers
class Module(object):
def __init__(self, mainMenu, params=[]):
# Metadata info about the module, not modified during runtime
self.info = {
# Name for the module that will appear in module menus
... |
from __future__ import unicode_literals
from datetime import date
from django.test import ignore_warnings, override_settings
from django.utils.deprecation import RemovedInDjango20Warning
from .base import SitemapTestsBase
@override_settings(ROOT_URLCONF='sitemaps_tests.urls.https')
class HTTPSSitemapTests(SitemapT... |
from django.contrib.auth.models import User, Group
from .models import Typhoon, Point, GraphPoint
from rest_framework import serializers
class TyphoonListSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Typhoon
fields = ('num', 'name', 'englishname', 'startat', 'endat', 'yea... |
#Ref: Sreenivas Sarwar Anik
"""
IMAGE CLASSIFICATION USING XGBOOST by extracting features using VGG16 imagenet pretrained weights.
This code explains the process of using XGBoost for image classification
using pretrained weights (VGG16) as feature extractors.
Code last tested on:
Tensorflow: 2.2.0
Keras: 2... |
import requests, json
from unittest import TestCase
from tests.config import *
class TestPCListAPI(TestCase):
"""Test creation of characters and listing all characters"""
URL = CREATE_PC_URL
headers = {"Content-Type": "application/json"}
@classmethod
def setUpClass(cls):
response = reques... |
import uncertainties
import numpy as np
import os
from uncertainties import ufloat
#######
#private functions
#######
def __write_seperator_or_newline(data,texfile,j):
if(j==(len(data)-1)):
texfile.write("\\")
else:
texfile.write("&")
#*********
#Write tables body
#*********
def __writedata(da... |
"""
https://github.github.com/gfm/#emphasis-and-strong-emphasis
"""
import pytest
from .utils import act_and_assert
@pytest.mark.gfm
def test_emphasis_400():
"""
Test case 400: Rule 7: This is not strong emphasis, because the closing delimiter is preceded by whitespace:
"""
# Arrange
source_mar... |
# coding: utf-8
"""
SendinBlue API
SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at h... |
"""empty message
Revision ID: dce3a03d6332
Revises:
Create Date: 2018-11-11 09:42:35.855974
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'dce3a03d6332'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, freedomcoind will dump mempool on shutdown and
then reload it o... |
# pylint: disable=not-callable, no-member, invalid-name, missing-docstring, line-too-long
import math
import os
import subprocess
import argparse
import shutil
import tqdm
import plotly.graph_objs as go
import torch
from e3nn import o3, rsh
def rsh_surface(l, m, scale, tr, rot):
n = 50
a = torch.linspace(0,... |
import math
import numpy as np
import torch
import torch.nn as nn
from dl_lib.layers import ShapeSpec
from dl_lib.structures import Boxes, ImageList, Instances
from .generator import CenterNetDecoder, CenterNetGT
from .loss import modified_focal_loss, reg_l1_loss
class CenterNet(nn.Module):
"""
Implement C... |
"""
AMPAREX Rest API Documentation
This is the description of the AMPAREX Rest API. All REST calls plus the corresponding data model are described in this documentation. Direct calls to the server are possible over this page.<br/>Following steps are needed to use the API:<br/><br/>1. Get the ... |
# only tasks that don't require `extras` should be automatically imported here;
# others must be explicitly imported so they can raise helpful errors if appropriate
from prefect.core.task import Task
import prefect.tasks.core
import prefect.tasks.control_flow
import prefect.tasks.database
import prefect.tasks.docker
i... |
import torch
import torch.nn as nn
class micro():
def __init__(self, rel2idx, ner2idx):
self.rel2idx = rel2idx
self.ner2idx = ner2idx
def get_ner_index(self, tensor):
index = (tensor == 1).nonzero(as_tuple=False)
index_scalar = []
for index_tup in index:
... |
# Generated by Django 2.2.4 on 2019-11-02 04:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('omgwords-agent', '0009_twitchchannel'),
]
operations = [
migrations.AlterModelOptions(
name='match',
options={'verbo... |
#!/usr/bin/env python3
"""Zombies is a Zork-style console game set in the bonnie town of Glasgow."""
import argparse
from game.game import start_game
__author__ = "R. David Dunphy"
__license__ = "MIT"
__version__ = "Zombies v0.01"
__email__ = "rdd.dunphy@gmail.com"
def run():
parser = argparse.ArgumentParser... |
# Enter your code here. Read input from STDIN. Print output to STDOUT
n = int(raw_input())
width = len("{0:b}".format(n))
for i in range(1, n + 1):
print "{0:{width}d} {0:{width}o} {0:{width}X} {0:{width}b}".format(i, width = width) |
# -*- coding: utf-8 -*-
import datetime
import hashlib
import itertools
import json
import operator
import os
import time
import urlparse
import uuid
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.core.urlreso... |
import re
from abc import abstractmethod
from typing import List, Any, Dict
from checkov.cloudformation.checks.resource.base_resource_check import BaseResourceCheck
from checkov.cloudformation.context_parser import ContextParser
from checkov.cloudformation.parser import dict_node
from checkov.common.parsers.node impor... |
import qt
import ctk
import os
import slicer
import logging
from SlicerDevelopmentToolboxUtils.forms.FormsDialog import FormsDialog
from SlicerDevelopmentToolboxUtils.mixins import GeneralModuleMixin
from SlicerDevelopmentToolboxUtils.icons import Icons
class AssessmentWidget(ctk.ctkCollapsibleButton, GeneralModuleM... |
# -*- coding: utf-8 -*-
class SmsTypes:
class Country:
RU = '0' # Россия (Russia)
UA = '1' # Украина (Ukraine)
KZ = '2' # Казахстан (Kazakhstan)
CN = '3' # Китай (China)
PH = '4' # Филиппины (Philippines)
MM = '5' # Мьянма (Myanmar)
ID = '6' # Индонезия (Indonesia)
MY = '7' # Малайзия (Malays... |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 30 16:26:18 2018
Accelerator BPM
@author: xf18id
"""
bpm17_1x = EpicsSignalRO("SR:C17-BI{BPM:1}Pos:X-I", name="bpm17_1x")
bpm17_1y = EpicsSignalRO("SR:C17-BI{BPM:1}Pos:Y-I", name="bpm17_1y")
bpm17_2x = EpicsSignalRO("SR:C17-BI{BPM:2}Pos:X-I", name="bpm17_2x")
bpm17_2y =... |
#!/usr/bin/env python
# coding: utf-8
'''
Author Ayman Al jabri
Reinforce Method:
Is one of the simplist Policy_gradient methods. It uses the same formula:
loss= - sum(Q(s,a) log(pi(s,a))) ----- Where Q(s,a): is the gradient scale.
Q(s,a) = discounted rewards or sum(gamm*... |
# Generated by Django 3.1.3 on 2021-06-05 05:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_len... |
minfo = { "Pulsar_System" :
{
"type" : "core",
"version" : "0.1a",
"description" : "System class for Pulsar",
"authors" : [],
"refs" : [],
"options" : {}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.