text stringlengths 1 927k |
|---|
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... |
# coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import
import logging
from celery import shared_task
from django.conf import settings
from onadata.apps.restservice.models import RestService
@shared_task(bind=True)
def service_definition_task(self, rest_service_id, data):... |
"""
This example we will walk you over the basics of MindsDB
The example code objective here is to predict the best retail price for a given property.
"""
from mindsdb import Predictor
# use the model to make predictions
result = Predictor(name='home_rentals_price').predict(when={'number_of_rooms': 2,'number_of_ba... |
from __future__ import absolute_import
from flask import Blueprint, render_template
from webgrid_ta.extensions import gettext as _
main = Blueprint('main', __name__)
@main.route('/')
def index():
from webgrid import NumericColumn
from webgrid_ta.grids import PeopleGrid as PGBase
from webgrid_ta.model.e... |
# pylint: disable=too-many-lines
# 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) AutoRe... |
class QuizBrain:
def __init__(self, question_list):
self.question_number = 0
self.question_list = question_list
self.score = 0
def next_question(self):
current_q = self.question_list[self.question_number]
self.question_number += 1
user_answer = input(f"Q.{self.question_number}: {current_... |
DLManagedTensor* toDLPack(constTensor& src){
ATenDLMTensor * atDLMTensor(newATenDLMTensor);
atDLMTensor->handle = src;
atDLMTensor->tensor.manager_ctx = atDLMTensor;
atDLMTensor->tensor.deleter = &deleter;
atDLMTensor->tensor.dl_tensor.data = src.data_ptr();
int64_tdevice_id = 0;
if(src.type().is_cuda()) {
device... |
# Copyright 2018-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 agreed to in writ... |
#
# Copyright 2008 Google 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 writ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from .. import util
class ConvEncoder(nn.Module):
"""
Basic, extremely simple convolutional encoder
"""
def __init__(
self,
dim_in=3,
norm_layer=util.get_norm_layer("group"),
padding_type="reflect",
... |
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
from twisted.logger import Logger
from datetime import datetime
log = Logger()
class FixMessage(object):
def __init__(self):
self.length = 0
self.checksum = None
self.type = None
self.created_at = datetime.utcnow()
self.recieved_at... |
# coding: utf-8
string = input()
if '0'*7 in string or '1'*7 in string:
print('YES')
else:
print('NO') |
import torch
from torch import nn
from torch.nn import init
from torch.nn import functional as F
import functools
from torch.autograd import Variable
def init_linear(linear):
init.xavier_uniform_(linear.weight)
linear.bias.data.zero_()
def init_conv(conv, glu=True):
init.xavier_uniform_(conv.weight)
... |
TRAINING_DATA = [
(
"Reddit partners with Patreon to help creators build communities",
{"entities": [(0, 6, "WEBSITE"), (21, 28, "WEBSITE")]},
),
("PewDiePie smashes YouTube record", {"entities": [(18, 25, "WEBSITE")]}),
(
"Reddit founder Alexis Ohanian gave away two Metallica ti... |
# fmt: off
#########################
# Application #
#########################
APP_NAME = "diagrams"
DIR_DOC_ROOT = "docs/nodes"
DIR_APP_ROOT = "diagrams"
DIR_RESOURCE = "resources"
DIR_TEMPLATE = "templates"
PROVIDERS = (
"aci", "base", "onprem", "aws", "azure", "gcp", "ibm", "firebase", "k8s", "alib... |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
'''
All operators
'''
import unittest
from iptest import IronPythonTestCase, run_test, skipUnlessIronPython
@s... |
# -*- coding: utf-8 -*-
# Source https://leetcode.com/problems/3sum-closest/
def three_sum_closest(nums, target):
n = len(nums)
if n < 3:
raise Exception('expected at least a three element array')
nums.sort()
closest = nums[0] + nums[1] + nums[2]
for i in range(n-2):
a = nums[i]
... |
# encoding: utf-8
import atexit
import zipfile
import shutil
# TODO: Move all CLR-specific functions to clr_tools
from pycharm_generator_utils.module_redeclarator import *
from pycharm_generator_utils.util_methods import *
from pycharm_generator_utils.constants import *
from pycharm_generator_utils.clr_tools import *... |
import json
from datetime import date
from kingfisher_scrapy.base_spider import IndexSpider, PeriodicSpider
from kingfisher_scrapy.exceptions import SpiderArgumentError
from kingfisher_scrapy.util import components, handle_http_error
class ChileCompraBaseSpider(IndexSpider, PeriodicSpider):
custom_settings = {
... |
# coding=utf-8
# Copyright 2014 Dirk Dittert
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2018-12-15 09:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0003_course_category'),
]
operations = [
migrations.AddField(
... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/attachment/engine/shared_ywing_engine_s02.iff"
result.attribut... |
#!/usr/bin/env python3
# coding: utf-8
"""
Prints a table of contents for a lightning talks description field.
Translates a lightning talk timetable from csv timetable to a table of contents
in ReStructuredText format, for use in the description field. The input csv
should be in the following format:
Time,Speaker,T... |
# Copyright 2019 Jeremiah Sanders.
#
# 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 wri... |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
import argparse
import difflib
import os
from modules.constants import Constants
from modules.scraper.detik import Detik
from modules.scraper.wikipedia import Wikipedia
from modules.summarizer.models import BiGRUModel
from modules.section_assigner import SectionAssigner
from modules.similarity_checker import Similarit... |
import pathlib
import re
import sys
import pytest
from pdm import utils
from pdm.cli import utils as cli_utils
from pdm.exceptions import PdmUsageError
@pytest.mark.parametrize(
"given,expected",
[
("test", "test"),
("", ""),
("${FOO}", "hello"),
("$FOO", "$FOO"),
("$... |
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream, HTTPStream
from streamlink.utils import parse_json
class Gulli(Plugin):
LIVE_PLAYER_URL = 'http://replay.gulli.fr/jwplayer/embedstreamtv'
VOD_PLAYER_URL = 'http://replay.gulli.fr... |
n = str(input('Digite seu nome completo:' )).strip()
nome = n.split()
print('Muito prazer em te conhecer!')
print('Seu primeiro nome é {}'.format(nome[0]))
print('Seu ultimo nome é {}'.format(nome[len(nome)-1])) |
'''
Unittests/Qt/Resources/Configurations
_____________________________________
Test suite for Qt configurations.
:copyright: (c) 2015 The Regents of the University of California.
:license: GNU GPL, see licenses/GNU GPLv3.txt for more details.
'''
# load modules/submodules
from . import rendering... |
from typing import List
from urllib.request import urlopen
import altair as alt
from .chart import Chart, LayerChart
import json
def get_chart_spec_from_url(url: str) -> List[str]:
"""
For extracting chart specs produced by the research sites framework
"""
response = urlopen(url)
content = respons... |
from completesimulation import SavannahSim, HamadryasSim
from multiprocessing import Process, Queue, JoinableQueue
class Runner(object):
def run(self, class_name, duration, n_replicates):
pass
class SerialRunner(Runner):
def __init__(self, class_name, duration, n_replicates):
self.class_name... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
from abc import ABC as Abstract
class Entity(Abstract):
pass |
import time
from zmqpc import Events
def simple_recv(topic='test_topic', data=None):
pub = Events()
sub = Events()
# set up subscriber connection
def fn(data):
fn.data = data
fn.data = None
time.sleep(0.1)
sub.connect(fn, topic)
time.sleep(0.1)
pub.publish(topic, data)
... |
import numpy
from prototype import Changer
def test_changer():
changer = Changer(0.5, 1, 1)
matrix = numpy.array([[0, 0, 0]])
changer.change(matrix)
assert matrix[0, 2] == 0
changer.change(matrix)
assert matrix[0, 2] == -1
changer.change(matrix)
assert matrix[0, 2] == 0 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Anler Hernández ... |
import tkinter as tk
from tkinter import ttk
import tkinter.scrolledtext as tkst
from configuration import Configuration
import configparser
import os
import sys
import zipfile
class Dialog(tk.Toplevel):
def __init__(self, parent, title=None):
super().__init__(parent)
self.transient(parent)
... |
# Generated by Django 3.1.6 on 2021-02-25 13:54
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
from fnmatch import fnmatch
import logging
from operator import attrgetter
from ..errors import ErrorAccessDenied, ErrorFolderNotFound, ErrorCannotEmptyFolder, ErrorCannotDeleteObject, \
ErrorDeleteDistinguishedFolder
from ..fields import IntegerField, CharField, FieldPath, EffectiveRightsField, PermissionSetField... |
# Generated by Django 3.0.5 on 2021-05-31 19:04
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quiz', '0005_auto_20201209_2125'),
]
operations = [
migrations.AddField(
model_name='course',
name='... |
import json
def lambda_handler(event, context):
use_response = {
"sessionAttributes": {
"detected_utterance": event['inputTranscript']
},
"dialogAction": {
"type": "Close",
"fulfillmentState": "Fulfilled",
"message": {
# Ca... |
"""Coredata tests"""
from __future__ import unicode_literals # isort:skip
from flask_webtest import SessionScope
from portal.extensions import db
from portal.models.coredata import Coredata, configure_coredata
from portal.models.organization import Organization
from portal.models.role import ROLE
from tests import T... |
from test import support
gdbm = support.import_module("dbm.gnu") #skip if not supported
import unittest
import os
from test.support import verbose, TESTFN, run_unittest, unlink
filename = TESTFN
class TestGdbm(unittest.TestCase):
def setUp(self):
self.g = None
def tearDown(self):
if self.g i... |
"""
:codeauthor: Joe Julian <me@joejulian.name>
"""
# Import the future
import logging
import salt.modules.tls as tls
from salt.utils.versions import LooseVersion
from tests.support.helpers import with_tempdir
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, mock_op... |
#!/usr/bin/env python3
# Copyright (c) 2018 Wei-Kai Lee. All rights reserved
# coding=utf-8
# -*- coding: utf8 -*-
import numpy as np
def dx(x):
return x[1:]-x[0:x.size-1]
def yave(y):
xszie = y.shape[-1]
return ( y[...,1::]+y[...,0:(xszie-1):] )/2
def myNumericalIntegration(x,y):
"""
myNumerica... |
# 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 a... |
# -*- 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... |
from . import common
from . import data
from . import models
from . import training |
import os
import ymake
from _common import stripext, rootrel_arc_src, listid, resolve_to_ymake_path
from pyx import PyxParser
def is_arc_src(src, unit):
return (
src.startswith('${ARCADIA_ROOT}/') or
src.startswith('${CURDIR}/') or
unit.resolve_arc_path(src).startswith('$S/')
)
def t... |
#!/usr/bin/env python2
import base64
import json
import logging
import optparse
import os
import select
import ssl
import subprocess
import sys
import time
import urllib2
ANVIL_USERNAME = "admin"
MAX_RETRIES = 60
SLEEP_TIME = 10
# rest to try for
REST_MAX_RETRIES = 6
REST_SLEEP_TIME = 10
# default export options
DEFA... |
from lxml import etree
html = etree.parse('./test.html', etree.HTMLParser())
result = html.xpath('//a[@href="link4.html"]/parent::*/@class')
print(result) |
from pathlib import Path
import pytest
from _pytest.tmpdir import TempdirFactory
import os
from rasa import model
from rasa.core import utils
from rasa.core.domain import Domain
from rasa.skill import SkillSelector
from rasa.train import train_async
def test_load_imports_from_directory_tree(tmpdir_factory: TempdirF... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, os, io, xml.sax, re, time, logging
from lxml import etree
from xml.dom.minidom import parse, parseString, getDOMImplementation
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
SCRIPT_NAME = os.path.splitext(os.path.split(__file__)[1])[0]
DESCRIPTION = ... |
# Easy
# https://leetcode.com/problems/intersection-of-two-linked-lists/
# Refer CTCI PAGE 222
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# Time Complexity: O(N + M) where N = len(list1) and M = len(list2)
... |
# -*- coding: utf-8 -*-
# stdlib modules
import logging
import re
import pathlib
import tempfile
from datetime import datetime
from pprint import pprint as pp
# Third party modules
import pymongo
from pymongo.errors import DuplicateKeyError, BulkWriteError
from cyvcf2 import VCF
from intervaltree import IntervalTree... |
"""
Data sources
All the data sources must extend DataSource abstract class and define `crawl` and `feed` methods.
This methods are automatically called during the crawl and feed processes.
"""
import httplib2
from abc import ABCMeta, abstractmethod
from apiclient.discovery import build
from oauth2client.service_accoun... |
import random
from tools.checks import get_empty_result_dataset
from tools.getter import get_values
version = 2.0
examples_cap = 100
def add_item(scope, item, item_id):
if not scope:
scope = {
"original_ocid": dict(),
"related_processes": dict(),
"meta": {
... |
# DO NOT EDIT
# This file was generated by idol_mar, any changes will be lost when idol_mar is rerun again
from marshmallow import Schema
from .optional_params import AllTargetOptionalParamsField
from .assembled_optional import AllTargetAssembledOptionalField
from importlib import import_module
from ...__idol__ import ... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import *
import unittest
import datetime as pydt
import logging
imp... |
from enum import Enum
class events(Enum):
message_new = 'message_new'
message_edit = 'message_edit'
message_allow = 'message_allow'
message_typing_state = 'message_typing_state'
message_reply = 'message_reply'
message_deny = 'message_deny'
message_event = 'message_event'
photo_new = 'p... |
from classifier.svm import *
"""
pythonw -m classifier.test_svm
"""
if __name__ == "__main__":
logger = logging.getLogger(__name__)
args = get_command_args(debug=True, debug_args=["--debug",
"--plot",
"... |
import numpy as np
import pandas as pd
from scipy.stats import norm
class CohensDCalculator(object):
def get_cohens_d_df(self, cat_X, ncat_X, correction_method=None):
empty_cat_X_smoothing_doc = np.zeros((1, cat_X.shape[1]))
empty_ncat_X_smoothing_doc = np.zeros((1, ncat_X.shape[1]))
smoot... |
from InquirerPy import prompt, inquirer
from InquirerPy.separator import Separator
from ...flair_management.skin_manager.skin_manager import Skin_Manager
from .weapon_config_prompts import Prompts
class Weight_Editor:
@staticmethod
def weights_entrypoint():
weapon_data, skin_data, skin_choice, weapon... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
from argparse import ArgumentParser, Namespace
from idb.cli import ClientCommand
from idb.common.types i... |
#!/usr/bin/env python3
from typing import Dict
from iometrics.example import usage
from iometrics.pytorch_lightning.callbacks import LOG_KEY_DISK_UTIL
from iometrics.pytorch_lightning.callbacks import NetworkAndDiskStatsMonitor
def test_all_metrics() -> None:
last_row = usage(1)
assert "0.0" in last_row
de... |
# -*- coding: utf8 -*-
# coding: utf8
from flask_restful import Resource, Api
from werkzeug.exceptions import HTTPException
from flask import request, send_file, json, Response
from __init__ import *
api = Api(app)
class JcNetwork(Resource):
def get(self):
return {
'code': 200,
'm... |
import re
import typing
from pathlib import Path
from configparser import ConfigParser
from typing import List
if typing.TYPE_CHECKING:
from rivals_workshop_assistant.script_mod import Script
FILENAME = "config.ini"
PATH = FILENAME
SMALL_SPRITES_FIELD = "small_sprites"
def read(root_dir: Path) -> ConfigParser:... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
import os
import click
import re
import json
import tempfile
import torch
import dnnlib
from training import training_loop
from metrics import metric_main
from torch_utils import training_stats
from torch_utils import custom_ops
#----------------------------------------------------------------------------
class User... |
import os
import numpy as np
import pandas as pd
from repli1d.analyse_RFD import nan_polate, smooth
def normal_seq(signal, q=99, output_path='../data/'):
"""
normalization function that transforms each fature in range (0,1)
and outputs the minimum and maximum of features in a csv file in
data folder... |
# Copyright 2018 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, ... |
# -*- coding: utf-8 -*-
"""
Functions for generating group-level networks from individual measurements
"""
import numpy as np
from scipy.sparse import csgraph
from sklearn.utils.validation import (check_random_state, check_array,
check_consistent_length)
from . import utils
def... |
import numpy as np
import matplotlib.pyplot as plt
import math
np.random.seed(0)
M, N = 10, 5
def is_pareto_efficient(X):
is_efficient = np.ones(len(X), dtype = bool)
for i, c in enumerate(X):
if is_efficient[i]:
is_efficient[is_efficient] = np.any(X[is_efficient] > c, axis=1)
... |
from pathlib import Path
cwd = Path(__file__).parent |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from de... |
"""Auto-generated file, do not edit by hand. GG metadata"""
from phonenumbers.phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GG = PhoneMetadata(id='GG', country_code=44, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='\\d{6,10}', possible_number_pa... |
# -*- coding: utf-8 -*-
from gps3.agps3threaded import AGPS3mechanism
import time
import os
from measurement.measures import Distance
agps_thread = AGPS3mechanism()
agps_thread.stream_data()
agps_thread.run_thread()
while 1:
callsign = "DL3KB" #change to your callsign
time.sleep(10) #change to your prefered in... |
#!/usr/bin/env python
from __future__ import print_function
import drmaa
import time
import os
def main():
"""Submit a job, and check its progress.
Note, need file called sleeper.sh in home directory.
"""
s = drmaa.Session()
s.initialize()
print('Creating job template')
jt = s.createJobTe... |
from __future__ import absolute_import
import pytz
from datetime import (
datetime,
timedelta,
)
from sentry.testutils import TestCase
from sentry.tsdb.base import TSDBModel, ONE_MINUTE, ONE_HOUR, ONE_DAY
from sentry.tsdb.redis import RedisTSDB
from sentry.utils.dates import to_timestamp
class RedisTSDBTes... |
import numpy as np
import os
import sys
sys.path.append(os.getcwd())
from mindware.components.feature_engineering.transformations.preprocessor.text2vector import \
Text2VectorTransformation
from mindware.components.feature_engineering.transformation_graph import DataNode
from mindware.components.utils.constants i... |
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch_ros.actions import Node
from scripts import GazeboRosPaths
def generate_launch_description():
package_share_dir = get_package_share_directory("maz... |
"""CoTrack URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... |
# Copyright 2013 Rackspace Hosting
#
# 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 __future__ import print_function
from splunklib.searchcommands import dispatch, StreamingCommand, Configuration, Option, validators
import sys
import socket
import struct
@Configuration()
class IPDecodeCommand(StreamingCommand):
def stream(self, records):
self.logger.debug('IPDecodeCommand: %s', sel... |
"""
This script creates a unittest that tests Categorical policies in
garage.tf.policies.
"""
import gym
from nose2 import tools
from garage.baselines import LinearFeatureBaseline
from garage.envs import normalize
from garage.tf.algos import TRPO
from garage.tf.envs import TfEnv
from garage.tf.optimizers import Conjug... |
import requests
def run_py(code: str, compiler: str = "cpython-head", options: dict = None) -> dict:
if options is None:
options = {}
task = {
"code": code,
"compiler": compiler,
"options": options,
}
resp = requests.post("https://wandbox.org/api/compile.json", json=tas... |
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... |
#!/usr/bin/env python
# Copyright (C) 2017 Udacity Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: Harsh Pandya
# import modules
import rospy
import tf
from kuka_arm.srv import * # we import the service messages from kuka... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__project__ = 'leetcode'
__file__ = '__init__.py'
__author__ = 'king'
__time__ = '2020/2/10 15:34'
_ooOoo_
o8888888o
88" . "88
(| -_- |)
... |
import json
import re
from typing import Union, Callable, Set
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
from topics_and_summary.utils import join_paths, get_abspath_from_project_source_root
_BASIC_STOPWORDS = set(stopwords.words('english'))
_EMAILS_... |
from concurrent import futures
import time
import grpc
import logging
logging.basicConfig(format='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s', datefmt='%Y-%m-%d:%H:%M:%S', level=logging.DEBUG)
import os
import yaml
from pathlib import Path
import building_zone_names_pb2
import buildi... |
# Build configuration file
# https://www.sphinx-doc.org/en/master/usage/configuration.html
from datetime import date
project = u'Digital garden starter'
# author = u'example'
copyright = ('%s, %s' % (date.today().year, u'example'))
# project_copyright = u'example'
version = u'1.0'
release = u'1.0.0'
extensions = [
... |
import math
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.utils.structures.game_data_struct import GameTickPacket
from util.orientation import Orientation
from util.vec import xy, Vec3, norm, dot
from util.info import GameInfo
from maneuvers.drive import Drive
from maneuvers.kickoff... |
## Given a .wav audio file, downsamples it to 8000 Hz and writes it out
## as a ADPCM file suitable for use with AVRs.
from struct import unpack
import wave
import os
import sys
def unpackMono(waveFile):
w = wave.Wave_read(waveFile)
data = []
for i in range(w.getnframes()):
data.append(unpack("h"... |
"""
Django settings for djavue-python-brasil project.
Generated by 'django-admin startproject' using Django 2.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
... |
from osim.env import L2M2019Env
from osim.control.osim_loco_reflex_song2019 import OsimReflexCtrl
import numpy as np
import pickle
mode = '2D'
difficulty = 1
visualize=False
seed=None
sim_dt = 0.01
sim_t = 5
timstep_limit = int(round(sim_t/sim_dt))
INIT_POSE = np.array([
1.699999999999999956e+00, # forward speed... |
#!/usr/bin/env python
import sys
from launcher import Launcher
hostfile = "machinefiles/20nodes"
progfile = "release/GraphMatching"
schedulerfile = "release/SchedulerMain"
common_params = {
"scheduler" : "proj99",
"scheduler_port" : "33225",
"hdfs_namenode" : "proj99",
"hdfs_port" : 9000,
}
program_... |
# coding=utf-8
# Copyright 2022 The TensorFlow GAN 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 applicabl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised))
# Copyright (c) 2016-2021, Cabral, Juan; Luczywo, Nadia
# Copyright (c) 2022, QuatroPe
# All rights reserved.
# =============================================================================
# D... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.