text stringlengths 2 999k |
|---|
# Copyright (C) 2017-2019 Tormod Landet
# SPDX-License-Identifier: Apache-2.0
import sys
import os
from ocellaris import Simulation, setup_simulation
TEST_DIR = os.path.dirname(__file__)
# Dummy values to make setup_simulation() run without errors
DUMMY = """
ocellaris:
type: input
version: 1.0
solver: {ty... |
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['LinearTrend'] , ['Seasonal_DayOfWeek'] , ['SVR'] ); |
from typing import List, Optional, Tuple, Union
import numpy as np
from transformers import *
from summarizer.bert_parent import BertParent
from summarizer.cluster_features import ClusterFeatures
from summarizer.sentence_handler import SentenceHandler
class ModelProcessor(object):
aggregate_map = {
'me... |
# Generated by Django 3.1.12 on 2021-07-08 17:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comparer', '0006_policycategory_slug'),
]
operations = [
migrations.AlterField(
model_name='policycategory',
name='... |
from tkinter import *
from tkinter import ttk, filedialog
from gramatica import run_method
from ARBOL_AST.Arbol import *
import pathlib
# Se crea una clase para la interfaz grΓ‘fica
class mainWindow:
# Se recibe como parΓ‘metro el root
def __init__(self, master):
# Area de EdiciΓ³n
self.textArea... |
class link(object):
class nn(object):
class SyncBatchNorm2d(object):
...
class syncbnVarMode_t(object):
class L2(object):
...
class linklink(object):
class nn(object):
class SyncBatchNorm2d(object):
...
|
from .base import BaseTestCase
from .models import EmailUser
from django.forms import ValidationError
from elevate.forms import ElevateForm
class ElevateFormTestCase(BaseTestCase):
def setUp(self):
super(ElevateFormTestCase, self).setUp()
self.login()
def test_integration_empty(self):
... |
# coding=utf-8
import comply.rules.standard
import comply.rules.experimental
|
import numpy as np
import math
def line_length(line):
'''
Function to return length of line
@param line: iterable containing two two-ordinate iterables, e.g. 2 x 2 array or 2-tuple of 2-tuples
@return length: Distance between start & end points in native units
'''
return math.sqrt(math.pow(lin... |
import abc
from pathlib import Path
from typing import Union, Protocol, TypeVar
from flexlate.template.base import Template
from flexlate.template_config.base import TemplateConfig
T = TypeVar("T", bound=Template)
# TODO: figure out how to type TemplateFinder properly
class TemplateFinder(Protocol[T]): # type: igno... |
#!/usr/bin/env python
import os
import shutil
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
from test.utils import AbstractCatkinWorkspaceTest, MOCK_DIR, \
MAKE_CMD, succeed, assert_exists, fail
import em
import sys
import stat
import unittest
import tempfile
class Mock... |
"""Build vocabularies of words and labels from datasets"""
import argparse
from collections import Counter
import json
import os
parser = argparse.ArgumentParser()
parser.add_argument('--min_count_word', default=1, help="Minimum count for words in the dataset", type=int)
parser.add_argument('--min_count_tag', defaul... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
# Tests for kernels detection
import dace
import numpy as np
import pytest
from dace.transformation.interstate import FPGATransformSDFG, InlineSDFG
def count_kernels(cachedir: str):
'''
Test utility functions: Counts the number of g... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/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.
from test_framework.test_framework import quirkyturtcoinTestFramework
from test_framework.util import (
... |
import json
from unittest import TestCase
from unittest.mock import Mock, patch, call
from nose_parameterized import parameterized
from samcli.lib.logs.formatter import LogsFormatter, LambdaLogMsgFormatters, KeywordHighlighter, JSONMsgFormatter
from samcli.lib.logs.event import LogEvent
class TestLogsFormatter_pret... |
#define an integer
i = 0
#while i is less than 119, print current i val, add 10 to i
while(i<119):
print(i)
i += 10 |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... |
# -*- coding: utf-8 -*-
"""Samila generative image."""
import random
import itertools
import matplotlib
import matplotlib.pyplot as plt
from .functions import _GI_initializer, plot_params_filter, generate_params_filter
from .functions import float_range, save_data_file, save_fig_file, save_fig_buf, save_config_file
fro... |
from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class ScorecardHistoryRemote(RemoteModel):
"""
This table list out the entries of Scorecard history.
| ``Component:`` The issue component (Devices, Configuration, VLANs, etc.).
| ``attribute type:``... |
import copy
import math
import diff_match_patch as dmp_module
import yaml
class Blupdate:
"""
This class represents an update in the base layer. It is used to recompute the existing layers into the new base layer.
When you want to update the base layer to a new text, initialize the class with the content... |
# -*- coding: utf-8 -*-
# Copyright 2017 Red Hat, 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 r... |
from genshi.builder import tag
from trac.core import implements,Component
from trac.ticket.api import ITicketActionController
from trac.perm import IPermissionRequestor
revision = "$Rev: 6326 $"
url = "$URL: http://svn.edgewall.org/repos/trac/tags/trac-0.12.2/sample-plugins/workflow/DeleteTicket.py $"
class... |
from pandasdmx.source import add_source, list_sources, sources
def test_list_sources():
source_ids = list_sources()
assert len(source_ids) >= 16
# Listed alphabetically
assert source_ids[0] == "ABS"
assert source_ids[-1] == "WB_WDI"
def test_source_support():
# Implicitly supported endpoin... |
from django.utils.translation import ugettext
import jinja2
from django_jinja import library
from olympia.amo.utils import chunked
from .. import buttons
library.global_function(buttons.install_button)
library.global_function(buttons.big_install_button)
@library.filter
@jinja2.contextfilter
def statusflags(cont... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PyQt5 import QtCore
def sizeTable( qTableObject ):
''' ΠΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ ΠΎΠ±ΡΠ΅ΠΊΡ QSize Ρ Π³Π°Π±Π°ΡΠΈΡΠ°ΠΌΠΈ ΡΠ°Π±Π»ΠΈΡΡ '''
#Π ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅ ΠΈΠ·Π½Π°ΡΠ°Π»ΡΠ½ΡΡ
ΡΠ°Π·ΠΌΠ΅ΡΠΎΠ² Π·Π°Π΄Π°Π΅ΠΌ Π²ΡΡΠΎΡΡ Π³ΠΎΡΠΈΠ·ΠΎΠ½ΡΠ°Π»ΡΠ½ΡΡ
Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΎΠ²+2 ΠΈ ΡΠΈΡΠΈΠ½Ρ Π²Π΅ΡΡΠΈΠΊΠ°Π»ΡΠ½ΡΡ
Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΎΠ²+2
h = qTableObject.horizontalHeader().heig... |
#!/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 parlai.core.teachers import FixedDialogTeacher
from .build import build
from parlai.utils.io import PathManager
imp... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
import subprocess
import os
from tempfile import gettempdir
from io import BytesIO
from flask import send_file
class BaseCompiler:
def compile(self, template_name, document):
raise NotImplementedError()
class SendFileCompiler(BaseCompiler):
"""A simple compiler that tries to send the compiled temp... |
# Generated by Django 3.0.7 on 2020-06-24 01:25
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('catalog', '0001_initial'... |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 ... |
import asyncio
import logging
import sys
from aiosubprocess import Process
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)-15s %(levelname)s:%(name)s:%(message)s",
stream=sys.stdout,
)
loop = asyncio.get_event_loop()
reader = Process(
"""for i in {1..5}
do
echo "Hello $i World... |
# Copyright 2018 The Cirq Developers
#
# 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 ... |
"""Setup file
"""
import setuptools
import pelican_cite_nice
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(name='pelican_cite_nice',
version=pelican_cite_nice.__version__,
description='Pelican cite plugin modified to work with nice-blog them... |
from kivy.factory import Factory
from kivy.properties import NumericProperty, BooleanProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from cobiv.modules.core.component import Component
class StatusLabel(Component, Label):
def __init__(self, **kwargs):
super(StatusLabel, ... |
# εΏ«ιζεΊ
def swap(arr, l, r):
temp = arr[l]
arr[l] = arr[r]
arr[r] = temp
def quicksort(arr, l, r):
# ιεΊζ‘δ»Άε³δΈΊοΌδΈδΈζ¬‘ηε°δΊεΊηleftδΈΊζ¬ζ¬‘lηrοΌεδ»δ»¬ιεεεΏ
ηΆζεΊοΌιεΊ
# rigthεη
if l < r:
p = partition(arr, l, r)
quicksort(arr, l, p[0]-1)
quicksort(arr, p[1]+1, r)
return arr
def partition(arr... |
def test_get(session, group):
from dispatch.group.service import get
t_group = get(db_session=session, group_id=group.id)
assert t_group.id == group.id
def test_get_all(session, groups):
from dispatch.group.service import get_all
t_groups = get_all(db_session=session).all()
assert len(t_grou... |
from collections import OrderedDict
import io
import os
from typing import Any
import xmltodict
import openml
from .. import config
from .setup import OpenMLSetup, OpenMLParameter
from openml.flows import flow_exists
import openml.exceptions
import openml.utils
def setup_exists(flow) -> int:
"""
Checks whet... |
# Leetcode
# 83. Remove Duplicates from Sorted List
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListNode]:
if not head: ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 9 10:07:34 2018
@author: lucas
"""
import pandas as pd
#from ASAP_essay import ASAP_essay
import ASAP_essay as asap
from textstat.textstat import textstat
from py4j.java_gateway import JavaGateway
# Primeiramente iniciamos a conexΓ£o com java para extraΓ§Γ£o de erros gra... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 7 10:12:13 2019
@author: edoardottt
version = 1.3.3.3
This is the main file.
This file must be execute from the command line because
It has to read the input arguments (via getopt).
It searches for tweet links found in your personal Feed
via search input ... |
# -*- coding: utf-8 -*-
from mock import patch, MagicMock
from typing import Optional, Text
from zerver.lib.webhooks.git import COMMITS_LIMIT
from zerver.lib.test_classes import WebhookTestCase
class GitlabHookTests(WebhookTestCase):
STREAM_NAME = 'gitlab'
URL_TEMPLATE = "/api/v1/external/gitlab?&api_key={api... |
# Generated by Django 2.0.7 on 2018-12-10 21:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('FAIRshakeAPI', '0009_auto_20181210_2152'),
]
operations = [
migrations.RemoveField(
model_name='answer',
name='answer_tmp',
... |
import copy
from aerosandbox import *
opti = cas.Opti() # Initialize an optimization environment
def variable(init_val, lb=None, ub=None):
"""
Initialize attrib_name scalar design variable.
:param init_val: Initial guess
:param lb: Optional lower bound
:param ub: Optional upper bound
:retur... |
# -*- coding: utf-8 -*-
import decimal
import hashlib
import json
import zipfile
from io import BytesIO
from M2Crypto import BIO
from M2Crypto import SMIME
from M2Crypto import X509
from M2Crypto.X509 import X509_Stack
from future.builtins import bytes
from future.builtins import str
class Alignment:
... |
from typing import Union, List, Optional
from pyspark.sql.types import StructType, StructField, StringType, ArrayType, DataType
# This file is auto-generated by generate_schema so do not edit manually
# noinspection PyPep8Naming
class StructureDefinition_DifferentialSchema:
"""
A definition of a FHIR structu... |
from setuptools import setup
REQUIRED = ['humanfriendly', 'redis', 'six', 'tabulate']
setup(name='pyrau',
version='0.1',
description='Redis administration utility',
url='https://github.com/alanc10n/pyrau',
author='Alan Christianson',
author_email='git@c10n.net',
license='MIT',
packages=['p... |
import os
from os.path import join
class Report:
def __init__(self, path, results, report_file_name):
self._path = path
self._results = results
self.html = """
<!doctype html>
<html>
<head>
<title>Verify results</title>
<link href="https://cd... |
import numpy as np
def expspace(start, stop, num=50, out=int, base=1):
"""Exponential range.
Creates a list of integer values (by default) of a given length from start to stop, spread by
an exponential function.
Parameters
----------
start : int
Minimum range values.
stop : int
... |
import datetime
import hashlib
import io
import json
import os
import random
import requests
import shutil
import string
import tempfile
import time
import unittest
from utils import generate_rand_string
from OTXv2 import OTXv2, OTXv2Cached, InvalidAPIKey, BadRequest, RetryError, NotFound
import IndicatorTypes
from pa... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import mock
from libs.test_results.gtest_test_results import GtestTestResults
from libs.test_results.blink_web_test_results import BlinkWebTes... |
# These are just things that allow me to make tables for PostgreSQL easier
# This isn't exactly good. It's just good enough for my uses.
# Also shoddy migration support.
from pathlib import Path
import json
import os
import pydoc
import uuid
import datetime
import inspect
import decimal
#import asyncpg
import logging
... |
# -*- coding: utf-8 -*-
# Exercise 2: Run TauDEM functions with PyGeoC
from pygeoc.TauDEM import TauDEM
def pitremove_simple_usage():
"""Simple usage of pitremove.
Workspace will be set as the base directory of input file.
"""
dem = '../tests/data/Jamaica_dem.tif'
fel = '../tests/data/... |
from django.urls import path,include
from testapp import views
urlpatterns = [
path('kun1', views.kun1),
]
|
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-08 07:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0011_collectionarticle'),
]
operations = [
migrations.RemoveField(
... |
from script_utils import (
create_compile_command,
create_deploy_command,
write_result_to_storage,
run_command,
signer,
)
account_path = "lib/openzeppelin/contracts/Account"
account = "Account"
signer = signer()
c_cmd = create_compile_command(account_path, account)
x = run_command(c_cmd)
d_cmd =... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivati... |
# 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... |
# Generated by Django 2.1.7 on 2019-04-02 14:54
from django.conf import settings
import django.core.files.storage
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings... |
import record_keeper
def test___init__():
"""check record-keeper exposes a version attribute."""
assert hasattr(record_keeper, "__version__")
assert isinstance(record_keeper.__version__, str)
|
"""
Copyright (c) 2019, Nils P. MΓΌller <shimst3r@gmail.com>
All rights reserved.
This file is part of dodeka.
`factors.py` implements the functionality for generating the
twelve-factor app checklist.
License: MIT, see https://opensource.org/licenses/MIT
"""
import os.path
from dataclasses import dataclass
from typi... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Justyna Janczyszyn <justyna.janczyszyn@gmail.com>
#
# this file is part of the project "JJ HTTPBin Client" released under the "MIT" open-source license
import json
import httpretty
from jj_httpbin import HttpBinClient
@httpretty.httprettified
def test_httpbinclient_post()... |
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
"""Computational algebraic field theory. """
from functools import reduce
from sympy import (
S, Rational, AlgebraicNumber, GoldenRatio, TribonacciConstant,
Add, Mul, sympify, Dummy, expand_mul, I, pi
)
from sympy.functions import sqrt, cbrt
from sympy.core.exprtools import Factors
from sympy.core.function i... |
# Copyright 2017-2019 BigML
#
# 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, s... |
# SPDX-FileCopyrightText: Tony DiCola 2017 for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_is31fl3731`
====================================================
CircuitPython driver for the IS31FL3731 charlieplex IC.
* Author(s): Tony DiCola, Melissa LeBlanc-Williams
Implementation Notes
--------... |
# language settings
# TODO: let's tidy this setting file, move this to a new file and load from there
from django.utils.translation import gettext_lazy as _
LANGUAGE_OPTIONS = [
("af", _("Afrikaans")),
("ar", _("Arabic")),
("ar-dz", _("Algerian Arabic")),
("ast", _("Asturian")),
("az", _("Azerbaij... |
###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... |
import json
import datetime
def datetime2string(o):
if isinstance(o, datetime.datetime):
return o.__str__()
def datetime2string_mm_dd(o):
if isinstance(o, datetime.datetime):
return o.strftime('%m-%d')
Success = 200
LoginFailed = 900
NeedLogin = 901
QuickLoginFailed = 902
APINotExist = 10... |
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import viewsets, mixins, status,views
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import PuntoInteres, Restaurante, Rep... |
import os
import pickle
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, DataLoader
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from utils.timefeatures import time_features
import warnings
warnings.filterwarnings('ignore')
class Dataset_ETT_hour(Dataset)... |
from lxml import etree as ET
from .data import Page
class XMLWriter:
@staticmethod
def write(page: Page, filename: str):
self = XMLWriter
root = ET.Element("document")
tree = ET.ElementTree(root)
self._addElement(
root,
"xmlns",
"http://www... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
# Get version fr... |
from .base import Element
class Div(Element):
tagName = 'div'
class P(Element):
tagName = 'p'
class Img(Element):
tagName = 'img'
class A(Element):
tagName = 'a'
class ElementSet:
div = Div
p = P
img = Img
|
# --------------------------------------------------------------------------
# Copyright 2012 Orson Peters. All rights reserved.
#
# Redistribution of this work, with or without modification, is permitted if
# Orson Peters is attributed as the original author or licensor of
# this work, but not in any way that suggests... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You(youansheng@gmail.com)
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd imp... |
from project_need_for_speed.vehicle import Vehicle
class Car(Vehicle):
DEFAULT_FUEL_CONSUMPTION = 3.00
|
# %%
"""
# Project - Word Cloud
"""
# %%
"""
For this project, you'll create a "word cloud" from a text by writing a script. This script needs to process the text, remove punctuation, ignore case and words that do not contain all alphabets, count the frequencies, and ignore uninteresting or irrelevant words. A dicti... |
import os
import torch
import torch.nn as nn
import torchvision.transforms as transforms
# from util.image_pool import ImagePool
# from .base_model import BaseModel
# from . import networks
import numpy as np
import functools
from torchvision import models
from collections import namedtuple
class VGG16(torch.nn.Module... |
#
# 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... |
import time
from pathlib import Path
from typing import Dict, List
from urllib.parse import urlparse
from instagrapi.exceptions import (
AlbumConfigureError,
AlbumNotDownload,
AlbumUnknownFormat,
)
from instagrapi.extractors import extract_media_v1
from instagrapi.types import Location, Media, Usertag
from... |
import FWCore.ParameterSet.Config as cms
from HeavyIonsAnalysis.JetAnalysis.jets.akPu3CaloJetSequence_PbPb_mc_cff import *
#PU jets: type 10
akPu3Calomatch10 = akPu3Calomatch.clone(src = cms.InputTag("akPu3CaloJets10"))
akPu3Caloparton10 = akPu3Caloparton.clone(src = cms.InputTag("akPu3CaloJets10"))
akPu3Calocorr10 =... |
import json
from collections import defaultdict, OrderedDict
import ocdsmerge
from .base import BaseCommand
class Command(BaseCommand):
name = 'compile'
help = 'reads release packages from standard input, merges the releases by OCID, and prints the compiled releases'
def add_arguments(self):
se... |
from src.trainers.base import BaseTrainer
from src.models.model import choose_model
from src.models.worker import LrdWorker
from src.optimizers.gd import GD
import numpy as np
import torch
criterion = torch.nn.CrossEntropyLoss()
class FedAvg4Trainer(BaseTrainer):
"""
Scheme I and Scheme II, based on the fla... |
import os
def find_folders(xpath):
result = []
listdir = os.listdir(xpath)
print('ListDIR', listdir)
'''
for filename in listdir: # loop through all the files and folders
if os.path.isdir(
os.path.join(os.path.abspath("."), filename)): # check whether the current object... |
_base_ = [
'../_base_/models/flownets.py',
'../_base_/datasets/flyingchairs_384x448.py',
'../_base_/schedules/schedule_s_long.py', '../_base_/default_runtime.py'
]
|
from questions_three.constants import TestEvent
from questions_three.event_broker import EventBroker
from questions_three.exceptions import TestSkipped
from .runnable_suite import RunnableSuite
class TestRunner:
def __init__(self, suite_name, suite_attributes, test_name):
self.suite_name = suite_name
... |
"""
Organize results into a single CSV.
"""
import os
import sys
import argparse
from datetime import datetime
from itertools import product
import numpy as np
import pandas as pd
from scipy.stats import sem
from tqdm import tqdm
here = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, here + '/../')
from... |
## Pok On Cheng 74157306. ICS 32 Lab 1 Project 5.
import tkinter
import OthelloGameLogic
from math import ceil
DEFAULT_FONT = ('Times New Roman', 12)
class CreatingOthelloGUI:
def __init__(self):
self._creating_GUI = tkinter.Toplevel()
ask_row1_label = tkinter.Label(master = self._cr... |
_base_ = './mask_rcnn_swin-t-p4-w7_fpn_ms-crop-3x_coco.py'
# you need to set mode='dynamic' if you are using pytorch<=1.5.0
fp16 = dict(loss_scale=dict(init_scale=512))
|
from .version import *
from .some_class import *
from ..common_const import * |
from base.managers import QuerySet
class {{model_name}}QuerySet(QuerySet):
def search(self, query):
"""
Search {{model_name}} objects by name
"""
if query:
# TODO implement this method, since this is an example
return self.filter(
name__unac... |
# Copyright 2020 The Q2 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-09-14 20:33
from abc import ABC
from typing import Union, Any, Tuple, Iterable
import tensorflow as tf
from hanlp.components.taggers.transformers.transformer_transform import TransformerTransform
from hanlp.common.transform import Transform
from hanlp.common.compo... |
from more_itertools import unique_everseen
from collections import Counter
from lxml import etree
import pandas as pd
import numpy as np
from iteration import *
import os
def save_yearly_data(years, dirin, dirout):
all_data = []
for y in years:
paths = []
rootdir = dirin+str(y)+'/'
print(rootdir)
for subdir... |
from __future__ import print_function
from datetime import datetime
import pandas as pd
from pandas.util.testing import assert_frame_equal
import ulmo
import ulmo.usgs.eddn.parsers as parsers
import test_util
fmt = '%y%j%H%M%S'
message_test_sets = [
{
'dcp_address': 'C5149430',
'number_of_lines': ... |
""" Utility functions for creating and solving optimization problems """
import os
import logging
import time
import das_framework.ctools.clogging as clogging
import gurobipy as gb
import numpy as np
from constants import *
def getGurobiEnvironment(config, retries=10):
""" Create a new license environment
I... |
def urgent(shop_list, itm):
shop_list.insert(0, itm)
return shop_list
def unnecessary(shop_list, itm):
shop_list.remove(itm)
return shop_list
def correct(shop_list, itm, comm):
new_item = comm.split(" ")[2]
index_old_item = shop_list.index(itm)
shop_list[index_old_item] = new_item
re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.