text stringlengths 2 999k |
|---|
# 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
# d... |
""" This script allows the raw ProteinNet files from
https://github.com/aqlaboratory/proteinnet. """
import os
from glob import glob
import multiprocessing
import torch
def load_ids_from_text_files(directory, train_file):
"""
Given a directory where raw ProteinNet records are stored along with .ids
file... |
"Test posix functions"
from test import support
from test.support.script_helper import assert_python_ok
# Skip these tests if there is no posix module.
posix = support.import_module('posix')
import errno
import sys
import signal
import time
import os
import platform
import pwd
import stat
import tempfile
import unit... |
"""Classes for manipulating Infinifactory save files.
"""
import base64
import io
from typing import List, Tuple, Dict, Optional, Any
from .world_blocks import WorldBlocks
from PIL import Image
class Puzzle(object):
"""Class for puzzle in Infinifactory.
Puzzle keys:
Title: Title of the puzzle.
... |
# from https://rstudio-pubs-static.s3.amazonaws.com/79360_850b2a69980c4488b1db95987a24867a.html
from nltk.tokenize import RegexpTokenizer
from stop_words import get_stop_words
from nltk.stem.porter import PorterStemmer
from gensim import corpora, models
from gensim.models.ldamulticore import LdaMulticore
import gensim... |
#------------------------------------------------------------------------------
'''Confirm output of general models.'''
import logging
import itertools as it
import matplotlib as mpl
mpl.use('Agg') # required to prevent DISPLAY error; must be before pyplot (REF 050)
import ... |
# -*- coding:utf-8 -*-
from django import forms
from django.utils.translation import ugettext, ugettext_lazy as _
from ..backends import DbaasBackend
import ldap
class ChangePasswordForm(forms.Form):
"""
A form that lets a user change set his/her password without entering the
old password
"""
err... |
"""Config flow for HomeKit integration."""
from __future__ import annotations
import asyncio
import random
import re
import string
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import device_automation
from homeassistant.components.camera import DOMAIN as CAMERA_DOMA... |
# paths
qa_path = 'data/vqa' # directory containing the question and annotation jsons
train_path = 'data/vqa/train2014' # directory of training images
val_path = 'data/vqa/val2014' # directory of validation images
test_path = 'data/vqa/test2015' # directory of test images
preprocessed_path = './resnet-14x14.h5' # ... |
#!/usr/bin/env python
import mirheo as mir
dt = 0.001
ranks = (1, 1, 1)
domain = (12, 12, 12)
u = mir.Mirheo(ranks, domain, debug_level=3, log_filename='log')
# we need to first create a mesh before initializing the membrane vector
mesh_rbc = mir.ParticleVectors.MembraneMesh("rbc_mesh.off")
# create a MembraneVe... |
import os.path as osp
from math import ceil
import torch
import torch.nn.functional as F
from torch_geometric.datasets import TUDataset
import torch_geometric.transforms as T
from torch_geometric.loader import DenseDataLoader
from torch_geometric.nn import DenseSAGEConv, dense_diff_pool
max_nodes = 150
class MyFilt... |
"""
function to parse camera images from *.record files, created using Apollo-Auto
parsed data is saved to *.jpeg file, for each capture
"""
import sys, os
from cyber_py import cyber
from cyber_py import record
from modules.drivers.proto.sensor_image_pb2 import CompressedImage
######################################... |
# Copyright(C) 1999-2020 National Technology & Engineering Solutions
# of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
# NTESS, the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provide... |
import numpy as np
import torch
from bisect import bisect_left
class TinyImages(torch.utils.data.Dataset):
def __init__(self, transform=None, exclude_cifar=True):
data_file = open('/raid/data/arwin/data/tiny_images.bin', "rb")
def load_image(idx):
data_file.seek(idx * 3072)
... |
import logging
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
name = req.params.get('name')
if not name:
try:
req_body = req.get_json()
except ValueError:
pass
... |
# -*- coding: utf8 -*-
__author__ = "sergey"
from time import time
import logging
from dedupsqlfs.my_formats import format_size, format_timespan
from dedupsqlfs.get_memory_usage import get_real_memory_usage, get_memory_usage
class ReportHelper:
# Public properties
report_interval = 60 # in second... |
#!/usr/bin/env python
import pathlib
from importlib.machinery import SourceFileLoader
from setuptools import find_packages, setup
version = SourceFileLoader("version", "sqlalchemy_state_machine/version.py").load_module()
_ROOT = pathlib.Path(__file__).parent
with open(str(_ROOT / "README.md")) as f:
readme = f... |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import logging as log
from mako import exceptions
from mako.template import Template
from pkg_resources import resource_filename
from .item import NodeType
from .xbar imp... |
from nose.tools import assert_raises
from nose.tools import eq_
from unittest import TestCase
from rdflib import BNode, Graph, Literal, Namespace, RDFS, XSD
from rdflib.plugins.sparql.operators import (
register_custom_function,
unregister_custom_function,
)
EX = Namespace("http://example.org/")
G = Graph()
G... |
from typing import Optional, Union, Iterable
import numpy as np
from metadrive.obs.top_down_renderer import draw_top_down_map as native_draw
from metadrive.utils.utils import import_pygame
pygame = import_pygame()
def draw_top_down_map(map, resolution: Iterable = (512, 512)) -> Optional[Union[np.ndarray, pygame.Su... |
import asyncio
import asyncpg
import json
async def main():
with open('data/config.json') as f:
config = json.load(f)
conn = await asyncpg.connect('postgresql://postgres@localhost/greeter', password=config['db_pass'],
port=config['db_port'])
await conn.execute('''... |
# -*- coding: utf-8 -*-
from pyramid_oereb.core.renderer.extract.xml_ import Renderer
from pyramid_oereb.core.records.view_service import ViewServiceRecord
def test_empty(template):
map = ViewServiceRecord(
reference_wms=dict(),
layer_index=0,
layer_opacity=1.0
)
content = templat... |
"""This script prints the five best text models from the experiments."""
import glob
import numpy as np
from src.evaluation.evaluator import Evaluator
if __name__ == "__main__": # pragma: no cover
evaluator = Evaluator()
evaluator.read_results(
glob.glob("experiments/results/bert_models/*.json")
... |
import sys
import datetime
import subprocess
from distutils import dir_util
import numpy as np
import os
from PIL import Image
import tensorflow as tf
from wavedata.wavedata.tools.core import calib_utils
import avod
from avod.core import box_3d_projector
from avod.core import summary_utils
def save_predictions_in_... |
# coding=utf-8
# Copyright 2019 The Tensor2Tensor 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... |
import os
from typing import List, Optional, Tuple, Union
import vapoursynth as vs
from bvsfunc.util import ap_video_source
from lvsfunc.misc import source
from lvsfunc.types import Range
from vardautomation import (JAPANESE, AudioStream, FileInfo, Mux, Patch,
PresetAAC, PresetWEB, RunnerCo... |
## @package geometrize_stream_listener
# Module containing the Geometrize bot stream listener, which triggers various callbacks when Twitter API events occur.
import tweepy
class GeometrizeStreamListener(tweepy.StreamListener):
def __init__(self, api):
super(tweepy.StreamListener, self).__init__()
... |
from flask import Response
import json
def buildJson(result):
return Response(response=json.dumps(result),
status=200,
mimetype="application/json")
def sentJson(result):
return Response(response=result,
status=200,
mimetype="app... |
"""MQTT Daemon which collected Hydroquebec Data.
And send it to MQTT using Home-Assistant format.
"""
import asyncio
from datetime import datetime, timedelta
import json
import os
import uuid
from yaml import load
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
import mqtt_... |
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
WORKFLOW_ACTION_ON_ENTRY = 1
WORKFLOW_ACTION_ON_EXIT = 2
WORKFLOW_ACTION_WHEN_CHOICES = (
(WORKFLOW_ACTION_ON_ENTRY, _('On entry')),
(WORKFLOW_ACTION_ON_EXIT, _('On exit')),
)
|
from malaya.function import (
check_file,
load_graph,
generate_session,
nodes_session,
)
from malaya.text.bpe import (
SentencePieceEncoder,
SentencePieceBatchEncoder,
YTTMEncoder,
)
from malaya.text.t2t import text_encoder
from malaya.path import T2T_BPE_MODEL, LM_VOCAB
ENCODER_MODEL = {
... |
import fooster.cron
import mcp.model.source
scheduler = None
def update():
for source in mcp.model.source.items():
mcp.model.source.update(source.source)
def start():
global scheduler
if scheduler:
return
scheduler = fooster.cron.Scheduler()
scheduler.add(fooster.cron.Job(updat... |
import warnings
warnings.filterwarnings("ignore")
import nltk
from nltk.tokenize import word_tokenize,sent_tokenize
from nltk.translate.bleu_score import corpus_bleu,sentence_bleu
from onmt.utils.corenlp import CoreNLP
from tqdm import tqdm
from collections import defaultdict
import collections
import math
from statis... |
import socket
def main():
host = "127.0.0.1" # ip который будем прослушивать
port = 6500 # порт
s = socket.socket() # создаем сокет
s.bind((host,port))
s.listen(1)
print("Waiting for connection...")
connection, address = s.accept() # подключаемся
print("Connection from "... |
'''
https://github.com/wipy/wipy/blob/master/docs/User_manual_exp_board.pdf
'''
from machine import Pin
import time
import pycom
pycom.heartbeat(False)
led = Pin('G16',Pin.OUT)
btn = Pin('G17',Pin.IN,Pin.PULL_UP)
led.toggle()
time.sleep(1)
led.value(1) # 1 is off, 0 is on
btn.value() # 1 is off, 0 is on
wh... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .build import download as download_dodeca
def download(datapath):
download_dodeca(datapath, 'twitter_ft')
|
# Copyright (c) 2021, NVIDIA CORPORATION & 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from abc import ABCMeta, abstractmethod
class AbstractPlugin(metaclass=ABCMeta):
""" 技能插件基类 """
SLUG = 'AbstractPlugin'
IS_IMMERSIVE = False
def __init__(self, con):
if self.IS_IMMERSIVE is not None:
self.isImmersive = self.IS_IMMERSIVE
else:
self.isImmersive =... |
from copy import deepcopy
from openprocurement.auctions.core.tests.base import (
test_document_data,
test_organization
)
from openprocurement.auctions.geb.tests.fixtures.common import (
test_question_data,
test_bid_data
)
def auction_change_fields(test_case):
new_data = {}
field = "title"
... |
"""
Please make note ``kolibri.utils.cli`` has a sensitive module import order.
This deliberately imports ``kolibri.__init__`` before loading additional
``kolibri.*`` modules.
TODO: Investigate and challenge/explain this load order.
"""
from __future__ import absolute_import
from __future__ import print_function
fro... |
"""
Tables Extension for Python-Markdown
====================================
Added parsing of tables to Python-Markdown.
See <https://Python-Markdown.github.io/extensions/tables>
for documentation.
Original code Copyright 2009 [Waylan Limberg](http://achinghead.com)
All changes Copyright 2008-2014 The Python Markd... |
import gym
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
from collections import namedtuple
from tensorboardX import SummaryWriter
# Environment Config
env = gym.make('CartPole-v0').unwrapp... |
from distutils.version import StrictVersion
from functools import lru_cache
from functools import partial
import itertools
import json
import os
import time
import logging
import boto3
from botocore.config import Config
import botocore
from ray.autoscaler._private.constants import BOTO_MAX_RETRIES
from ray.autoscaler... |
# coding: utf-8
# Copyright (c) 2015, thumbor-community
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.
from datetime import datetime, timedelta
from hashlib import sha1
from unittest import TestCase
import botocore.session
from dateutil.tz import tzutc
from thumbor.... |
""" Closuers
Free variables and closures
Remember: Functions defined inside another function can access the outer (nonLocal) variables
"""
def outer():
x = 'python'
/ tis x refers to the one in outer's scope', this nonlocal variable x is called a free variab... |
# Função de Contador
'''Faça um programa que tenha uma FUNÇÃO
chamada contador(), que receba três PARÂMETROS:
INÍCIO, FIM e PASSO e realize a contagem. Seu
programa tem que realizar TRÊS CONTAGENS através
da função criada:
a) De 1 até 10, de 1 em 1
b) De 10 até 0, de 2 em 2
c) Uma contagem PERSONALIZADA'''
from time i... |
import sys
import subprocess
from .yamato_utils import get_base_path, get_unity_executable_path
def main():
base_path = get_base_path()
print(f"Running in base path {base_path}")
unity_exe = get_unity_executable_path()
print(f"Starting tests via {unity_exe}")
test_args = [
unity_exe,
... |
import numpy as np
import scipy
import theano
from theano import gof, scalar, tensor
from theano.sparse import basic as sparse
from theano.sparse.basic import (
CSC,
CSR,
csm_data,
csm_grad,
csm_indices,
csm_indptr,
csm_properties,
usmm,
)
from theano.tensor import blas
from theano.tens... |
import json
import os
import sys
import numpy as np
import random
import math
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
from env import R2RBatch
from utils import padding_idx, add_idx, Tokenizer
import utils
import model
... |
import os.path
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.auth import get_user_model
from avatar.settings import AVATAR_DEFAULT_URL, AVATAR_MAX_AVATARS_PER_USER
from avatar.util import get_primary_avatar
from avatar.models import... |
"""Python Script Template."""
from abc import ABCMeta
import torch
from hucrl.policy.augmented_policy import AugmentedPolicy
from rllib.policy import AbstractPolicy, NNPolicy
class AdversarialPolicy(AbstractPolicy, metaclass=ABCMeta):
"""Given a protagonist and an antagonist policy, combine to give a joint polic... |
#
# Copyright (c) 2015, Adam Meily <meily.adam@gmail.com>
# Pypsi - https://github.com/ameily/pypsi
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
... |
# -*- coding: utf-8 -*-
import itertools as itt
import logging
import re
from pyparsing import (
And, Group, Suppress, White, Word, ZeroOrMore, alphanums, dblQuotedString, delimitedList, oneOf, removeQuotes,
replaceWith,
)
from ..constants import OBJECT, RELATION, SUBJECT
log = logging.getLogger('pybel')
r... |
# This code is based on code from OpenAI baselines. (https://github.com/openai/baselines)
import os.path as osp
from tqdm import tqdm
from time import time
from collections import deque
import pickle
import dill
import tensorflow as tf
import numpy as np
from common.schedules import LinearSchedule, ConstantSchedule
fr... |
# Copyright (c) 2020, DCSO GmbH
from typing import TypeVar, Tuple, Union
import os
TIE_API = os.getenv("TIE_API", "https://tie.dcso.de/api/v1")
TIE_TOKEN = os.getenv("TIE_TOKEN", "")
TEST_API = "http://unittest.local/api"
# ATimeout is a typing alias accepting either a int or float, or
# a 2-element long tuple cons... |
# Copyright 2016 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
import turtle
tortuguita = turtle.Turtle()
fondo=turtle.Screen()
fondo.bgcolor("light pink")
# M
tortuguita.pencolor("red")
tortuguita.pensize(13)
tortuguita.shape("turtle")
tortuguita.left(90)
tortuguita.forward(100)
tortuguita.right(130)
tortuguita.forward(100)
tortuguita.left(100)
tortuguita.forward(100)
tortugui... |
# PyZX - Python library for quantum circuit rewriting
# and optimization using the ZX-calculus
# Copyright (C) 2018 - Aleks Kissinger and John van de Wetering
# 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 ... |
"""
This component provides HA sensor support for Ring Door Bell/Chimes.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.ring/
"""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_va... |
#!/usr/bin/python
import sys
import os
import subprocess
import glob
typ = sys.argv[1]
if(typ=="mpi"):
for testname in glob.glob('*test'):
subprocess.call('mpirun -np 4 '+testname, shell=True )
sys.stdout.flush()
elif(typ=="serial"):
for testname in glob.glob('*test'):
subprocess.call('./'+test... |
'''
* Copyright (C) 2019-2020 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
'''
from http import HTTPStatus
import connexion
from vaserving.common.utils import logging
from vaserving.vaserving import VAServing
logger = logging.get_logger('Default Controller', is_static=True)
bad_request_response = ... |
# 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 torch
import torch.nn as nn
class TransformerNetworkV2(nn.Module):
"""
Feedforward Transformation NetworkV2
- No Tanh
+ Using Fully Pre-activated Residual Layers
"""
def __init__(self):
super(TransformerNetworkV2, self).__init__()
self.ConvBlock = nn.Sequent... |
import socket
import random
#port = 80
ports = [80,22,21,23,8080,443,53,145,139,25,88,20,1337,3306,445]
count = 0
global status
status = False
def attack(ip):
global status
status = True
while status:
for source_port in ports:
global status
if status:
try:
s = soc... |
"""Tests for spiketools.utils.timestamps"""
import numpy as np
from spiketools.utils.timestamps import *
###################################################################################################
###################################################################################################
def test_co... |
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class down(nn.Module):
def __init__(self, inChannels, outChannels, filterSize):
super(down, self).__init__()
self.c... |
import os
import pkg_resources
import uncoverml
__author__ = 'Geoscience Australia, Mineral Systems Branch, ' \
'NICTA Spatial Inference Systems Team (now Data 61)'
__email__ = 'daniel.steinberg@nicta.com.au, basaks@gmail.com, brenainn.moushall@ga.gov.au'
__version__ = pkg_resources.get_distribution('unc... |
import pandas
import os
# at first we create a csv if doesn't exist after we overwrited with all the words we found in the websites follow it
# by their frequency in every url.
from Index import Index
def write_a_csv(obj):
val = list()
if not os.path.exists('Inverted Index.csv'):
open('Inverted Ind... |
"""
Get information about the network.
In this case, we are interested in a small set of neurons. We go through each of
the neurons and get connectivity information about each connection it has with
another cell.
This type of script could be useful for visualizing data, generating reports,
or any number programmatic ... |
import logging
from time import sleep
from typing import List
from celery import group
from celery.schedules import crontab
from django.conf import settings
from apps.core.models import SiteConfig
from memes_reposter.celery import app as celery_app
from memes_reposter.telegram_bot import bot
from .fetcher import fetc... |
import numpy as np
import utils
import copy
from rectangular_world import RectangularWorld
class Player():
def __init__(self, world, stop_and_click):
self.curr_background = 0
self.avg_score = 0
self.total_points = 0
self.avg_score_last_half = 0
self.world = world
... |
# boot.py -- run on boot-up
import os
import machine
from network import WLAN
uart = machine.UART(0, 115200)
os.dupterm(uart)
wlan = WLAN(mode=WLAN.STA)
if not wlan.isconnected():
wlan.connect(ssid='SLOW2', auth=(WLAN.WPA2, '7dVV5twSLx4E'), timeout=5000)
while not wlan.isconnected():
machine.idle()
... |
import structlog
from typing import Dict, Set
from itertools import combinations
from nomenklatura import Resolver
from nomenklatura.judgement import Judgement
from opensanctions.core.dataset import Dataset
from opensanctions.core.context import Context
from opensanctions.core.loader import Database
from opensanctions... |
import enum
class Place(enum.Enum):
spool = enum.auto()
archive = enum.auto()
|
class Map:
def __init__(self, func):
self.func = func
def __ror__(self, iterable):
for obj in iterable:
yield self.func(obj)
class Filter:
def __init__(self, func):
self.func = func
def __ror__(self, iterable):
for obj in iterable:
if self.func(ob... |
from datetime import datetime
import dateutil
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs.ccalendar import DAYS, MONTHS
from pandas._libs.tslibs.period import IncompatibleFrequency
from pandas.errors import InvalidIndexError
import pandas as pd
from pandas import DataFrame, Series, Timestam... |
import re
import os
import socket
from threading import Thread
import ssl
from tiny_test_fw import DUT
import ttfw_idf
try:
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
except ImportError:
import http.server as BaseHTTPServer
from http.server import SimpleHTTPRequestHand... |
class BadSolutionException(Exception):
def __init__(self, message):
self.message = message
class SyntaxException(BadSolutionException):
def __init__(self, message):
super().__init__(message)
class ExitException(BadSolutionException):
def __init__(self, message):
super().__init__... |
#!/usr/bin/env python3
from FWCore.ParameterSet.Types import PSet
import FWCore.ParameterSet.Config as cms
class RunType(PSet):
def __init__(self,types=['pp_run','pp_run_stage1','cosmic_run','cosmic_run_stage1','hi_run','hpu_run','commissioning_run']):
PSet.__init__(self)
self.__runTypesDict = {}
t=[(x,ty... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
Tests for node, nodefunction and the like
"""
from micropsi_core.nodenet.node import Nodetype
from micropsi_core.nodenet.nodefunctions import neuron, concept
import pytest
def test_node_name_defaults(runtime, test_nodenet, resourcepath):
import os
netapi =... |
# Solution to day 5 of AOC 2015, Doesn't He Have Intern-Elves For This?
# https://adventofcode.com/2015/day/5
import re
import string
def is_nice1(check: str) -> bool:
"""Return true iff string is 'nice' using Part 1 rules."""
# "It does not contain the strings ab, cd, pq, or xy, even if they are part of on... |
from .Converter import convert
from .Errors import GromosFormatError, IllegalArgumentError
|
# -* coding: utf-8 -*
from pycparser import c_ast
class Enumerator:
'''A value in a enum'''
def __init__(self, name, value):
self.name = name
self.value = value
class Enum:
'''Class representing a C enum'''
def __init__(self, name):
self.name = name
self.enumerators ... |
PANDAS_TOCSV_KWARGS = [
"path_or_buf",
"sep",
"na_rep",
"float_format",
"columns",
"header",
"index",
"index_label",
"mode",
"encoding",
"compression",
"quoting",
"quotechar",
"line_terminator",
"chunksize",
"tupleize_cols",
"date_format",
"doubleq... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
----------
Script to package original MLS dataset into a form readable in
wav2letter++ pipelines
Command : python3 p... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 12 13:18:12 2018
Author: Josef Perktold
"""
from statsmodels.compat.pandas import testing as pdt
import os.path
import numpy as np
from numpy.testing import assert_allclose
import pandas as pd
import pytest
from statsmodels.regression.linear_model import OLS
from stats... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2020—2021 Mergify SAS
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.seria... |
#!/usr/bin/env python2
#
# Copyright 2011-2016 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 applicabl... |
# tag_binds.py
import logging
from rackio import Rackio, TagEngine
from rackio import RackioStateMachine, State, TagBinding
from rackio.models import Model, FloatType, IntegerType, BooleanType
from random import random
app = Rackio()
tag_egine = TagEngine()
# Tags definitions
tag_egine.set_tag("T1", "float")
ta... |
#!/usr/bin/env python
import io
import os
import re
import sys
import time
import json
import socket
import locale
import logging
import argparse
import ssl
from http import cookiejar
from importlib import import_module
from urllib import request, parse, error
from .version import __version__
from .util import log, t... |
import okta
from flask_oidc import OpenIDConnect
from okta.framework.ApiClient import ApiClient
from okta.framework.Utils import Utils
from okta.models.auth.AuthResult import AuthResult
oidc = OpenIDConnect()
def get_okta_client(app, service, *args, **kwargs):
CLIENT_MAPPING = {
"app_instance": okta.AppI... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class ZhimaCreditEpRatingApplyResponse(AlipayResponse):
def __init__(self):
super(ZhimaCreditEpRatingApplyResponse, self).__init__()
def parse_response_content(... |
import logging
import os
from flask import Flask
from flask_bcrypt import Bcrypt
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.engine import Engine
from sqlalchemy import event
from .config import config_by_name
db = SQLAlchemy()
flask_bcrypt = Bcrypt()
def create_app() -> Flask:
"""Create the flask... |
#!/usr/bin/env python
from iris_sdk.models.base_resource import BaseData
from iris_sdk.models.maps.dlda import DldaMap
from iris_sdk.models.data.dlda_tn_groups import DldaTnGroups
from iris_sdk.models.data.error_list import ErrorList
class DldaData(DldaMap, BaseData):
@property
def count_of_tns(self):
... |
"""
This script demonstrates how to load the pretrained numpy weights
(we use icnet_cityscapes_trainval_90k_bnnomerge.npy specifically) from
https://github.com/hellochick/ICNet-tensorflow and use them to perform
inference with ICNet on cityscapes images.
"""
import argparse
import os
import cv2
import numpy as np
imp... |
"""
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 3.0.6.
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/
"""
imp... |
import alabaster as theme
import os
project = 'MNMLSTC Flyweight'
copyright = 'MNMLSTC'
version = '1.0'
release = '1.0'
highlight_language = 'cpp'
html_static_path = ['static']
html_theme_path = [theme.get_path()]
html_theme = 'alabaster'
html_theme_options = { 'show_powered_by' : False }
html_style = 'theme.css'
h... |
# -*- coding: utf-8 -*-
import bpy
from bpy.types import Operator
from mmd_tools_local import register_wrap
from mmd_tools_local.core.model import Model
from mmd_tools_local.core.sdef import FnSDEF
def _get_selected_objects(context):
selected_objects = set(i for i in context.selected_objects if i.type == 'MESH')... |
"""
Copyright 2019 Goldman Sachs.
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 di... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.