input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
val
del local_var_params['kwargs']
# verify the required parameter 'data_view_name' is set
if ('data_view_name' not in local_var_params or
local_var_params['data_view_name'] is None):
raise ApiValueError("Missing the required parameter `data_view_name` when calling `users_get_user_configuration`") # noqa: E501
c... | |
if clusters[j] - 1 in [v[1] for v in j_vecs]:
clusters[j] = j_vecs[0][1] + 1
# Calcluate the new scale and the new Vector direction.
vec_scale = largest_distances[j_vecs[0][1]] / __vector_length(
[merged_barycenters[i][0] - x_new_bary, merged_barycenters[i][1] - y_new_bary])
vectors[j_vecs[0][1]] = [vec_scale * (... | |
############################################################################
# Copyright (C) by gempa GmbH, <NAME> #
# #
# You can redistribute and/or modify this program under the #
# terms of the SeisComP Public License. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRA... | |
Ensure that an attribute that maps to None that is not explicitly
# ignored in configuration is implicitly ignored without triggering
# an error.
conf = self.get_config(CONF.identity.default_domain_id)
conf.ldap.user_attribute_ignore = ['enabled', 'email',
'tenants', 'tenantId']
self.reload_backends(CONF.identity... | |
<reponame>XiaoSong9905/tvm
# 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
# ... | |
import enum
class block(enum.Enum):
"""
block
* acacia_button
* acacia_door
* acacia_fence
* acacia_fence_gate
* acacia_leaves
* acacia_log
* acacia_planks
* acacia_pressure_plate
* acacia_sapling
* acacia_sign
* acacia_slab
* acacia_stairs
* acacia_trapdoor
* acacia_wall_sign
* acacia_wood
* activ... | |
<reponame>stickyparticles/lumberyard
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if... | |
<reponame>obo/loev3go<gh_stars>1-10
"""
interpreter for pylogo
<NAME> <<EMAIL>>
A Logo interpreter.
"""
# python2-3 compatibility
from future.utils import raise_
from past.builtins import basestring # pip install future
from types import *
from pylogo import reader
import inspect, os, sys
from pylogo.common import ... | |
they will return the same hash code
"""
return self.handle.hashCode()
@property
def isdefault(self):
"""bool: True if the node is created automatically by Maya."""
return self.fn.isDefaultNode
@property
def isreferenced(self):
"""bool: True if the node come from a referenced file."""
return self.fn.isFromRe... | |
"Type of Set Aside",
"Evaluated Preference Code",
"Evaluated Preference",
"Research Code",
"Research",
"Fair Opportunity Limited Sources Code",
"Fair Opportunity Limited Sources",
"Other than Full and Open Competition Code",
"Other than Full and Open Competition",
"Number of Offers Received",
"Commercial Item... | |
<gh_stars>0
"""
This module contains the `Mesh` class.
"""
from __future__ import absolute_import
from pyaedt.generic.general_methods import aedt_exception_handler, generate_unique_name, MethodNotSupportedError
from pyaedt.generic.DataHandlers import _dict2arg
from collections import OrderedDict
meshers = {
"HFSS":... | |
cd = "#" #category delimiter to acces different attributes of a word (e.g. lemma instead of text: f"lemma{cd}predict"). Do not use ":" as it is already used by depparse for splitting passive/active deprel differentiation and such
#placeholders (prefix "ph_") to replace in preprocessing
ph_outcome = "<outcome>"
ph_key ... | |
# coding: utf-8
import json
class ObservedData:
def __init__(self, opencti):
self.opencti = opencti
self.properties = """
id
standard_id
entity_type
parent_types
spec_version
created_at
updated_at
createdBy {
... on Identity {
id
standard_id
entity_type
parent_types
spec_version
identity_class
nam... | |
<reponame>kmkurn/ptst-semeval2021<gh_stars>1-10
#!/usr/bin/env python
# Copyright (c) 2021 <NAME>
from collections import defaultdict
from pathlib import Path
from statistics import median
import math
import os
import pickle
import tempfile
from anafora import AnaforaData
from rnnr import Event, Runner
from rnnr.at... | |
NUM_FEATURES = 10
ALPH = " абвгґдеєжзиіїйклмнопрстуфхцчшщьюя'-"
import sys
def decision_tree(f1, f2, f3, f4, f5, f6, f7, f8, f9, f10):
# DecisionTreeClassifier(class_weight=None, criterion='entropy', max_depth=None,
# max_features=None, max_leaf_nodes=3000,
# min_impurity_decrease=0.0, min_impurity_split=None,
#... | |
cause page reading to stop.
# This must be done before auto-pass-through occurs, as we want to stop page reading even if pass-through will be automatically enabled by this focus change.
speech.cancelSpeech()
self.passThrough=passThrough
if not self.passThrough:
# We read the info from the browseM... | |
import collections
import itertools
import random
import numpy as np
import torch
import torch.nn.functional as F
import pfrl
from pfrl import agent
from pfrl.utils.batch_states import batch_states
from pfrl.utils.mode_of_distribution import mode_of_distribution
from pfrl.utils.recurrent import (
concatenate_recurre... | |
Example data of label.csv is as follows:
====== ======== ====
name movie rate
====== ======== ====
John StarWar1 5.0
Tim X-Man 3.5
Maggie StarWar1 4.5
====== ======== ====
>>> label_loader = dgl.data.EdgeLabelLoader(input='label.csv',
separator="\t")
>>> label_loader.addRelationalValidSet(['name', 'movie', ... | |
is supplied and dict values are something else than a list of strings or a list of ints
:exc:`~biopsykit.utils.exceptions.ValidationError`
if number of columns does not match
:exc:`~biopsykit.utils.exceptions.ValueRangeError`
if values are not within the required score range
References
----------
<NAME>. (2005... | |
import pytest
import os
import sqlalchemy.orm.exc
from dblayer import *
from dblayer.func.func_citydb_pkg import *
from dblayer.func.func_citydb_view import *
from dblayer.func.func_citydb_view_nrg import *
from dblayer.func.func_postgis_geom import *
from dblayer.sim.pandapower import *
from dblayer.sim.pandatherma... | |
are correct
self.assertEquals(art_stock.count, 2)
self.assertEquals(art2_stock.count, 3)
# Check if the book value of the items are equal to the cost of the articles
self.assertEquals(art_stock.book_value.amount, sp.amount)
self.assertEquals(art2_stock.book_value.amount, sp.amount)
def testTwoArticleMerges(self... | |
<gh_stars>1-10
######################################################################
#
# Software Name : Cloudnet TOSCA toolbox
# Version: 1.0
# SPDX-FileCopyrightText: Copyright (c) 2020-21 Orange
# SPDX-License-Identifier: Apache-2.0
#
# This software is distributed under the Apache License 2.0
# the text of which i... | |
from lite_content.lite_exporter_frontend import generic
from lite_content.lite_exporter_frontend.generic import PERMISSION_FINDER_LINK
class GoodsList:
TITLE = "Product list"
CREATE_GOOD = "Add a product"
class Count:
ORGANISATION_ZERO = "Your organisation has no products listed."
ORGANISATION_ONE = "Your organ... | |
<gh_stars>1-10
# (c) Copyright [2018] Micro Focus or one of its affiliates.
# 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 b... | |
for i in range(0,len(A[0])):
if B[4][i] == 0:
p2 = 0
else:
p2 = 100 - 100 * A[4][i]/B[4][i]
print_debug("%21s: %10.2f %10.2f %10.2f" % (A[0][i], A[4][i], B[4][i], abs(p2)), False, "")
if p2 < -1:
print_debug(" <+", False, "")
if p2 > 1:
print_debug(" <-", False, "")
print_debug("\n", False, "")
if "performan... | |
get_curve_knots(curve_node_name):
"""
Returns given curve knots
:param curve_node_name: str
:return: list(str)
"""
curve_fn = curve_utils.get_curve_fn(curve=curve_node_name)
curve_knots = curve_fn.knots()
return [float(knot) for knot in curve_knots]
def get_curve_knots_positions(curve_node_name, world_space... | |
# Copyright 2017 Reswitched Team
#
# 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.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WAR... | |
<gh_stars>1-10
from _sims4_collections import frozendict
import itertools
import weakref
from animation import AnimationContext
from animation.animation_constants import AUTO_EXIT_REF_TAG
from element_utils import build_critical_section, build_critical_section_with_finally, build_element, must_run
from routing import P... | |
#!/usr/bin/python
import os
import getopt
import sys
import bz2
import subprocess
import numpy as np
import develop as d
import coding_theory as code
from walker_updated import isNumber, parseDir
from coding_theory import make_prototyped_random_codes #make_prototyped_random_codes
import scipy.io as sio
#############... | |
-63486,
134230706,
128868,
-1,
134294343,
128867,
-63484,
134228602,
128863,
-1,
134420193,
128782,
134613005,
133902415,
-1,
134678537,
134551781,
-1,
-63480,
134614168,
128840,
-1,
134676792,
128809,
134875147,
134612581,
128831,
-1,
134808261,
128832,
-63476,
134821325,
128845,
-1,
... | |
NURBS curves must have the same degree")
if self.q != new_nurbs.q:
raise Exception("In order to merge, the two NURBS curves must have the same degree")
if np.shape(self.V) != np.shape(new_nurbs.V):
raise Exception("The two NURBS patches must have the same number of V-knots")
if any([np.abs(v1-v2)>1e-12 for v1, ... | |
is not None:
if_none_match = pool_get_options.if_none_match
if_modified_since = None
if pool_get_options is not None:
if_modified_since = pool_get_options.if_modified_since
if_unmodified_since = None
if pool_get_options is not None:
if_unmodified_since = pool_get_options.if_unmodified_since
# Construct URL
ur... | |
0)
m.c231 = Constraint(expr=-m.x52*m.x589 + m.x244 == 0)
m.c232 = Constraint(expr=-m.x53*m.x589 + m.x245 == 0)
m.c233 = Constraint(expr=-m.x54*m.x589 + m.x246 == 0)
m.c234 = Constraint(expr=-m.x55*m.x589 + m.x247 == 0)
m.c235 = Constraint(expr=-m.x56*m.x589 + m.x248 == 0)
m.c236 = Constraint(expr=-m.x57*m.x589 + ... | |
<reponame>RomainGratier/Black-box_Optimization_via_Deep_Generative-Exploratory_Networks
import pandas as pd
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
import os
import torch
from torch.autograd import Variable
from torch.nn import functional as F
from copy import deepcopy
import itertoo... | |
"19-1886973",
"19-1887251",
"19-1886924",
"18-1886608",
"18-1873144",
"18-1886472",
"18-1886509",
"18-1874533",
"18-1886214",
"20-1917935",
"18-1865406",
"18-1882454",
"18-1874967",
"18-1885609",
"18-1885617",
"18-1885441",
"18-1868164",
"18-1885360",
"20-1918692",
"17-1843218",
... | |
<gh_stars>10-100
"""
The MIT License (MIT)
Copyright (c) 2020-Current Skelmis
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, ... | |
<reponame>IBM/transition-amr-parser
# 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.
import math
from packaging import version
import torch
import torch.nn as nn
import torch.nn.functional a... | |
people',
'editnotices/page/homeopathy',
'editnotices/page/homs camp',
'editnotices/page/houthi movement',
'editnotices/page/huj, gaza',
'editnotices/page/hulayqat',
'editnotices/page/human rights abuses in jammu and kashmir',
'editnotices/page/human rights abuses in kashmir',
'editnotices/page/human rights in i... | |
#!/usr/bin/python
from __future__ import print_function
import logging
from fabric.api import task,run,local,put,get,execute,settings
from fabric.decorators import *
from fabric.context_managers import shell_env,quiet
from fabric.exceptions import *
from fabric.utils import puts,fastprint
from time import sleep
from c... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 9 16:19:08 2021
@author: <NAME>
"""
from copy import deepcopy
import numpy as np
import pandas as pd
import random
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score
import seaborn as sns
from sklearn.cluster import KMean... | |
<reponame>80avin/goodix-fp-dump<gh_stars>1-10
from struct import pack as encode
from struct import unpack as decode
from sys import version_info
from time import sleep, time
from typing import List, Literal, Optional, Tuple, Union
from usb.control import get_status
from usb.core import Device as USBDevice
from usb.cor... | |
Get Pond Shape
@return: a PondShape object, holding all the information describing the shape of the lake.
@rtype: PondShape
'''
return self.pond_shape_object
def get_benthic_photosynthesis_measurements(self):
'''
Get Benthic Photosynthesis Measurements
@return: the list containing all the Benthic Photosynthes... | |
wcsprm = _wcs.Wcsprm(header=header_bytes, key=key,
relax=relax, keysel=keysel_flags,
colsel=colsel)
except _wcs.NoWcsKeywordsFoundError:
# The header may have SIP or distortions, but no core
# WCS. That isn't an error -- we want a "default"
# (identity) core Wcs transformation in that case.
if colsel is None:
w... | |
A524': 83520,
'ANATOLIAN HIEROGLYPH A525': 83521,
'ANATOLIAN HIEROGLYPH A526': 83522,
'ANATOLIAN HIEROGLYPH A527': 83523,
'ANATOLIAN HIEROGLYPH A528': 83524,
'ANATOLIAN HIEROGLYPH A529': 83525,
'ANATOLIAN HIEROGLYPH A530': 83526,
'ANGER SYMBOL': 128162,
'ANGRY FACE': 128544,
'ANGUISHED FACE': 128551,
'ANT': 128028,
'AN... | |
from Bio import Phylo
from Bio.Phylo import PhyloXML
from Bio.Phylo import PhyloXMLIO
from collections import defaultdict as ddict
from Bio.Phylo.PhyloXML import Property as Prop
from Bio.Phylo.PhyloXML import Clade as PClade
from Bio.Phylo.BaseTree import Tree as BTree
from Bio.Phylo.BaseTree import Clade as BClade
im... | |
not The.normalize : return value
if value == The.missing : return value
if isinstance(value,str) : return value
lo, hi = lohi(m,x)
return (value - lo) / (hi - lo + 0.0001)
"""
As seen above, _normalize_ has some special cases.
Firstly, if some global flag has disabled
normalization, we just return the unaltered val... | |
<reponame>suresh198526/pulumi-azure
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequ... | |
query_args = self._query_builder(
"query",
"vendorTokens",
fields,
{"sort": sort, "filter": filter,},
_ARGUMENT_LEGENDS.vendor_tokens_each,
True,
)
return self.iterate_edges(
objects.VendorTokenConnection, query_args, headers, token, "vendorTokens",
)
def create_catalog(
self,
input: inputs.CatalogCreateI... | |
import unittest
def expression_tree():
"""
Build expression tree.
"""
from algs18_binary_tree.expression_tree import Value, Expression, add, mult, sub, divide
# Sample Recursive Expression
add1 = Expression(add, Value(3), Value(1))
div2 = Expression(divide, add1, Value(4))
add3 = Expression(add, Value(1), Val... | |
(40, "Invalid process security level.")
else:
# Delete a file with the path given by RBX and RCX
begin_offset = int.from_bytes(self.processes[pid].threads[tid].registers['RBX'].get_bytes(0, 4)[1], byteorder='little')
length = int.from_bytes(self.processes[pid].threads[tid].registers['RCX'].get_bytes(... | |
<filename>sapextractor/algo/prod/obj_centr_log.py
import pandas as pd
from dateutil import parser
from pm4pymdl.objects.mdl.exporter import exporter as mdl_exporter
from pm4pymdl.objects.ocel.exporter import exporter as ocel_exporter
from sapextractor.utils.dates import timestamp_column_from_dt_tm
from pandas.core.fram... | |
self.data_mean[self.data_mean_keys[j]] += self.data_mean[self.data_mean_keys[i]]
print("Mean total TKE has been calculated for {}".format(self.data_mean_keys[j]))
break
@timer
def formatMeanDataToOpenFOAM(self, ke_relaxfactor=1.):
# Go through inflow patches
for i, patch in enumerate(self.inflow_patches):
# Cre... | |
<reponame>minsuu/vqa_mcb<gh_stars>100-1000
import caffe
import numpy as np
import random
import os
import sys
import re
import json
import spacy
from operator import mul
GLOVE_EMBEDDING_SIZE = 300
CURRENT_DATA_SHAPE = None
SPATIAL_COORD = None
GLOVE = None
class LoadVQADataProvider:
def __init__(self, ques_file_p... | |
# -*- coding: utf8 -*-
# engine
# helper class for cuatro
# <NAME> 2021
import numpy as np
import random
import copy
import time
version = 'engine.v.1.0.0'
class State:
"""instance attributes:
size: int: size of one side of the board (defines a cube that holds the game)
win: int: how many items in a row constitut... | |
'status': 'accepted', 'year': '2020'})
self.assertEqual(response.status_code, 200)
data = response.json()['data']
lots = data['lots']
self.assertEqual(len(lots), 1)
def test_simple_template_import_missing_data_cannot_validate(self):
# as producer
# upload lines that cannot be validated
jsoned = self.upload_fil... | |
""" Code that plots fields from the CMAC radar object. """
import os
from datetime import datetime
import operator
import cartopy.crs as ccrs
import netCDF4
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pyart
from pyart.graph.common import (
generate_radar_name, generate_radar_time_beg... | |
<filename>varconlib/scripts/graph_results.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 15 15:32:43 2018
@author: dberke
"""
# Script to plot cached results from lineFind.py
import datetime as dt
from pathlib import Path
from glob import glob
import varconlib as vcl
import pandas as pd
imp... | |
<gh_stars>1-10
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | |
#!/opt/anaconda2/bin/python
# -*- coding: utf-8 -*-
"""
################################################################################
#
# Copyright (c) 2016 <NAME>
# All rights reserved
# Distributed under the terms of the MIT license
#
###############################################################################... | |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _IGESContro... | |
if i is None:
return self.getTypedRuleContexts(StlParser.ExpressionContext)
else:
return self.getTypedRuleContext(StlParser.ExpressionContext,i)
def UntilOperator(self):
return self.getToken(StlParser.UntilOperator, 0)
def interval(self):
return self.getTypedRuleContext(StlParser.IntervalContext,0)
def accep... | |
conn.lower():
return True
return False
if self.msg.getheader('keep-alive'):
return False
if conn and 'keep-alive' in conn.lower():
return False
pconn = self.msg.getheader('proxy-connection')
if pconn and 'keep-alive' in pconn.lower():
return False
return True
def close(self):
if self.fp:
self.fp.close()
... | |
retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> storage_resources.Bucket:
r"""Creates a new bucket.
Args:
request (Union[google.storage_v1.types.InsertBucketRequest, dict]):
The request object. Request message for InsertBucket.
retry (google.api_co... | |
<filename>pyjs/src/pyjs/browser.py
# Copyright (C) 2009, 2010, <NAME> <<EMAIL>>
# Copyright (C) 2010, <NAME> <<EMAIL>>
import os
import sys
import time
import shutil
from pyjs import linker
from pyjs import translator
if translator.name == 'proto':
required_modules = [
'pyjslib', 'sys', 'imp', 'dynamic', 'pyjamas', ... | |
retrieved bgpIPRouteProperty data using find and the newly added bgpIPRouteProperty data available through an iterator or index
Raises:
ServerError: The server has encountered an uncategorized error condition
"""
return self._create(locals())
def remove(self):
"""Deletes all the bgpIPRouteProperty... | |
S_StartSIdentify__Fv()")
del_items(0x8006803C)
SetType(0x8006803C, "void S_StartIdShow__Fv()")
del_items(0x80068210)
SetType(0x80068210, "void S_StartTalk__Fv()")
del_items(0x80068440)
SetType(0x80068440, "void S_StartTavern__Fv()")
del_items(0x80068538)
SetType(0x80068538, "void S_StartBarMaid__Fv()")
del_items(0x8006... | |
a context-menu.
*Keyboard shortcuts* in addition to the ones in the menu:
=========== ============================================================
Key Effect
=========== ============================================================
arrows scroll through components/epochs
alt+arrows scroll to beginning/end
t top... | |
<reponame>nikadilli/imgMS
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
import pandas as pd
import warnings
from decimal import Decimal
import datetime
import logging
import itertools
from imgMS.side_functions import *
from imgMS.MSEval import *
class MSDa... | |
IDL colormap 15 :: STERN SPECIAL ###
color_map_luts['idl15'] = \
(
array([ 0.0000000, 0.0703125, 0.1406250, 0.2109375, 0.2812500, 0.3515625,
0.4218750, 0.4960938, 0.5664062, 0.6367188, 0.7070312, 0.7773438,
0.8476562, 0.9179688, 0.9921875, 0.9726562, 0.9531250, 0.9335938,
0.9140625, 0.8945312, 0.8710938, 0.8515625... | |
import json
from airone.lib.test import AironeViewTest
from airone.lib.types import AttrTypeValue
from datetime import date
from django.urls import reverse
from entity.models import Entity, EntityAttr
from entry.models import Entry
from entry.settings import CONFIG
from group.models import Group
class ViewTest(Air... | |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise RuntimeErr... | |
a "bounding box" for the graph
# @code
# xmin, xmax , ymin , ymax = graph.bb()
# @endcode
def _gr_bb_ ( graph , more = 0.0 ) :
""" Get a ``bounding box'' for the graph
>>> xmin, xmax , ymin , ymax = graph.bb()
"""
xmin = pos_infinity
xmax = neg_infinity
ymin = pos_infinity
ymax = neg_infinity
for i , x , y ... | |
<gh_stars>0
#!/usr/bin/python
#
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
"""This file contains code to support the hitless image upgrade feature."""
import argparse
from builtins import object
from builtins import str
import copy
from datetime import timedelta
import re
import sys
import tr... | |
<filename>train.py<gh_stars>1-10
import sys
import os
from os.path import expanduser
import pickle
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
import torch.onnx
import re
import json
from PIL import Image, ImageDraw
import torch
import numpy as np
# Training script- trains a ... | |
<reponame>sfox14/butterfly
"""My torch implementation of permutations and sinkhorn balancing ops.
A torch library of operations and sampling with permutations
and their approximation with doubly-stochastic matrices, through Sinkhorn balancing
"""
import numpy as np
from scipy.optimize import linear_sum_assignment
fr... | |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | |
<gh_stars>1-10
# pylint: skip-file
# -*- coding: utf-8 -*-
# Author: trummerjo
# Module: MSLHttpRequestHandler
# Created on: 26.01.2017
# License: MIT https://goo.gl/5bMj3H
import re
import sys
import zlib
import gzip
import json
import time
import base64
import random
from Cryptodome.Random import get_random_bytes
fr... | |
import os
import pyembroidery.A10oReader as A10oReader
import pyembroidery.A100Reader as A100Reader
# import pyembroidery.ArtReader as ArtReader
import pyembroidery.BroReader as BroReader
import pyembroidery.ColReader as ColReader
import pyembroidery.ColWriter as ColWriter
import pyembroidery.CsvReader as Cs... | |
= zbes[0:idim]
for j in range(idim, kdim - 1, 1):
pbes[j] = pbes[j - 1] + p_i
return pbes
def diagram(filen, listf, dims):
"""Diagram interface script.
Call the class fluxogram, serving as
interface between the main script and the class for flux
diagrams design.
Arguments:
- filen: the filename of the diag... | |
<gh_stars>1-10
import logging
import numpy as np
from functools import partial
from typing import Callable, Dict, Optional, Tuple, Union
from sklearn.base import clone, ClassifierMixin
from sklearn.calibration import CalibratedClassifierCV
from sklearn.exceptions import NotFittedError
from sklearn.ensemble import Rando... | |
#!/usr/bin/python
# vim: ts=4 sw=4 et
"""Class for handling argparse parsers. Methods are configured as subparsers."""
import argparse
import os
import subprocess
import sys
import textwrap
import yaml
from vctools import Logger
# pylint: disable=too-many-instance-attributes
class ArgParser(Logger):
"""Argparser clas... | |
<reponame>oway13/Schoolwork<gh_stars>0
from pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.util import dpid_to_str, str_to_dpid
from pox.lib.packet.ethernet import ethernet
from pox.lib.packet.arp import arp
from pox.lib.addresses import IPAddr, EthAddr
# Even a simple usage of the logger i... | |
<reponame>RichardScottOZ/stackstac<gh_stars>0
from __future__ import annotations
import functools
import logging
import threading
import weakref
from typing import TYPE_CHECKING, Optional, Protocol, Tuple, Type, Union
import numpy as np
import rasterio as rio
from rasterio.vrt import WarpedVRT
from .rio_env import L... | |
<reponame>rSedoy/wagtail<filename>wagtail/core/blocks/base.py
import collections
from importlib import import_module
from django import forms
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
from django.template.loader import render_to_string
from django.utils.encoding import forc... | |
<reponame>samuelralmeida/multi-user-blog<filename>main.py<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import webapp2
import jinja2
import random
import hashlib
import hmac
import re
from datetime import datetime
from google.appengine.ext import db
from string import letters
template_dir = os.p... | |
<gh_stars>0
'''
PIPELINE 2
Project manager for Maya
Ahutor: <NAME>
All rights reserved (c) 2017
pipeline.nnl.tv
<EMAIL>
---------------------------------------------------------------------------------------------
install:
Place the pipeline folder in your maya scripts folder and run this code (in python):
impo... | |
# -*- coding: UTF-8 -*-
#
# copyright: 2020-2022, <NAME>
# author: <NAME> <http://github.com/fscm>
# license: SPDX-License-Identifier: MIT
"""Tests for the Dinar currency representation(s)."""
from decimal import Context
from pytest import raises
from multicurrency import Currency
from multicurrency import (
Currenc... | |
axis=0)
# Adds the max cars rental scenario into the rental dictionary for
# the current location.
self.rental_dict[idx][num_max_cars] = {'fee': full_rental_fee_arr,
'prob': full_rental_prob_arr}
# Adds the max cars return scenario into the return dictionary for
# the current locat... | |
<reponame>infdahai/Strong_Learning<gh_stars>0
# encoding: utf-8
"""
@author: <NAME>
@contact: <EMAIL>
@version: 1.0
@file: main.py
@time: 2018/3/20
"""
import argparse
import os
import shutil
import socket
import time
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.parallel
i... | |
<gh_stars>100-1000
# Copyright 2015 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 t... | |
points,
facets, holes, and control_points. Geometries created through this method are expected to
be non-ambiguous meaning that no "overlapping" geometries exists and that nodal connectivity
is maintained (e.g. there are no nodes "overlapping" with facets without nodal connectivity).
:cvar points: List of points *... | |
the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if the host is not using the default
protocol. Default protocol is ``https``.
port
Optionally set to alternate port if the host is not ... | |
The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/sdk_behaviors/retries.html>`__.
To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.
:return: A :class:`~oci.re... | |
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import gc
import cv2
# gc.set_threshold(100, 10, 10)
from lib.model.config import cfg
from lib.rpn.generate_anchors_global import generate_anchors_global
from lib.rpn.... | |
<gh_stars>1-10
# -*- encoding: UTF-8 -*-
# -*- Indentation: 4 Spaces -*-
import os
import sys
try:
import pyperclip
except ImportError:
pass
'''
A package for tablular operation and for making making tabular data
This project is hosted on github for developmental purpose,
in which anyone can contribute, smallest... | |
cmap=cmap)
return cmap
@property
def dark2_8(self):
cname = "dark2_8"
if cname in matplotlib.cm._cmap_registry:
return matplotlib.cm.get_cmap(cname)
cmap_file = os.path.join(CMAPSFILE_DIR, "colorbrewer", "dark2_8.rgb")
cmap = Colormap(self._coltbl(cmap_file), name=cname)
matplotlib.cm.register_cmap(name=cname... | |
<filename>pipenv/patched/piptools/resolver.py
# coding: utf-8
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import copy
from functools import partial
from itertools import chain, count
import os
from first import first
from notpip.req import InstallRequirement
from . import cli... | |
15074: ["Sablefish fish"], # Fish, sablefish, raw
15075: [], # Fish, sablefish, smoked
15076: ["Salmon fish"], # Fish, salmon, Atlantic, wild, raw
15077: [], # Fish, salmon, chinook, smoked
15078: [], # Fish, salmon, chinook, raw
15079: [], # Fish, salmon, chum, raw
15080: [], # Fish, salmon, chum, canned, draine... | |
#!/usr/bin/env python
# Copyright 2016 DIANA-HEP
#
# 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 ag... | |
<gh_stars>1-10
'''
File: cache_mag.py
Author: <NAME>
Version: 0.1
Create: 2016-05-11 15:25:43
Description: manage Landsat cache files
'''
import logging
from . import config
class file_obj():
def __init__(self, f):
import os
self._f = f
self._t = os.path.getatime(f)
self._z = os.path.getsize(f)
def __eq__(se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.