text stringlengths 2 999k |
|---|
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
description = 'LakeShore LS340 controller'
group = 'optional'
includes = ['alias_T']
tango_base = 'tango://spodictrl.spodi.frm2.tum.de:10000/spodi/ls340/'
devices = {
'T_%s' % setupname : device('nicos.devices.entangle.TemperatureController',
description = 'The control device of the LS-340',
tan... |
# Text formatting abstractions
# Note -- this module is obsolete, it's too slow anyway
import string
import Para
# A formatter back-end object has one method that is called by the formatter:
# addpara(p), where p is a paragraph object. For example:
# Formatter back-end to do nothing at all with the paragraphs
cl... |
'''
Get Duplicated parameter lists
'''
from collections import Counter
from .extension_base import ExtensionBase
DEFAULT_MIN_PARAM_COUNT = 5
class LizardExtension(ExtensionBase):
FUNCTION_INFO = {
"parameter_list_duplicates": {
"caption": " dup_param_list ",
"average_caption": " ... |
'''
FILE NAME
lab_app.py
Version 4
1. WHAT IT DOES
This version adds date/time input validation.
2. REQUIRES
* Any Raspberry Pi
3. ORIGINAL WORK
Raspberry Full Stack 2018, Peter Dalmaris
4. HARDWARE
* Any Raspberry Pi
* DHT11 or 22
* 10KOhm resistor
* Breadboard
* Wires
5. SOFTWARE
Command line terminal
Simple te... |
import numpy as np
import torch
from smartsim.ml.data import DynamicDataDownloader, StaticDataDownloader
class StaticDataGenerator(StaticDataDownloader, torch.utils.data.IterableDataset):
"""A class to download a dataset from the DB.
Details about parameters and features of this class can be found
in th... |
# Generated by Django 3.0.3 on 2020-03-20 02:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.CreateModel(
... |
#import AnnoList_pb2
from . import AnnotationLib
def loadPal(filename):
_annolist = AnnoList_pb2.AnnoList()
f = open(filename, "rb")
_annolist.ParseFromString(f.read())
f.close()
return _annolist
def savePal(filename, _annolist):
f = open(filename, "wb")
f.write(_anno... |
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import os
# We can access to the port the HTTP server have to listen to via TASK_PORT
PORT_NUMBER = int(os.environ['TASK_PORT'])
class myHandler(BaseHTTPRequestHandler):
def do_POST(self):
self.send_response(200)
self.s... |
from __future__ import annotations
import pytest
from dials.algorithms.indexing.basis_vector_search import (
FFT1D,
FFT3D,
RealSpaceGridSearch,
)
class TestStrategies:
def check_results(self, unit_cell, basis_vectors):
# check we have found a basis vector corresponding to each unit cell para... |
import sqlite3
import pymysql
from tabulate import tabulate
from prettytable import PrettyTable
import sys
universal = []
a = {}
def welcome_menu():
# Display these on startup
print(
"""
It's a bright and sunny day!!!
Welcome to Kufco Stores\n
"""
)
def kufco_database_name_display... |
import mythril.laser.ethereum.util as helper
from mythril.ether.ethcontract import ETHContract
from mythril.ether.util import *
from mythril.exceptions import NoContractFoundError
class SourceMapping:
def __init__(self, solidity_file_idx, offset, length, lineno):
self.solidity_file_idx = solidity_file_idx... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... |
"""
MIT License
Copyright (c) 2020-2021 phenom4n4n
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, publis... |
"""Apache Configurator."""
# pylint: disable=too-many-lines
import copy
import fnmatch
import logging
import re
import socket
import time
from collections import defaultdict
import pkg_resources
import six
import zope.component
import zope.interface
from acme import challenges
from acme.magic_typing import DefaultD... |
#coding:utf-8
# Copyright (c) 2019 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 requ... |
# 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... |
from django.contrib import admin
from news_event.models import News, Event
# Register your models here.
admin.site.register(News)
admin.site.register(Event) |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... |
from __future__ import absolute_import
import pytest
from pyramid.threadlocal import get_current_request
from weasyl import login
from weasyl import define as d
from weasyl.sessions import create_session
from weasyl.test import db_utils
@pytest.mark.usefixtures('db')
def test_verify_login_record_is_updated():
... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from collections import namedtuple
from textwrap import dedent
from pants.base.build_file import BuildFile
from pants.base.file_system_project_tree import FileSystemProjectTree
... |
# Validators for all player's inputs
import os
from .os_initializer import init_os
from extra.tools.clean_console_command_setter import set_cleaning_command
class Validators:
"""The class helps the user to enter valid data then the game require it."""
def __init__(self):
self.platform = init_os()
... |
import copy
import collections as col
import random
# use relationship to generate partition
def partition(element, attribute):
x = copy.deepcopy(element)
result = []
for i in range(len(element)):
if element[i] not in x:
continue
temp = [element[i]]
x.remov... |
import os
import time
import json
import math
from bpy.props import *
from ..utility import *
from ..preferences import get_pref
class RSN_OT_RenderButton(bpy.types.Operator):
"""Need Scene Camera"""
bl_idname = "rsn.render_button"
bl_label = "Render"
# get data from root (from the render_list node... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'configurations.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... |
import cv2
import sys
import numpy as np
import datetime
import os
import glob
from retinaface_cov import RetinaFaceCoV
thresh = 0.8
mask_thresh = 0.2
scales = [640, 1080]
count = 1
gpuid = 0
#detector = RetinaFaceCoV('./model/mnet_cov1', 0, gpuid, 'net3')
detector = RetinaFaceCoV('./model/mnet_cov2', 0, gpuid, 'net... |
# coding=UTF-8
""" Defines an nbtlib schema for schematic files """
from typing import Tuple
import enum
import numpy as np
import nbtlib as nbt
class Entity(nbt.CompoundSchema):
"""
Entities describe objects which are not anchored to blocks, like mobs.
"""
schema = {
'id': nbt.String,
... |
from .connected import *
from .biconnected import *
from .ego_betweenness import * |
#!/usr/bin/env python2
"""
Example showing REST calls using Azure Automation RunAs account against Azure resources (automation runbook job)
You could publish the below code as a new python runbook (hello_world_python) and then start it with this sample.
#!/usr/bin/env python2
import getopt
import sys
opts, args = ge... |
import torch
from torch import nn
import torch.nn.functional as F
import os
import numpy as np
from collections import OrderedDict
import util.util as util
import util.index as index
import models.networks as networks
import models.losses_opt as losses
from models import arch
from .base_model import BaseModel
from P... |
# Sample PySys testcase
# Copyright (c) 2019-2020 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
# Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your Licens... |
import os
import sys
from pylint import epylint as lint
# Add directories to exclude to this list.
EXCLUDE_DIRS = ['venv']
def get_result_value(result_string):
tmp_res_list = result_string.rstrip().split('\n')
for item in tmp_res_list:
if 'Your code has been rated at' in item:
tmp_result =... |
from django import forms
from .models import Poll, Choice
# questionnaire
class QuestionnaireAddForm(forms.ModelForm):
poll1 = forms.CharField(label='Poll 1', max_length=100, min_length=2,
widget=forms.TextInput(attrs={'class': 'form-control'}))
class Meta:
model = Poll
... |
import numpy
import SimpleITK as sitk
from radiomics import base, cShape, deprecated
class RadiomicsShape(base.RadiomicsFeaturesBase):
r"""
In this group of features we included descriptors of the three-dimensional size and shape of the ROI. These features
are independent from the gray level intensity distribu... |
import jk_pypiorgapi
from datetime import datetime
import re
import requests
import time
from pprint import pprint
import json
import pickle
from multiprocessing import Pool
# set up autentification github
username = 'edigeze'
# token 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
token = 'ghp_AivkwMUfiMYhIjcHmYVHfzyylB35... |
import functools
import itertools
from typing import (Iterable,
Tuple)
from .functional import (combine,
compose)
from .hints import (Domain,
Map,
Operator,
Predicate)
from .replication import duplicate as _duplica... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Dave Challis <dave@suicas.net>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Python wrapper for `Vowpal Wabbit's Latent Dirichlet Allocation <https://github.com/JohnLangford/vowpal_wabbit/>`_.
This uses `Matt Hoffman'... |
import json
import os
import typing
import frontmatter
import pydantic
from markdown_it import MarkdownIt
class Author(pydantic.BaseModel):
name: str = 'anonymous'
affiliation: str = None
affiliation_url: typing.Union[str, pydantic.HttpUrl] = None
email: typing.Union[str, pydantic.EmailStr] = None
... |
#
# 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... |
"""Kata url: https://www.codewars.com/kata/5650ab06d11d675371000003."""
def split_in_parts(s: str, part_length: int) -> str:
return ' '.join(s[i:i + part_length] for i in range(0, len(s), part_length))
|
import math
import os
import data_loader
import model_s2i
import flags
import util
import numpy as np
import tensorflow as tf
from seqeval.metrics import accuracy_score
from seqeval.metrics import f1_score
from seqeval.metrics import precision_score
from seqeval.metrics import recall_score
from sklearn.metrics import ... |
from typing import Optional, Tuple, List
from collections import defaultdict
from mp_api.core.client import BaseRester, MPRestError
from mp_api.routes.electronic_structure.models.core import BSPathType, DOSProjectionType
from emmet.core.electronic_structure import ElectronicStructureDoc
from pymatgen.analysis.magnetism... |
class PhotofuniaException(Exception):
def __init__(self, *args):
Exception.__init__(self, *args) |
"""fixtures for testing chapps.switchboard"""
from unittest.mock import Mock, AsyncMock
import pytest
from chapps.policy import (
GreylistingPolicy,
SenderDomainAuthPolicy,
OutboundQuotaPolicy,
)
from chapps.signals import CallableExhausted
from chapps.tests.conftest import ErrorAfter, _unique_instance
fro... |
import os.path
import paramiko
class SSHConnection(object):
def __init__(self, host, username, password, port=22):
self.sftp = None
self.sftp_open = False
self.transport = paramiko.Transport((host, port))
self.transport.connect(username=username, password=password)
def _openSF... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.17
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
import spacy
from glob import glob
from tqdm import tqdm
import errant
import json
import os
from mpire import WorkerPool
annotator = errant.load('en')
def tokenize(sent):
doc = nlp(sent)
tok = [i.text for i in doc]
return " ".join(tok)
target_pairs = glob("/home/parth.chudasama/data_mnt/target_pairs/*... |
import tensorflow as tf
from typing import Tuple, List, Union
from .layers import GCNLayer
from .gcn_skip import GCNTwoLayersSkipConnection
class GCNSequential(tf.keras.Model):
def __init__(self, layers: List[Union[GCNLayer,GCNTwoLayersSkipConnection]]):
super(GCNSequential, self).__init__()
self... |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... |
#!/usr/bin/python
################################################################################
# 21132ac6-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... |
import pickle
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import (
QWidget, QToolTip, QPushButton, QApplication, QMessageBox, QTableWidget)
from .RadioWindow import RadioWindow
class WrappedRadioWindow(RadioWindow, QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
... |
# -*- coding: utf-8 -*-
from scipy.spatial import distance as dist
import uuid
from ..base import Property
from .base import MixtureReducer
from ..types.state import TaggedWeightedGaussianState, WeightedGaussianState
from operator import attrgetter
class GaussianMixtureReducer(MixtureReducer):
"""
Gaussian M... |
# Copyright 2015 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... |
from __future__ import absolute_import
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from social_auth.models import UserSocialAuth
from social_auth.exceptions import AuthException
def associate_by_email(details, user=None, *args, **kwargs):
"""Return user entry with same email a... |
from http import HTTPStatus
from api import app, database
from flask import jsonify, request, abort, make_response
def check_and_insert(company):
"""
Inserts the supplied company record if it doesnt already exists
"""
# Get the companies collection from the database
company_collection = database()
... |
import os
import scipy.io as scio
import math
from scipy import stats
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
import csv
'''
1. Central Trend Statistics:
--- mean
--- median
--- low quartile
--- upper quartile
2. Dispersion Degree Statistics:
--- minimum
-... |
def incByOne(x: str) -> str:
return x + 1
|
import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="name", parent_name="choroplethmapbox", **kwargs):
super(NameValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
from __future__ import absolute_import, print_function, division
from pony.py23compat import PY2
from datetime import date
import unittest
from pony.orm.core import *
from pony.orm.core import Attribute
from pony.orm.tests.testutils import *
from pony.orm.tests import db_params, only_for, setup_database, teardown_data... |
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Meeting)
|
"""
Main file for deviance mining
"""
import numpy as np
from src.encoding.declare.declare_templates import *
def apply_template_to_log(template, candidate, log):
"""returns the log with template applied
:param template:
:param candidate:
:param log:
:return:
"""
results = []
for tra... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import prince
from sklearn.cluster import DBSCAN
import itertools
from cmca import CMCA
from ccmca import CCMCA
plt.style.use('ggplot')
alpha = r'$ \alpha $'
## Set up color
tableau10 = {
'blue': '#507AA6',
'orange': '#F08E39',
'red': ... |
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
"""Auto-generated package that contains models used b... |
from __future__ import unicode_literals, print_function
import redis
from rq import Connection, Queue, Worker
from frappe.utils import cstr
from collections import defaultdict
import frappe
import MySQLdb
import os, socket, time
default_timeout = 300
queue_timeout = {
'long': 1500,
'default': 300,
'short': 300
}
d... |
'''Validation tools for input and output data
'''
from jsonschema import validate
import yaml
try:
import importlib.resources as resources
except ImportError: # pragma: no cover
import importlib_resources as resources
def _validate_dict(input_dict, schema_name, **kwargs):
schema = yaml.load(
re... |
"""
Provides a simple test script for uploading and download a file.
If testing against Drake Girder, create somthing like `/tmp/drake_girder.yml`
with these contents:
```
url: https://drake-girder.csail.mit.edu
folder_path: /collection/test/files
api_key: <copy API key here>
```
Then call this script with this file... |
# Only a problem in Python 3
from urllib.parse import urlsplit
foo = 42
check(foo)
def func(url):
parts = urlsplit(url)
foo = 1
check(foo)
if parts.path: # using `urlsplit(url).path` here is equivalent
return # using `pass` here instead makes points-to work
foo = 2
check(foo) # Poin... |
import glob
import json
import os
import xml.etree.ElementTree as ET
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, is_platform_windows
def get_settingsSecure(files_found, report_folder, seeker):
slash = '\\' if is_platform_windows() else '/'
# Filter for ... |
from __future__ import print_function
import json
import sys
import os
from . import TornadoScheduledReporter
class TornadoStreamReporter(TornadoScheduledReporter):
"""Writes JSON serialized metrics to a stream using an ``IOLoop`` for scheduling"""
def __init__(self, interval, stream=sys.stdout, registry=N... |
# License 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 use t... |
import os
import sys
import grammaire
from datalabs.operations.edit.editing import editing
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../../"))
)
def readfile(file):
with open(file, encoding="utf8") as input:
lines = input.readlines()
return lines
def load... |
#!/usr/bin/python
"""
(C) Copyright 2020 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 ... |
#!/usr/bin/env python
"""
Scatter plot with point selection
Draws a simple scatter plot of random data. The user can click on points to
select or unselect them.
- Left-click on a point to select or unselect it.
- Left-drag to pan.
- Mouse wheel to zoom
"""
from __future__ import print_function
# FIXME: ... |
import discord
import random
import copy
class OrderButton(discord.ui.Button):
def __init__(self, label, order, bc, ctx):
self.bc = bc
self.order = order
self.ctx = ctx
super().__init__(label=label)
async def callback(self, interaction: discord.Interaction):
if interact... |
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... |
"""
Quick test script to shape-check graph definition of full GQN model with ELBO
objective with random toy data.
"""
import os
import sys
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
TF_GQN_HOME = os.path.abspath(os.path.join(SCRIPT_PATH, '..'))
sys.path.append(TF_GQN_HOME)
import tensorflow as tf
import... |
# Python Object Oriented Programming by Joe Marini course example
# Creating immutable data classes
from dataclasses import dataclass
@dataclass(frozen=True) # "The "frozen" parameter makes the class immutable
class ImmutableClass:
value1: str = "Value 1"
value2: int = 0
def somefunc(self, newvalue):
... |
import random
import timeit
import typing
from .benchmark import Benchmark
from .benchmark_result import BenchmarkResult
from .benchmark_solver import BenchmarkSolver
class BenchmarkRunner:
def __init__(
self, solvers: typing.List[BenchmarkSolver], benchmarks: typing.List[Benchmark]
):
random... |
# pylint: disable=no-member,invalid-name,redefined-outer-name
"""ArviZ plotting backends."""
import re
import numpy as np
from pandas import DataFrame
from ...rcparams import rcParams
def to_cds(
data,
var_names=None,
groups=None,
dimensions=None,
group_info=True,
var_name_format=None,
i... |
# Generated by Django 3.0.6 on 2020-05-28 13:48
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('users', '0001_initial'),
('subscription', '0001_initial'),
]
operations = [
migrations.AddField(
mod... |
# Copyright The PyTorch Lightning team.
#
# 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... |
import gettext
import os
import re
from datetime import datetime, timedelta
from importlib import import_module
import pytz
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.admin.tests import AdminSeleniumTestCase
f... |
import pathlib
from typing import Collection, Dict, Iterable, Iterator, List, Optional
from urllib.error import HTTPError
import jellyfish
import pydantic
import rtree
import shapely.geometry
import urllib3
import us
from vaccine_feed_ingest_schema import load, location
from vaccine_feed_ingest.utils.log import getLo... |
i = 0 #define an integer
while (i<119): #while i is less than 119, do the following
print(i) #print the current value of i
i += 10 #add 10 to i
|
"""This module contains the general information for ComputeUser ManagedObject."""
from ...ucscentralmo import ManagedObject
from ...ucscentralcoremeta import UcsCentralVersion, MoPropertyMeta, MoMeta
from ...ucscentralmeta import VersionMeta
class ComputeUserConsts():
INT_ID_NONE = "none"
POLICY_OWNER_LOCAL ... |
#!/usr/bin/env python
from setuptools import setup, find_packages
from codecs import open
from os import path
# Get the long description from DESCRIPTION.rst
with open(path.join(path.abspath(path.dirname(__file__)),
'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()
tests_require =... |
#!/usr/bin/env python3
"""Replace all vowels in s string with "oodle".
Title:
Voodlewoodlel
Description:
Boodleb wanted to see how his friend's name would look
if he changed every vowel to "oodle".
But he has no idea what vowels are, or how to chage them.
Help him realize his life's goal.
The user inputs n lines, wit... |
# pylint: disable=g-bad-file-header
# Copyright 2016 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/LICENS... |
import FWCore.ParameterSet.Config as cms
L1RPCConeDefinitionOnline = cms.ESProducer("L1RPCConeDefinitionOnlineProd",
onlineAuthentication = cms.string('.'),
forceGeneration = cms.bool(False),
onlineDB = cms.string('oracle://CMS_OMDS_LB/CMS_TRG_R')
)
|
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
alist = [1,2,3,4,5,6,7,8,9,10]
xlist = [1,2,3,4,5,6,7,8,9,10]
plt.bar(alist, xlist)
plt.show() |
from django.views import generic
from saferpay.models import SaferpayTransaction
class TransactionListView(generic.ListView):
model = SaferpayTransaction
template_name = 'saferpay_oscar/dashboard/transaction_list.html'
context_object_name = 'transactions'
class TransactionDetailView(generic.DetailView):... |
# Copyright 2016 Quora, Inc.
#
# 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... |
# Copyright 2019 The TensorFlow Probability 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 o... |
"""Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... |
# Copyright 2011-2013 Colin Scott
# Copyright 2011-2013 Andreas Wundsam
#
# 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... |
# -*- coding: utf-8 -*-
#
# ptah documentation build configuration file
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# The contents of this file are pickled, so don't put values in the
# namespace that aren't pickleable (module imports are okay, they're
# removed automatically)... |
import inspect
import string
from typing import Optional
from random import SystemRandom
import json
import datetime
import decimal
from getpass import getuser
from urllib.parse import urlparse, unquote
import types
from asyncio import ensure_future
from functools import partial
from urllib.parse import urlunsplit, url... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.