input
stringlengths
2.65k
237k
output
stringclasses
1 value
OpCode, field: _n_4_t_12):... def Emit(self, opcode: OpCode, labels: _n_0_t_1[Label]):... def Emit(self, opcode: OpCode, label: Label):... def Emit(self, opcode: OpCode, arg: float):... def Emit(self, opcode: OpCode, cls: _n_0_t_6):... def Emit(self, opcode: OpCode, con: _n_4_t_6):... def Emit(self, opcode: OpCod...
''' LICENSING ------------------------------------------------- daemoniker: Cross-platform daemonization tools. Copyright (C) 2016 Muterra, Inc. Contributors ------------ <NAME> <EMAIL> | <EMAIL> | <EMAIL> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Less...
key. # Starts the system settings activity. SETTINGS = 176 # Key code constant: TV power key. # On TV remotes, toggles the power on a television screen. TV_POWER = 177 # Key code constant: TV input key. # On TV remotes, switches the input on a television screen. TV_INPUT = 178 # Key code constant: Set-top-b...
<filename>sureal/subjective_model.py import copy from abc import ABCMeta, abstractmethod import sys import time import numpy as np from scipy import linalg from scipy import stats import pandas as pd from scipy.stats import chi2, norm from sureal.core.mixin import TypeVersionEnabled from sureal.tools.misc import impo...
<filename>mmderain/datasets/pipelines/augmentation.py # This code is taken from https://github.com/open-mmlab/mmediting # Modified by <NAME> import copy import math import numbers import cv2 import mmcv import numpy as np from ..registry import PIPELINES @PIPELINES.register_module() class Resize: """Resize data t...
<reponame>ProteinsWebTeam/project-skeleton from rest_framework import status from webfront.models import Taxonomy from webfront.tests.InterproRESTTestCase import InterproRESTTestCase class TaxonomyFixturesTest(InterproRESTTestCase): def test_the_fixtures_are_loaded(self): taxa = Taxonomy.objects.all() self.assert...
<filename>depthai_demo.py #!/usr/bin/env python3 import sys import threading if sys.version_info[0] < 3: raise Exception("Must be using Python 3") import argparse import json import os import time import traceback from functools import cmp_to_key from itertools import cycle from pathlib import Path import platform i...
contract values(5,40856194.45, 'p004')"); db.execute("insert into contract values(1,2834164.67, 'p005')"); db.execute("insert into contract values(2,5892143.22, 'p006')"); db.execute("insert into contract values(3,12783547.98, 'p007')"); db.execute("insert into contract values(6,76923123.65, 'p008')"); db.execute("inse...
<filename>components/faker/faker/providers/person/de_DE/__init__.py # coding=utf-8 from __future__ import unicode_literals from .. import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name_male}} {{last_name}}', '{{first_name_male}} {{last_name}}', '{{first_name_male}} {{last_na...
#!/usr/bin/env python import sys, math, random, signal, time ttc = time.time() counter = 0 def signal_handler(signal, frame): print counter signal.signal(signal.SIGTSTP, signal_handler) sbox = ( 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, 0xCA, 0x82, 0xC9, 0x7...
<reponame>dr1315/Collocation_v2<gh_stars>0 import os import sys import numpy as np import pandas as pd from pysolar.solar import get_altitude_fast from pyorbital.orbital import get_observer_look from pyorbital.astronomy import get_alt_az import datetime as dt from datetime import timezone sys.path.append("/g/d...
elif in_modified and not in_original: self.add_cell_info(add_label = edit_value, frame = frame) comparison = np.where(annotated != self.tracked[frame]) self.frames_changed = np.any(comparison) self.tracked[frame] = annotated def action_flood_contiguous(self, label, frame, x_location, y_location): ''' flood fi...
<gh_stars>1-10 import os import random import shutil import numpy as np import tensorflow as tf import tensorflow_addons as tfa def get_data_from_tf(tf_path, imf_norm_op): feature = {'height': tf.io.FixedLenFeature([], tf.int64), 'width': tf.io.FixedLenFeature([], tf.int64), 'depth': tf.io.FixedLenFeature([], tf....
# Module containing functions to compute the SPIKE directionality and the # spike train order profile # Copyright 2015, <NAME> <<EMAIL>> # Distributed under the BSD License from __future__ import absolute_import import numpy as np import pyspike from pyspike import DiscreteFunc from functools import partial from pysp...
<filename>pygot/dendroutils.py<gh_stars>1-10 #!/usr/bin/env python import copy import dendropy #this deals with changes in DendroPy 4 from dendropy.utility import bitprocessing ''' try: from dendropy.calculate import treesplit except ImportError: from dendropy import treesplit ''' def compat_encode_bipartitions(tre...
<reponame>sukruthG/nimi-python<gh_stars>0 # -*- coding: utf-8 -*- # This file was generated import array # noqa: F401 import ctypes # Used by @ivi_synchronized from functools import wraps import nidcpower._attributes as _attributes import nidcpower._converters as _converters import nidcpower._library_singleton as _lib...
<reponame>zhouwei25/Paddle<filename>tools/sampcd_processor.py # Copyright (c) 2019 PaddlePaddle Authors. 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.ap...
<filename>tests/test_http.py # # This file is part of Gruvi. Gruvi is free software available under the # terms of the MIT license. See the file "LICENSE" that was provided # together with this source file for the licensing terms. # # Copyright (c) 2012-2017 the Gruvi authors. See the file "AUTHORS" for a # complete li...
with ``clipa_movement=SLIDE`` and ``clipb_movement=SLIDE``. """ return linear_boundary(clipa, clipb, MiscConstants.SLIDE, MiscConstants.SLIDE, frames=frames, direction=direction) def slide_expand( clipa: vs.VideoNode, clipb: vs.VideoNode, frames: Optional[int] = None, direction: Direction = Direction.LEFT ): """F...
guess." "\n Out of your periphery you notice a large being approaching." " You turn suddenly, reaching for your trusty {}" ", but you remember it's not there. All your things, gone." "\n A large Orcish man approaches you, easily twice your height." " 'I am the gate keeper here. Why do you wish to leave?'" ". Clea...
[] six_dof_list[bi]['trans_pred_world'] = trans_pred_world[start:end] inds_list.append(inds_i) start = end bboxes_merge_concat = [] segms_merge_concat = [] car_cls_score_pred_concat = [] quaternion_pred_concat = [] trans_pred_world_concat = [] for ids, bboxes, segms, six_dof in zip(inds_list, bboxes_list, se...
<reponame>askender/deep_disfluency # -*- coding: utf-8 -*- from collections import defaultdict import re from nltk import tree from swda import CorpusReader from tree_pos_map import TreeMapCorpus from tree_pos_map import POSMapCorpus possibleMistranscription = [("its", "it's"), ("Its", "It's"), ("it's", "its"), ("...
more files are missing! Abort!" ) split_files.append((ref_name, o, gff_file, group_file, mega_file)) use_fq = False if ref_fq is not None and addon_fq is not None: use_fq = True ref_fq_dict = { r.id.split("|")[0]: r for r in SeqIO.parse(open(ref_fq), "fastq") } addon_fq_dict = { r.id.split("|")[0]: r for r i...
which appear to be identical """ identical_blocks = [] for (block_a, block_b) in self._block_matches: if self.blocks_probably_identical(block_a, block_b): identical_blocks.append((block_a, block_b)) return identical_blocks @property def differing_blocks(self): """ :returns: A list of block matches which appe...
) tmp = list(set(self._values['gather_subset'])) tmp.sort() self._values['gather_subset'] = tmp return self._values['gather_subset'] class BaseParameters(Parameters): @property def enabled(self): return flatten_boolean(self._values['enabled']) @property def disabled(self): return flatten_boolean(self._val...
porosity: Optional[float] Porous module parameter. """ sponge_half_height_x0 = 0.5 * (self.x0y0[1] + self.x0y1[1]) sponge_half_height_x1 = 0.5 * (self.x1y0[1] + self.x1y1[1]) sponge_x0 = self.x0y0[0] sponge_x1 = self.x1y0[0] waves = None wind_speed = np.array([0., 0., 0.]) if x_n or x_p: self._attachAuxiliar...
# calculate used_program_storage = 0 used_dynamic_memory = 0 for section, size, address in xtensa.sections(self.elffile): if size == 0 or address == 0: continue for program_storage_section in self.program_storage_sections: if section.startswith(program_storage_section): log.info('FLASH : 0x{:08x} 0x{:08x} {}'.f...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: IOBinding.py import os import types import sys import codecs import tempfile import tkFileDialog import tkMessageBox import re from Tkinter import * ...
import functools import os, sys import time import cv2 import numpy as np import pickle sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import tensorflow as tf import tensorflow.contrib.slim as slim from sklearn import mixture from sklearn.metrics.cluster import normalized_mutual_info_score from scip...
#!/usr/bin/env python3 import re import glob import os import argparse import subprocess import platform import shutil import distutils.dir_util import json from pathlib import Path if any(platform.win32_ver()): import scripts.find_visual_studio def run(dest_file, dest_dir, project, max_num_configs, verbose): def ...
# 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...
infirmities infirmity infix inflame inflamed inflames inflaming inflammable inflammation inflammations inflammatory inflatable inflate inflated inflates inflating inflationary inflection inflections inflicted inflicting inflicts influenza influx influxes informality informant informants informational informer informers...
undefined: # if reverse: arr.reverse() #elif reverse: # arr = arr.slice(stop, start+1) # arr.reverse() #else: # #if stop < 0: ## mozilla spec says negative indices are supported # # stop = arr.length + stop # arr = arr.slice(start, stop) #return arr @Array.prototype.__setslice__ def fun...
import pytest from tests.utils import assert_bindings def test_g_day_min_inclusive005_1268_g_day_min_inclusive005_1268_v(mode, save_output, output_format): """ TEST :Facet Schemas for string : (facet=minInclusive and value=- - -01 and facet=maxExclusive and value=- - -30) and document value=- - -15 """ assert_b...
<reponame>teambotmax/t1 #RENGGA===Version SB import linepy from linepy import * from akad.ttypes import * from datetime import datetime import pytz, pafy, time, asyncio, random, multiprocessing, timeit, sys, json, ctypes, codecs, tweepy, threading, glob, re, ast, six, os, subprocess, wikipedia, atexit, urllib, urllib....
# PYTRIS™ Copyright (c) 2017 <NAME> All Rights Reserved. import pygame import operator from tkinter import * from mino import * from random import * from pygame.locals import * import ctypes # Define block_size = 35 # Height, width of single block width = 10 # Board width height = 20 # Board height framerate = 30 # ...
#!/usr/bin/env python # -------------------------------------------------------- # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- # for testing import argparse import datetime import numpy as np import itertools from core.bc import BC from core.d...
V, with placeholder values added for new beliefs B, updated with new beliefs """ n_S = np.shape(R)[0] n_A = np.shape(R)[1] n_B = np.shape(B)[0] if eps is None: eps = 0.01*n_S if n_B > 250: print("already have over 250 belief points. careful! not expanding more...") O_dims = np.shape(O)[1] O_means = O[0]...
name (str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name`. Returns: Real tensor. The real result of the 2-D Hermitian complex real FFT. Raises: ValueError: if `s` not be a sequence of 2 integers or Non...
: ntuniprot(RecName_Full='Probable phosphatase PSR2'), 'Q07950' : ntuniprot(RecName_Full='Sterol esterase 2'), 'Q07951' : ntuniprot(RecName_Full='Proteasome chaperone 3'), 'Q07953' : ntuniprot(RecName_Full='Ribosome maturation protein SDO1'), 'Q07959' : ntuniprot(RecName_Full='ADIPOR-like receptor IZH3'), 'Q07963'...
person.classRank = 4 person.yearOfSchoolLeft = 0 person.classRank = person.temporaryClassRank self.enterWorkForce(person) if person.house == self.displayHouse: self.textUpdateList.append(str(self.year) + ": #" + str(person.id) + " is now looking for a job.") if (person.status == 'student' or person.statu...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import uu...
"""Micro moments.""" import abc import collections from typing import Any, Dict, Hashable, List, Optional, Sequence, TYPE_CHECKING import numpy as np from . import options from .utilities.basics import Array, StringRepresentation, format_number, format_table # only import objects that create import cycles when che...
<reponame>bsaakash/new_repo<filename>src/UQpy/UQpyModules.py import os import shutil import UQpy as uq import numpy as np import sys class RunCommandLine: def __init__(self, argparseobj): os.system('clear') self.args = argparseobj #################################################################################...
# coding: utf-8 """ Module ``mock`` --------------- Wrapper to unittest.mock reducing the boilerplate when testing asyncio powered code. A mock can behave as a coroutine, as specified in the documentation of :class:`~asynctest.mock.Mock`. """ import asyncio import asyncio.coroutines import contextlib import enum imp...
<reponame>benoitc/pypy from pypy.rpython.lltypesystem import lltype, llmemory, llarena, llgroup from pypy.rpython.memory.gc.base import MovingGCBase from pypy.rpython.memory.gc import env from pypy.rlib.debug import ll_assert, have_debug_prints from pypy.rlib.debug import debug_print, debug_start, debug_stop from pypy....
" AACGM: [{:.3f}, {:.3f}, {:d}]\n".format( self.aacgm_lat[i], self.aacgm_mlt[i], dind) out += " OCB: [{:.3f}, {:.3f}, {:d}]\n".format( self.ocb_lat[i], self.ocb_mlt[i], self.ocb_ind[i]) elif self.ocb_ind.shape == (): for i, dind in enumerate(self.dat_ind): out += " AACGM: [{:.3f}, {:.3f}, {:d}]\n".format( self.a...
<filename>software_kb/merging/populate_from_mentions.py ''' Populate the staging area graph from the software mention imported documents ''' import os import json from arango import ArangoClient from populate_staging_area import StagingArea import logging import logging.handlers from tqdm import tqdm def populate(sta...
= {} iteration_num = -1 # iterate over cases from end to start, unless we've grabbed values from # every system while not self._has_all_values(coord_map): iteration = self.system_cases._case_keys[iteration_num] iteration_num -= 1 split_iter = self._split_coordinate(iteration) iter_key = ':'.join(split_iter) #...
#coding = utf-8 import json class MatchDto: def __init__(self, jsonData): #self.jsonData = jsonData # self.seasonId = jsonData["seasonId"] if "seasonId" in jsonData else None self.queueId = jsonData["queueId"] if "queueId" in jsonData else None self.gameId = jsonData["gameId"] if "gameId" in jsonData else None s...
# -*- coding: utf-8 -*- import os import re import copy import time import numpy import pandas import shutil import subprocess import multiprocessing from scipy import stats from ruamel import yaml # from safirpy.safir_problem_definition import file_0 as spd_version_0 def preprocess_structured_directories(path_work...
<gh_stars>1-10 import sys sys.path.append('/opt/conda/lib/python3.7/site-packages') bd2 = '/home/jupyter/' from whacc import utils, image_tools, transfer_learning, analysis import matplotlib.pyplot as plt from tensorflow.keras.layers import Dense, Dropout from tensorflow.keras.models import Model from tensorflow impor...
<gh_stars>100-1000 from monk.tf_keras_1.finetune.imports import * from monk.system.imports import * from monk.tf_keras_1.finetune.level_14_master_main import prototype_master class prototype(prototype_master): ''' Main class for Mxnet Backend Args: verbose (int): Set verbosity levels 0 - Print Nothing 1 - Pri...
def __getitem__(self, i): return self.stops[i] def __iter__(self): return iter(self.stops) def __repr__(self): return ( 'Route(id={}, mode={}, ref={}, name={}, network={}, interval={}, ' 'circular={}, num_stops={}, line_length={} m, from={}, to={}' ).format( self.id, self.mode, self.ref, self.name, self....
needed so that the first two // significant digits are visible. function stringify(number) { "use strict"; if (number === 0) { return number; } if (number < 0) { return "-" + stringify(-number); } var precision = 1; var result = 0; while (result === 0) { precision *= 10; result = Math.round(number * precisi...
FieldPanel('model_fotogrametrie') ] edit_handler = TabbedInterface( [ ObjectList(localizare_panels, heading='Localizare/peisaj'), ObjectList(ansamblu_panels, heading='Ansamblu construit'), ObjectList(arhitectura_panels, heading='Arhitectura bisericii'), ObjectList(structura_panels, heading='Structura'), Object...
"error": "ID {} already exists in status database".format(status["source_id"]) } try: table.put_item(Item=status, ConditionExpression=Attr("source_id").not_exists()) except Exception as e: return { "success": False, "error": repr(e) } else: logger.info("Status for {}: Created".format(status["source_id"])) re...
<filename>text_renderer/api.py import math import os import random import uuid import glob import pygame from pygame import freetype import numpy as np from scipy import ndimage import cv2 from PIL import Image from tqdm import tqdm from .font import FontState, ColorState, BaselineState, BorderState, AffineTransformS...
<reponame>tradenity/python-sdk<gh_stars>1-10 # coding: utf-8 """ Tradenity API Tradenity eCommerce Rest API Contact: <EMAIL> """ from __future__ import absolute_import import re import pprint # python 2 and python 3 compatibility library import six from tradenity.api_client import ApiClient class ReturnLi...
<filename>tests/test_psygnal.py import gc import time import weakref from functools import partial, wraps from inspect import Signature from types import FunctionType from typing import Optional from unittest.mock import MagicMock, call import pytest from psygnal import Signal, SignalInstance from psygnal._signal imp...
<filename>tideturb/tideturb.py import pickle import matplotlib.pyplot as plt import numpy as np import matplotlib as mpl import os import tqdm mpl.use("Agg") """This is a model of a turbidity current influenced by tidal flows in a submarine canyon. The two-layer shallow water equation system is employed. The upper ...
When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. :param int timeout_seconds: Timeout for the list/watch call. :return: V1PersistentVolumeClaimList If the method is called asynchronously, returns the request thr...
<filename>NNSubsampling/NNSubsampling.py # -*- coding: utf-8 -*- """ Created on Thu Mar 23 14:36:48 2017 @author: <NAME> """ from __future__ import print_function import numpy as np from sklearn import preprocessing import time from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler imp...
<reponame>SACGF/variantgrid<gh_stars>1-10 """ Imports work by: import_patient_records: - Read the CSV with pandas, and create PatientRecord entries - Set whether a record is valid or needs manual intervention - Display what's going to happen with the records (ie good, bad etc) - Then, click SUBMIT button after re...
<filename>hsr4hci/metrics.py """ Methods for computing performance metrics (e.g., SNR, logFPF, ...). """ # ----------------------------------------------------------------------------- # IMPORTS # ----------------------------------------------------------------------------- from typing import Any, Dict, List, Optiona...
<reponame>Keneral/asystem # # Copyright (C) 2012 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
value): pass # ____________________________________________________________ # ____________________________________________________________ # check out built-in package abc: class ABCMeta, abstractmethod, abstractproperty... # see http://docs.python.org/whatsnew/2.6.html PEP 3119 abstract base classes # _debugging = ...
<reponame>ckyycc/hana_os_monitor_script_v2<filename>test/test_analyzer.py from unittest import TestCase from unittest.mock import MagicMock, call, patch from util import MonitorUtility as Mu from util import MonitorConst as Mc from util import InfoType from analyzer import DataAnalyzer class TestAnalyzer(TestCase): ...
<reponame>AnyOfYou/pyftpsync # -*- coding: utf-8 -*- """ (c) 2012-2021 <NAME>; see https://github.com/mar10/pyftpsync Licensed under the MIT license: https://www.opensource.org/licenses/mit-license.php """ import configparser import getpass import logging import netrc import os import sys from datetime import datetime ...
<gh_stars>0 #!/usr/bin/env python # -------------------------------------------------------- # Copyright (c) 2018 VidTeq # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- import os import os.path as osp import time import matplotl...
in path_instance assert path_instance not in Path('absolute/dummy') def test_invalid_types(self, make_path): path_left = Path(make_path('dummy/path/left')) with pytest.raises(TypeError): path_left + 1 with pytest.raises(TypeError): path_left + (1,) with pytest.raises(TypeError): path_left + [1] with pytest.r...
a memory-efficient manner. Array x is stacked vertically n times. .. warning:: It is not safe to write to the output array. Multiple elements may point to the same piece of memory, so modifying one value may change others. Parameters ---------- x : 1D array or sequence Array or sequence containing the data....
== x_closest and G_2_1_array[i][1] == y_closest: # add node and edge! string_point = '{},{}'.format(x_closest, y_closest) string_interp = '{},{}'.format(x_interp, y_interp) G_2_1.add_node(string_interp) G_2_1.add_edge(string_point, string_interp) print("... point added to G_2_1") return if not bool_pos3: G_2_3...
# coding: utf-8 """ Trend Micro Deep Security API Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate Deep Sec...
- 2*y, 0, -2*x*y + 1, 0, 6*x + y, 0, x + 2*y, -6*x - y, 0] Exterior algebras inherit from Clifford algebras, so supercommutators work as well. We verify the exterior algebra is supercommutative:: sage: E.<x,y,z,w> = ExteriorAlgebra(QQ) sage: all(b1.supercommutator(b2) == 0 ....: for b1 in E.basis() for b2 in E...
<filename>my_models/resnet.py # -*- coding:utf-8 -*- # ResNet模型代码 import numpy as np import paddle import paddle.nn as nn import paddle.nn.functional as F # ResNet中使用了BatchNorm层,在卷积层的后面加上BatchNorm以提升数值稳定性 # 定义卷积批归一化块 class ConvBNLayer(paddle.nn.Layer): def __init__(self, num_channels, num_filters, filter_size, s...
import model.model as model import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate import plotly.graph_objects as go import plotly.express as px import plotly.figure_factory as ff import numpy as np ...
bool When overridden in a derived class, is called by System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm. Returns: true if the element is must be completed; otherwise, false. """ pass @staticmethod def ListenerExists(eventId): """ ListenerExists(eventId: AutomationEvents) -...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/evaluation/evaluation.sequences.ipynb (unless otherwise specified). __all__ = ['eval_seqreveal', 'eval_staticprofile', 'eval_reclength', 'eval_profilelength'] # Cell import pandas as pd import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt from .metr...
sigma' % (gate_half,nsigma)) #gate_half = nsigma*abs_dev_med #logger.debug('set gate_half=%.3f for intensity gated average, which is %.3f * abs_dev_med' % (gate_half,nsigma)) # 2nd loop over recs in block to evaluate gated parameters logger.debug('begin 2nd iteration') sta_int_lo = np.zeros(shape, dtype=np.uint6...
r""" Phrases that contain meanings of :class:`.Statement`\s. Can contain references to other :class:`.Statement`\s, to numeric values, to dates, or to quantities (with the use of the `pint <https://pint.readthedocs.io/en/>`_ library). """ from __future__ import annotations from abc import ABCMeta from itertools impo...
<reponame>roundup-tracker/roundup<gh_stars>10-100 # # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/) # This module is free software, and you may redistribute it and/or modify # under the same terms as Python, so long as this copyright message and # disclaimer are retained in their original...
<reponame>Quinlan2018/pyblp """Optimization routines.""" import contextlib import functools import os import sys import warnings from pathlib import Path from typing import Any, Callable, Iterable, Iterator, Optional, Tuple, Union import numpy as np import scipy.optimize from .. import options from ..utilities.basic...
rows = c.fetchall() conn.commit() conn.close() keys = [] for key in keys_db: if (key == 'cash'): keys.append("safe") # safe is not in the db (want to see it though) if key != "json string": keys.append(key) TableCls = create_table('TableCls') for key in keys: TableCls.add_column(key, Col(key)) items = [] a...
# -*- coding: utf-8 -*- import os, time, subprocess, threading, ipaddress, paramiko, socket import io import re, signal import changed_password_generator, changed_password_generator_lite import pandas as pd import tkinter as tk from socket import AF_INET, SOCK_DGRAM from tkinter import ttk, messagebox, TclError, simple...
from __future__ import absolute_import, division, print_function import argparse import logging import sys import numpy as np import pandas as pd from sklearn.neighbors import NearestNeighbors from sklearn.preprocessing import StandardScaler from sklearn.utils import check_random_state logger = logging.getLogger('ca...
<reponame>googleinterns/cl_analysis # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import requests import json import sys import numpy as np from Group import Group # python3 migrate_users_and_groups.py.py qa 0000000000000000000000000000000000000000000000000000000000000000 qa 0000000000000000000000000000000000000000000000000000000000000000 def get_groups(env, admin_api_key): api_url = "https://" ...
version 1. # old_version = self.string base, _base_= [], old_version.split(".") increase = True for i in _base_: base.append(int(i)) count = len(base)-1 for i in range(len(base)): if increase: if base[count] >= 9: if count > 0: base[count-1] += 1 base[count] = 0 ...
self.Tabdata.Set_edition(4) self.assertEqual(self.Tabdata.edition(), 4) def testSet_edition(self): # check we can put a value in and read it out self.Tabdata.Set_edition(3) self.assertEqual(self.Tabdata.edition(), 3) def testcompressflag(self): # check we can put a value in and read it out self.Tabdata.Set_co...
from stonky.enums import CurrencyType from stonky.stock import Stock AMD_STOCK = Stock( ticket="AMD", currency=CurrencyType.USD, current_amount=452.49, delta_amount=14.540009, delta_percent=0.033234306, market_price=452.04, volume=41486205, ) AAPL_STOCK = Stock( ticket="AAPL", currency=CurrencyType.USD, cur...
<reponame>uktrade/market-access-python-frontend<gh_stars>1-10 from http import HTTPStatus from django.urls import resolve, reverse from mock import patch from core.tests import ReportsTestCase from reports.models import Report from reports.views import ( NewReportBarrierAdminAreasView, NewReportBarrierLocationAddAd...
<gh_stars>0 # Copyright (c) 2014 Dell Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
from threading import Thread from spock.client import Client from spock.plugins import DefaultPlugins from spock.plugins.core.event import EventPlugin from spock.plugins.helpers.clientinfo import ClientInfoPlugin from spock.plugins.helpers.move import MovementPlugin from spock.plugins.helpers.world import WorldPlugin ...
_get_names(obj, json_paths) else: names = [] for path in json_paths: names += _get_names(obj, path) # Make the list contain unique names. It keeps the original order in Python 3.6+ # because dicts are ordered. We use the same string for both the name and the value. pairs = [(name, name) for name in dict.fromkey...
<filename>apps/site/api/tests/record_tests.py<gh_stars>1-10 from django import test from rest_framework.settings import api_settings from localground.apps.site.api import views from localground.apps.site import models from localground.apps.site.api.tests.base_tests import ViewMixinAPI import urllib import json from res...
# -*- coding: utf-8 -*- """ Playground documentation. Module defining Playground Base Class """ import os from abc import ABC import yaml import pymunk from .utils import PositionAreaSampler from .utils.definitions import SPACE_DAMPING, CollisionTypes, SceneElementTypes # pylint: disable=unused-argument # pylint:...
<filename>smarts/core/smarts.py # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # 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 witho...
RESURL = 'https://www.googleapis.com/customsearch/v1?' DEFAULT_CX = 'a07e95fc47a466f98' START_PAGE_CAP = 91 CR = { 'Afghanistan': 'countryAF', 'Albania': 'countryAL', 'Algeria': 'countryDZ', 'American Samoa': 'countryAS', 'Andorra': 'countryAD', 'Angola': 'countryAO', 'Anguilla': 'countryAI', 'Antarctica': 'co...
<reponame>SwapneelM/projectaeora from collections import defaultdict import html2text from textblob import TextBlob import requests import bs4 import os from datetime import datetime, timedelta def get_stopwords(): """ :return: A list of stop words """ # source=http://xpo6.com/list-of-english-stop-words/ filepat...