input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>DevarshiChoudhury/xpsi<filename>xpsi/Everywhere.py<gh_stars>10-100
from __future__ import division, print_function
from .global_imports import *
from . import global_imports
from .cellmesh.global_mesh import construct_closed_cellMesh as _construct_closed_cellMesh
from .cellmesh.rays import compute_rays as _... | |
"""
This is a Variation of final.py for some experimentation
"""
import random
from pandemie.tester import AbstractStrategy
from pandemie.util import normalize_ranking, merge_ranking, operations, map_symbol_score
from pandemie.util import map_symbol_score as score, apply_weight
class Ruwen2(AbstractStrategy):
def _... | |
= None
self.CreateTime = None
self.BeginProcessTime = None
self.FinishTime = None
self.ProcedureTask = None
self.EditMediaTask = None
self.WechatPublishTask = None
self.ComposeMediaTask = None
self.SplitMediaTask = None
self.WechatMiniProgramPublishTask = None
self.PullUploadTask = None
self.TranscodeTask = ... | |
re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
class TypeConditionContext(ParserRuleContext):
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingStat... | |
import time
import random
import csv
import pandas as pd
import numpy as np
import gym
from stable_baselines3 import PPO
from stable_baselines3.ppo import MlpPolicy
from stable_baselines3.common.callbacks import EvalCallback
from gym import spaces, ObservationWrapper, RewardWrapper, ActionWrapper
import matplotlib.pypl... | |
with missing steps.")
for step in json_structure['steps']:
if step['status']['state'] != metadata_base.PipelineRunStatusState.SUCCESS:
raise exceptions.InvalidPipelineRunError(
"Pipeline run with '{expected_status}' status has a step with '{status}' status".format(
expected_status=metadata_base.PipelineRunStatusS... | |
<reponame>fyabc/NMT
#! /usr/bin/python
# -*- encoding: utf-8 -*-
"""Function of layers and their initializers.
1. Parameters of layers:
input_: a Theano tensor that represent the input.
params: the dict of (tensor) parameters.
prefix: string, the prefix layer name.
return: a Theano tensor that represent the output.... | |
<gh_stars>0
import numpy as np
from .pixel_wise_mapping import remap_using_correspondence_map
import torch
def create_border_mask(flow):
return get_gt_correspondence_mask(flow).float()
def get_gt_correspondence_mask(flow):
mapping = convert_flow_to_mapping(flow, output_channel_first=True)
if isinstance(mapping,... | |
import load_dataset
>>> dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
>>> dataset = dataset.sort("id")
>>> sampling_rate = dataset.features["audio"].sampling_rate
>>> processor = {processor_class}.from_pretrained("{checkpoint}")
>>> model = {model_class}.from_pre... | |
+ indent_fac
bot1y = -y_extent + indent_fac
bot2x = start + cross_width
bot2y = -y_extent + indent_fac
lcross1 = Line2D([top1x,bot2x],[top1y,bot2y],
linewidth=linewidth, color=color, zorder=12+zorder_add, linestyle=linestyle)
lcross2 = Line2D([top2x,bot1x],[top2y,bot1y],
linewidth=linewidth, color=color, zorde... | |
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A library to generate and store the manifests for cros builders to use.
"""
import cPickle
import fnmatch
import glob
import logging
import os
imp... | |
<gh_stars>0
"""
Copyright (c) 2018-2021 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... | |
#(c) Coded by <NAME> 2014
#Functions related with the XTCAV pulse retrieval
import logging
logger = logging.getLogger(__name__)
import numpy as np
import scipy.interpolate
import time
import cv2
import scipy.io
import math
import psana.xtcav.Constants as cons
import collections
import psana.xtcav.Spli... | |
import numpy as np
from keras.layers import *
from keras.layers.convolutional_recurrent import ConvRNN2D
from keras.layers.wrappers import Wrapper
from keras.legacy import interfaces
from keras import initializers, regularizers, constraints, activations
from keras.utils.generic_utils import has_arg, object_list_uid
fro... | |
and replace it with 'cf'
part_sql.append(f""", {', '.join(f'cf.{_.split(".")[-1]}' for _ in self.group_by)}""")
else:
part_sql.append(f", {', '.join(f'cf.{_}' for _ in self.group_by)}")
part_sql.append('FROM (SELECT')
part_sql.append('COALESCE(SUM(tran_tot), 0) AS tran_tot')
if self.group_by:
part_sql.append(f... | |
<filename>msgraph-cli-extensions/v1_0/identitydirmgt_v1_0/azext_identitydirmgt_v1_0/vendored_sdks/identitydirmgt/aio/operations/_domains_operations.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under ... | |
= None
rdata['reverse'] = None
else:
rdata['chr'] = x.reference_name
rdata['start'] = x.reference_start + 1
rdata['end'] = x.reference_end
rdata['reverse'] = x.is_reverse
rdata['probe'] = read_probe
rdata['umi'] = read_umi
pname = read_probe
if debug:
print('>', qname, '-', rindex, '(', rdata['probe'], '/',... | |
<gh_stars>10-100
import base64
import binascii
from collections import OrderedDict
from datetime import date, datetime, tzinfo
from typing import Iterable, List, Type, Union, Set, TypeVar, NewType, Dict
from . import tz
from .lang.STIXPatternParser import STIXPatternParser, ParserRuleContext
from .lang.STIXPatternVisi... | |
<filename>BacterialTyper/scripts/database_generator.py
#!/usr/bin/env python3
##########################################################
## <NAME> ##
## Copyright (C) 2019 <NAME>, IGTP, Spain ##
##########################################################
"""
This code prepares the database information fo... | |
<filename>src/h02_learn/train.py
import os
import sys
import numpy as np
import math
import csv
from tqdm import tqdm
import io
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import TensorDataset, DataLoader
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from h01_data.parse ... | |
one resource that matches each of the elements of `names`, then an error is returned.
:param int offset: The offset of the first resource to return from a collection.
:param list[str] policy_ids: A comma-separated list of policy IDs. If after filtering, there is not at least one resource that matches each of the elem... | |
<filename>symbolic_slimshot/ind_join.py
from symbolic_slimshot import algorithm
class IndependentJoin(object):
def __init__(self, query, subqueries, init=True):
self.query = query
self.subqueries = subqueries
self.genericConstantStr = None
self.genericConstantStrs = []
self.genericIdentifiers = set()
self.use... | |
modus == 'test':
global bn_term
gamma_bn, beta_bn = bn_term
global running_weight
print('...TEST MODE...\n')
for i in range(ls):
# v = weight_sum(u, weights[i])
# y = sigmoid(v)
if i == h:
v = weight_sum(u, running_weight[i])
y = activation(v, acto_mode)
else:
v = weight_sum(u, running_weight[i])
v = batch... | |
flowcell specific barcode rules information
:param flowcell_rule_id: An integer id for flowcell_barcode_rule table
:param platform_id: An integer id for platform table (foreign key)
:param flowcell_type: A required string as flowcell type name, allowed length 50
:param index_1: An optional enum list as index_1 spe... | |
<filename>deep_hipsc_tracking/plotting/styling.py
""" Styling tools for plots
* :py:class:`~set_plot_style`: The plot style context manager
* :py:class:`~colorwheel`: Infinitely iterable color wheel
"""
# Imports
import itertools
import pathlib
from contextlib import ContextDecorator
from typing import Tuple, List, ... | |
"""
These are the utilities used for text processing,
batching and tokenisation.
"""
import os
import sys
import re
import csv
import copy
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
csv.field_size_limit(sys.maxsize)
class WGDataset(Dataset):
"""
This class processes the Wi... | |
pattern = Struct(
"tDword" / Int32ul,
"modemPowerState" / Int32ul
)
@declare(guid=guid("9a6615a6-902a-4705-804b-57b8813089b8"), event_id=927, version=0)
class Microsoft_WindowsPhone_Net_Cellcore_CellManager_927_0(Etw):
pattern = Struct(
"rilRegStat" / Int32ul,
"rilSystemType" / Int32ul,
"szString" / WString
)... | |
# *****************************************************************************
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of sourc... | |
<gh_stars>10-100
import datetime
import json
import sqlalchemy
from sqlalchemy import and_, desc, func, or_, distinct
from rdr_service.census_regions import census_regions
from rdr_service.code_constants import PPI_SYSTEM
from rdr_service.dao.base_dao import BaseDao, UpdatableDao
from rdr_service.dao.code_dao import ... | |
<filename>Python/Graph.py
# --------------------------------------------------------
# This file holds all implantation's of the graph's
# and holds all the algorithms being used on the graph's
# --------------------------------------------------------
import math
class Vertex:
def __init__(self, val):
self.val = ... | |
-> DateTimeParser:
raise NotImplementedError
@property
@abstractmethod
def duration_parser(self) -> DateTimeParser:
raise NotImplementedError
@abstractmethod
def get_matched_time_range(self, source: str):
raise NotImplementedError
@abstractmethod
def get_swift_prefix(self, source: str) -> int:
raise NotIm... | |
<filename>hassio-google-drive-backup/tests/test_hasource.py
import asyncio
import pytest
from aiohttp.client_exceptions import ClientResponseError
from backup.config import Config, Setting, CreateOptions
from backup.const import SOURCE_HA
from backup.exceptions import (HomeAssistantDeleteError, SnapshotInProgress,
S... | |
# -*- coding: utf-8 -*-
"""
Tools for correcting energy-balance components to improve energy balance
closure and other data management, validation and scientific analysis tools.
"""
from pathlib import Path
import xarray
import numpy as np
import pandas as pd
from sklearn import linear_model
from sklearn.metrics im... | |
from __future__ import print_function
from builtins import zip
from builtins import str
from builtins import range
from past.builtins import basestring
from builtins import object
import os
import collections
import numpy as np
import pandas as pd
import datetime
from abc import ABCMeta
from osgeo import gdal, ogr, osr... | |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Representation stability analysis."""
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
from sklearn.metrics import pairwise_distances
rootpath = os.path.dirname(os.path.dirname(os.path.abspath(__file_... | |
<filename>photometry/photometry/prepare.py<gh_stars>0
#!/bin/env python
# -*- coding: utf-8 -*-
"""
Preparation for Photometry extraction.
.. codeauthor:: <NAME> <<EMAIL>>
"""
import os
import numpy as np
import h5py
from astropy.io import fits
import sqlite3
import logging
import re
import multiprocessing
from astro... | |
# lint-amnesty, pylint: disable=missing-module-docstring
import datetime
import copy
import json
import logging
import os
from lxml import etree
from lxml.etree import Element, ElementTree, XMLParser
from xblock.core import XML_NAMESPACES
from xblock.fields import Dict, Scope, ScopeIds
from xblock.runtime import KvsF... | |
+ mckin**4 - 2*mbkin**2*q_cut -
2*mckin**2*q_cut + q_cut**2)/mbkin**4)*(mbkin**6 - 7*mbkin**4*
mckin**2 - 7*mbkin**2*mckin**4 + mckin**6 - mbkin**4*q_cut -
mckin**4*q_cut - mbkin**2*q_cut**2 - mckin**2*q_cut**2 + q_cut**3))/mbkin**6 -
(12*mckin**4*np.log((mbkin**2 + mckin**2 - q_cut - mbkin**2*np.sqrt(0j +
(mb... | |
#
# dporules.py
#
# Author(s):
# <NAME> <<EMAIL>>
#
# Copyright (c) 2020-2021 ETH Zurich.
#
# 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
#... | |
<reponame>JonathanGailliez/azure-sdk-for-python<gh_stars>0
# 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 gen... | |
<filename>ganimides_server/ganimides_database/_database_ganimides_model copy.py
# coding=utf-8
#https://www.pythoncentral.io/sqlalchemy-orm-examples/
#https://towardsdatascience.com/sqlalchemy-python-tutorial-79a577141a91
#https://wakatime.com/blog/32-flask-part-1-sqlalchemy-models-to-json
#https://auth0.com/blog/sqlal... | |
0, 2),
),
fo.Sample(
filepath="image1.jpg",
created_at=datetime(1970, 1, 1, 0, 0, 3),
),
fo.Sample(
filepath="image1.jpg",
created_at=datetime(1970, 1, 1, 0, 0, 4),
),
]
dataset = fo.Dataset()
dataset.add_samples(samples)
# Get the second portion of the dates in the dataset
print(dataset.values(F("creat... | |
Format defined by RFC3339.
"""
return pulumi.get(self, "time_created")
@property
@pulumi.getter(name="timeUpdated")
def time_updated(self) -> str:
"""
The date and time the target was updated. Format defined by RFC3339.
"""
return pulumi.get(self, "time_updated")
@pulumi.output_type
class GetTargetsTargetCo... | |
'zh': u('\u56db\u5ddd\u7701\u4e50\u5c71\u5e02')},
'861808131':{'en': '<NAME>', 'zh': u('\u56db\u5ddd\u7701\u4e50\u5c71\u5e02')},
'861804366':{'en': '<NAME>', 'zh': u('\u5409\u6797\u7701\u767d\u57ce\u5e02')},
'861804365':{'en': '<NAME>', 'zh': u('\u5409\u6797\u7701\u767d\u57ce\u5e02')},
'861804362':{'en': '<NAME>', ... | |
import codewars_test as test
import random
MAX_COORDINATES = 1000
def line_crossing_area_solution(rectangle, line):
# Calculate rectangle width and height boundary lines
r_width = rectangle[0] - (rectangle[2] / 2), rectangle[0] + (rectangle[2] / 2)
r_height = rectangle[1] - (rectangle[3] / 2), rectangle[1] + (r... | |
<reponame>dionis/ABSA-DeepMultidomain<gh_stars>0
# -*- coding: utf-8 -*-
# file: train.py
# author: songyouwei <<EMAIL>>
# Copyright (C) 2018. All Rights Reserved.
import logging
import argparse
import math
import os
import sys
import time
import string
from time import strftime, localtime
from datetime import datetime... | |
<filename>src/silx/gui/plot/items/histogram.py
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2017-2021 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associ... | |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even... | |
# 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 use... | |
<gh_stars>0
#!/usr/bin/python
from compiler import HP4Compiler, CodeRepresentation
from p4_hlir.main import HLIR
import p4_hlir
from p4_hlir.hlir.p4_core import p4_enum
from p4_hlir.hlir.p4_tables import p4_table
from collections import OrderedDict
import argparse
import code
from inspect import currentframe, getframe... | |
i.e. -
# [["10:43:49", "d0ensrv1.fnal.gov", "bakken", "55,255", "samnull-1", "3.5", "0.035"]]
def body(self, data_list):
table = self.table_top()
self.append(table)
# now create the table with the data in it, first do the row with
# the headings
tr = HTMLgen.TR(valign="CENTER")
headings = ["Time", "Node", "User... | |
"""
geodata.py: contains functions to process geodata
@author: <NAME>, <NAME>
"""
import os
import osr
import glob
import gdal
import numpy as np
import pandas as pd
import rasterio
from rasterio.plot import show
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import colors
import matplotlib.p... | |
<reponame>liaoyuke/EECS542_Final_Project_VQA
# Natural Language Toolkit: Tree Transformations
#
# Copyright (C) 2005-2006 Oregon Graduate Institute
# Author: <NAME> <<EMAIL>>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
A collection of methods for tree (grammar) transformations used
in pa... | |
46 - 46: I1IiiI . OoooooooOO / iIii1I11I1II1 - ooOoO0o * OOooOOo
if 55 - 55: o0oOOo0O0Ooo + iIii1I11I1II1 / I11i
if 97 - 97: i11iIiiIii
def lisp_is_group_more_specific ( group_str , group_mapping ) :
o0OoO0000o = group_mapping . group_prefix . instance_id
iIi1iii1 = group_mapping . group_prefix . mask_len
O0o00oOO... | |
total_subsets: # no common subsets after filtering, so max dist
return 1
return 1 - (2 * intersection_length / float(total_subsets))
def compare_tip_distances(self, other, sample=None, dist_f=distance_from_r,
shuffle_f=np.random.shuffle):
"""Compares self to other using tip-to-tip distance matrices.
Value retu... | |
<reponame>kozmik-moore/Meta-Jurnl-0.3<filename>configurations.py
"""Classes and functions for manipulating and maintaining the application's configuration file(s)"""
from ast import literal_eval
from configparser import ConfigParser
from datetime import datetime
from os import getcwd
from os.path import exists, isdir, ... | |
<filename>FreeCAD_geometry_generation/freecad_apertures.py
from math import asin, atan, cos, pi, radians, sin, sqrt
from FreeCAD import Base, Units
import Part
from FreeCAD_geometry_generation.freecad_operations import rotate_cartesian
# This has to run using the FreeCAD built in python interpreter.
def make_racetra... | |
case.
Args:
tools_path (str): path to the plaso tools.
test_sources_path (str): path to the test sources.
test_references_path (str): path to the test references.
test_results_path (str): path to store test results.
debug_output (Optional[bool]): True if debug output should be generated.
"""
super(ExtractAndOu... | |
import warnings
class AtlasEntity():
"""
A python representation of the AtlasEntity from Apache Atlas.
:param str name: The name of this instance of an atlas entity.
:param str typeName: The type this entity should be.
:param str qualified_name: The unique "qualified name" of this
instance of an atlas entity.
... | |
<gh_stars>10-100
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.framework import ops
from tensorflow.python.training import optimizer
import tensorflow as tf
class Grad(optimizer.Optimizer):
def __init__... | |
<filename>bslib/xml.py
#encoding: utf-8
# bslib - parse xml from BuildService and return Python objects
# Copyright (c) 2014 <NAME><<EMAIL>>
# Licensed under MIT, see bslib/__init__.py
from __future__ import print_function
from __future__ import unicode_literals
from collections import namedtuple
from functools impo... | |
# coding=utf-8
# Copyright 2021 The Google Research 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 l... | |
<gh_stars>1-10
# Disable flake8 reporting
# flake8: noqa
from jose.jws import verify
expected_payload = b"It\xe2\x80\x99s a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there\xe2\x80\x99s no knowing where you might be swept off to."
# [Docs] [txt|pdf] [dr... | |
import inspect
from datetime import datetime
from enum import Enum
from functools import update_wrapper
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
from uuid import UUID
import click
from .models import (
AnyType,
ArgumentInfo,
CommandFunctionType,
... | |
"margin inline start": ["margin-inline-start: ;", Key("left")],
"margin left": ["margin-left: ;", Key("left")],
"margin right": ["margin-right: ;", Key("left")],
"margin top": ["margin-top: ;", Key("left")],
"marks": ["marks: ;", Key("left")],
"mask": ["mask: ;", Key("left")],
"mask type": ["mask-type: ;", Key("l... | |
<filename>projects/speech_translation/layers/transformer.py
import random
from typing import Optional, Dict, List
import torch
from torch import Tensor
from fairseq.modules.transformer_layer import TransformerDecoderLayer, TransformerEncoderLayer
from .attention import RelativePositioningMultiheadAttention
from .rela... | |
.. attribute:: term
Terminate stats
**type**\: :py:class:`Term <ydk.models.cisco_ios_xr.Cisco_IOS_XR_pbr_vservice_mgr_oper.GlobalServiceFunctionChaining.ServiceFunctionPath.PathIds.PathId.ServiceIndexes.ServiceIndex.SiArr.Data.Term>`
**config**\: False
.. attribute:: type
type
**type**\: :py:class:... | |
<gh_stars>0
#########################################################################
# #
# Name: ISQPRO (Interface Service for Quick Protocolo) #
# #
# Project: PyQPro - Python Quick Protocol #
# Module: Services #
# Started: 20101216 #
# #
# Important: WHEN EDITING THIS FILE, USE SPACES TO INDENT - NOT TABS! #
# #
##... | |
<filename>src/benchmarking/utils.py
# Copyright 2020 ChainLab
#
# 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 ... | |
"""
Run
---
The run functions are used to run mutation trials from the CLI. These can be used directly
for other customized running requirements. The ``Config`` data-class defines the running
parameters for the full trial suite. Sampling functions are defined here as well.
"""
import logging
import random
import subpr... | |
<filename>bin/automated_insert.py
""" Add a species to your database
usiing a log file
"""
import sys
import autofile
import automol
from mechanalyzer.inf import thy as tinfo
from mechanalyzer.inf import rxn as rinfo
from mechanalyzer.inf import spc as sinfo
import elstruct
from automol.geom import ring_fragments_geo... | |
header contains the date and time at which the origin server
believes the resource was last modified. It is used as a validator
to determine if a resource received or stored is the same.
"""
__tags__: List[str] = ["response"]
def __init__(self, my_date: Union[datetime, str], **kwargs: Optional[str]):
"""
:para... | |
#!/usr/bin/env python3
"""Connects the bot."""
import os
import os.path
import random
import re
import sys
import threading
import time
import hclib
import pymongo
from commands import currency
from commands import dictionary
from commands import jokes
from commands import katex
from commands import password
from c... | |
<filename>tests/test_mesos_maintenance.py
# Copyright 2015-2016 Yelp 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... | |
# -*- coding: utf-8 -*-
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Bootstrap for cbuildbot.
This script is intended to checkout chromite on the branch specified by -b or
--branch (as normally a... | |
# coding=utf-8
# Copyright 2022 Facebook AI and The HuggingFace Inc. team. 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
... | |
Shape is
(nlst,ndays,nchan)
latitude [scalar int or float] Latitude of site (in degrees).
Default=0.0 deg.
longitude [scalar int or float] Longitude of site (in degrees).
Default=0.0 deg.
lst_format [string] Specifies the format/units in which the 'last' key
is to be interpreted. If set to 'hourangle', th... | |
<gh_stars>1-10
from typing import List, Dict, Any, Callable, Union, Tuple, Optional
from multiprocessing.connection import Connection
from functools import partial
import multiprocessing
import textwrap
import gym
import numpy as np
import torch
import torch.nn as nn
from regym.rl_algorithms.replay_buffers import Sto... | |
i in range(self.num_pop):
self.parent_pop['binary'][i] = self.combined_pop['binary'][self.pareto_front_individuals[i]]
self.parent_pop['fit_values'][i] = self.combined_pop['fit_values'][self.pareto_front_individuals[i]]
self.parent_combined_dict[i] = self.pareto_front_individuals[i]
self.parent_pop['decoded']... | |
optimize=['einsum_path', (0, 1), (0, 1)])
# 1.0000 <i,e||a,m>*t1(a,i)
singles_res += 1.0 * einsum('ieam,ai->em', g[o, v, v, o], t1)
# -0.5000 <j,i||a,m>*t2(a,e,j,i)
singles_res += -0.5 * einsum('jiam,aeji->em', g[o, o, v, o], t2)
# -0.5000 <i,e||a,b>*t2(a,b,m,i)
singles_res += -0.5 * einsum('ieab,abmi->em',... | |
# noqa: D205,D400
"""
Pre and post processing
-----------------------
"""
from __future__ import annotations
import warnings
from typing import Sequence, Union
import dask.array as dsk
import numpy as np
import xarray as xr
from xarray.core.utils import get_temp_dimname
from xclim.core.calendar import get_calendar, ... | |
<reponame>Bhaskar-R/Sudoku
import time
import random
from random import shuffle,randint
import threading
import numpy as np
from tkinter import *
from tkinter import ttk,font
from tkinter import messagebox
from PIL import ImageTk,Image
root=Tk()
root.title("Sudoku")
width_value=root.winfo_screenwidth()
height_value=ro... | |
# This file was automatically created by FeynRules 2.3.36
# Mathematica version: 11.3.0 for Linux x86 (64-bit) (March 7, 2018)
# Date: Wed 24 Feb 2021 15:52:48
from object_library import all_couplings, Coupling
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
GC_1 = Coupling(name =... | |
mbps})
def copy_volume(src, dest, size_in_m, blocksize, sync=False,
execute=utils.execute, ionice=None, throttle=None,
sparse=False):
"""Copy data from the source volume to the destination volume.
The parameters 'src' and 'dest' are both typically of type str, which
represents the path to each volume on the fil... | |
<reponame>jmfernandez/cwltool
"""Loads a CWL document."""
import hashlib
import logging
import os
import re
import urllib
import uuid
from typing import (
Any,
Dict,
List,
MutableMapping,
MutableSequence,
Optional,
Tuple,
Union,
cast,
)
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from schema_... | |
<reponame>Shadybloom/dnd-mass-combat-simulation<gh_stars>1-10
#!/usr/bin/env python
# -*- coding':' utf-8 -*-
# Hiswelókë's Sindarin dictionary
# Compiled, edited and annotated by <NAME>
# https://www.jrrvf.com/hisweloke/sindar/online/sindar/dict-en-sd.html
dict_words = {
'abandon':'awartha',
'abandonment':'awarth'... | |
predictably on the way to the base case
- the function must call itself
"""
def recursive_search(arr, target):
if arr[0] == target:
return True
elif len(arr[1:]) > 1:
return recursive_search(arr[1:], target)
return False
# print(recursive_search(arr, target))
"""
Binary Search
"""
def binary_search(arr, t... | |
<gh_stars>1-10
import hashlib
from io import BytesIO
from typing import List, Optional, Dict, Any, Generator, Type
from base64 import b64encode
from itertools import chain
from contextlib import closing
from dataclasses import dataclass
import yaml
from google.protobuf.message import Message
from google.protobuf.desc... | |
noinspection PyMissingOrEmptyDocstring
def initialize(self):
super().initialize()
if self.variable_generator is None:
self.variable_generator = DEFAULT_VARIABLE_GENERATOR()
transformer = EquivalentHonClauseAsyncTransformer(self.clause_modifiers)
# noinspection PyAttributeOutsideInit
self.multiprocessing = Multip... | |
#!/usr/bin/env python
"""JIP ships with a **small and simple** local queueing system.
"""
import multiprocessing
import os
import subprocess
import signal
import sys
import logging
import jip.cluster
from jip.logger import getLogger
from jip.six import iteritems
class LocalCluster(jip.cluster.Cluster):
def __init_... | |
<reponame>dos2004/vnpy
"""
This module implements the extended twisted edwards and extended affine coordinates
described in the paper "Twisted Edwards Curves Revisited":
- https://iacr.org/archive/asiacrypt2008/53500329/53500329.pdf
<NAME>, <NAME>-<NAME>, <NAME>, and <NAME>
Information Security Institute,
Queen... | |
import numpy as np
import copy
import feast
import os
import pickle
import pandas as pd
from feast.EmissionSimModules import simulation_classes as sc
import feast.EmissionSimModules.emission_class_functions as ecf
from feast import DetectionModules as Dm
from Tests.test_helper import basic_gas_field
from Tests.test_hel... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Simple service for SL (Storstockholms Lokaltrafik)."""
import datetime
import json
import logging
from datetime import timedelta
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from ho... | |
# *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: ATLH
# Description: Represents an and query batch
# Modifications:
# Date Name Modification
# ---- ---- ------------
# 11 September 2013 ATLH Original file
# *************************... | |
"""Concept module for mapping a concept to rdf.
This module contains methods for mapping a concept object to rdf
according to the
`skos-ap-no standard <https://doc.difi.no/data/begrep-skos-ap-no/#_begrep>`__
Example:
>>> from concepttordf import Concept, Definition
>>>
>>> concept = Concept()
>>> concept.identifi... | |
<reponame>fakecoinbase/ChenYuHoslashvnpy
"""
IB Symbol Rules
SPY-USD-STK SMART
EUR-USD-CASH IDEALPRO
XAUUSD-USD-CMDTY SMART
ES-202002-USD-FUT GLOBEX
"""
from copy import copy
from datetime import datetime
from queue import Empty
from threading import Thread, Condition
from typing import Optional
import shelve
from t... | |
LETTER KA': None,
'KHAROSHTHI LETTER KHA': None,
'KHAROSHTHI LETTER KKA': None,
'KHAROSHTHI LETTER LA': None,
'KHAROSHTHI LETTER MA': None,
'KHAROSHTHI LETTER NA': None,
'KHAROSHTHI LETTER NNA': None,
'KHAROSHTHI LETTER NYA': None,
'KHAROSHTHI LETTER PA': None,
'KHAROSHTHI LETTER PHA': None,
'KHAROSHTHI LETTER RA': Non... | |
= "NOR"
#else:
# taxtype.text = "NS"
# taxcode = ET.SubElement(tax,'TaxCode')
# taxcode.text = "NS"
taxpercentage = ET.SubElement(tax,'TaxPercentage')
taxpercentage.text = str(retn[0].percentagem) #por ir buscar
if entradagl.credit:
if ... | |
gold:
for acluster in nauto:
if acluster != gcluster and acluster.issubset(gcluster):
properties = ['merge'] + split_merge_properties(
acluster, gcluster, auto, gold, text, parses, heads,
gold_mentions, gold_clusters, auto_mentions, gold_doc,
lang)
changes["merge"].append(
(acluster... | |
<reponame>VIAME/netharn
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from os.path import join
import ubelt as ub
import torch # NOQA
from torch.utils import data as torch_data # NOQA
import numpy as np
import netharn as nh
import kwimage
import scriptconfig ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.