repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
ytyaru0/Python.TemplateFileMaker.20180314204216
src/backup/template/PositionalArgumentTemplate.py
4849f982acea5d86b711c5dec4cc046016ab1031
from string import Template import re class PositionalArgumentTemplate(Template): # (?i): 大文字小文字を区別しないモードを開始する # (?-i): 大文字小文字を区別しないモードを無効にする idpattern_default = Template.idpattern # (?-i:[_a-zA-Z][_a-zA-Z0-9]*) idpattern = '([0-9]+)' def find_place_holders(self, template:str): #for m in re...
[]
kdhaigud/easycla
cla-backend/cla/tests/unit/test_company.py
f913f8dbf658acf4711b601f9312ca5663a4efe8
# Copyright The Linux Foundation and each contributor to CommunityBridge. # SPDX-License-Identifier: MIT import json import os import requests import uuid import hug import pytest from falcon import HTTP_200, HTTP_409 import cla from cla import routes ID_TOKEN = os.environ.get('ID_TOKEN') API_URL = os.environ.get('...
[((267, 293), 'os.environ.get', 'os.environ.get', (['"""ID_TOKEN"""'], {}), "('ID_TOKEN')\n", (281, 293), False, 'import os\n'), ((304, 329), 'os.environ.get', 'os.environ.get', (['"""API_URL"""'], {}), "('API_URL')\n", (318, 329), False, 'import os\n'), ((442, 457), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', ...
mathematicalmichael/SpringNodes
py/WatchDialog.py
3ff4034b6e57ee6efa55c963e1819f3d30a2c4ab
# Copyright(c) 2017, Dimitar Venkov # @5devene, dimitar.ven@gmail.com # www.badmonkeys.net import clr clr.AddReference('System.Windows.Forms') clr.AddReference('System.Drawing') from System.Drawing import Point, Color, Font from System.Windows.Forms import * from cStringIO import StringIO str_file = StringIO() size1...
[((104, 144), 'clr.AddReference', 'clr.AddReference', (['"""System.Windows.Forms"""'], {}), "('System.Windows.Forms')\n", (120, 144), False, 'import clr\n'), ((145, 179), 'clr.AddReference', 'clr.AddReference', (['"""System.Drawing"""'], {}), "('System.Drawing')\n", (161, 179), False, 'import clr\n'), ((304, 314), 'cSt...
mvj3/leetcode
292-nim-game.py
3111199beeaefbb3a74173e783ed21c9e53ab203
""" Question: Nim Game My Submissions Question You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones. Bot...
[]
lldelisle/bx-python
script_tests/maf_extract_ranges_indexed_tests.py
19ab41e0905221e3fcaaed4b74faf2d7cda0d15a
import unittest import base class Test(base.BaseScriptTest, unittest.TestCase): command_line = "./scripts/maf_extract_ranges_indexed.py ./test_data/maf_tests/mm8_chr7_tiny.maf -c -m 5 -p mm8." input_stdin = base.TestFile(filename="./test_data/maf_tests/dcking_ghp074.bed") output_stdout = base.TestFile(fi...
[((218, 283), 'base.TestFile', 'base.TestFile', ([], {'filename': '"""./test_data/maf_tests/dcking_ghp074.bed"""'}), "(filename='./test_data/maf_tests/dcking_ghp074.bed')\n", (231, 283), False, 'import base\n'), ((304, 369), 'base.TestFile', 'base.TestFile', ([], {'filename': '"""./test_data/maf_tests/dcking_ghp074.maf...
elxavicio/QSTK
qstklearn/1knn.py
4981506c37227a72404229d5e1e0887f797a5d57
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on Feb 20, 2011 @author: John Cornwell @organization: Georgia Institute of Technology @contact: JohnW...
[]
robert-anderson/pyscf
pyscf/nao/m_comp_coulomb_pack.py
cdc56e168cb15f47e8cdc791a92d689fa9b655af
# Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
[((1437, 1477), 'pyscf.nao.m_ao_matelem.ao_matelem_c', 'ao_matelem_c', (['sv.ao_log.rr', 'sv.ao_log.pp'], {}), '(sv.ao_log.rr, sv.ao_log.pp)\n', (1449, 1477), False, 'from pyscf.nao.m_ao_matelem import ao_matelem_c\n'), ((1569, 1606), 'numpy.zeros', 'np.zeros', (['(sv.natm + 1)'], {'dtype': 'np.int64'}), '(sv.natm + 1,...
panguan737/nova
nova/tests/unit/test_service_auth.py
0d177185a439baa228b42c948cab4e934d6ac7b8
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
[((1027, 1087), 'mock.patch.object', 'mock.patch.object', (['ks_loading', '"""load_auth_from_conf_options"""'], {}), "(ks_loading, 'load_auth_from_conf_options')\n", (1044, 1087), False, 'import mock\n'), ((1375, 1435), 'mock.patch.object', 'mock.patch.object', (['ks_loading', '"""load_auth_from_conf_options"""'], {}),...
LittleWat/MCD_DA
classification/model/build_gen.py
37cb1bc38c203702e22c7c0c37e284d0294714fb
import svhn2mnist import usps import syn2gtrsb import syndig2svhn def Generator(source, target, pixelda=False): if source == 'usps' or target == 'usps': return usps.Feature() elif source == 'svhn': return svhn2mnist.Feature() elif source == 'synth': return syn2gtrsb.Feature() def ...
[((173, 187), 'usps.Feature', 'usps.Feature', ([], {}), '()\n', (185, 187), False, 'import usps\n'), ((408, 424), 'usps.Predictor', 'usps.Predictor', ([], {}), '()\n', (422, 424), False, 'import usps\n'), ((465, 487), 'svhn2mnist.Predictor', 'svhn2mnist.Predictor', ([], {}), '()\n', (485, 487), False, 'import svhn2mnis...
pfnet-research/deep-table
deep_table/nn/models/loss/info_nce_loss.py
a19c0c3048484017d5f24806604c3b3470bcf550
import torch from torch import Tensor from torch.nn.modules.loss import _Loss class InfoNCELoss(_Loss): """Info NCE Loss. A type of contrastive loss function used for self-supervised learning. References: A. Oord, Y. Li, and O. Vinyals, "Representation Learning with Contrastive Predictive Cod...
[((766, 784), 'torch.exp', 'torch.exp', (['(sim / t)'], {}), '(sim / t)\n', (775, 784), False, 'import torch\n'), ((811, 834), 'torch.diagonal', 'torch.diagonal', (['exp_sim'], {}), '(exp_sim)\n', (825, 834), False, 'import torch\n')]
korkin25/patroni
patroni/config.py
333d41d9f039b5a799940c8a6fbc75dcbe0e9a31
import json import logging import os import shutil import tempfile import yaml from collections import defaultdict from copy import deepcopy from patroni import PATRONI_ENV_PREFIX from patroni.exceptions import ConfigParseError from patroni.dcs import ClusterConfig from patroni.postgresql.config import CaseInsensitive...
[((426, 453), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (443, 453), False, 'import logging\n'), ((3875, 3926), 'os.path.join', 'os.path.join', (['self._data_dir', 'self.__CACHE_FILENAME'], {}), '(self._data_dir, self.__CACHE_FILENAME)\n', (3887, 3926), False, 'import os\n'), ((4137, ...
fdiary/Products.CMFCore
src/Products/CMFCore/tests/test_DirectoryView.py
361a30e0c72a15a21f88433b8d5fc49331f36728
############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
[((11700, 11720), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (11718, 11720), False, 'import unittest\n'), ((1418, 1459), 'Products.CMFCore.DirectoryView.registerDirectory', 'registerDirectory', (['"""fake_skins"""', '_globals'], {}), "('fake_skins', _globals)\n", (1435, 1459), False, 'from Products.C...
eshendricks/pyCycle
pycycle/elements/flight_conditions.py
2b7f9c2a60c6d93d5e561c71b27e75566b3baef0
import openmdao.api as om from pycycle.thermo.cea import species_data from pycycle.constants import AIR_ELEMENTS from pycycle.elements.ambient import Ambient from pycycle.elements.flow_start import FlowStart class FlightConditions(om.Group): """Determines total and static flow properties given an altitude and Ma...
[((3148, 3160), 'openmdao.api.Problem', 'om.Problem', ([], {}), '()\n', (3158, 3160), True, 'import openmdao.api as om\n'), ((3176, 3186), 'openmdao.api.Group', 'om.Group', ([], {}), '()\n', (3184, 3186), True, 'import openmdao.api as om\n'), ((2177, 2194), 'openmdao.api.NewtonSolver', 'om.NewtonSolver', ([], {}), '()\...
mashaka/TravelHelper
server/cauth/views.py
8a216dd13c253e138f241187dee46e6e53281a7b
from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AdminPasswordChangeForm, PasswordChangeForm, UserCreationForm from django.contrib.auth import update_session_auth_hash, login, authenticate from django.contrib import messages from django...
[((870, 899), 'django.http.HttpResponse', 'HttpResponse', (['url'], {'status': '(302)'}), '(url, status=302)\n', (882, 899), False, 'from django.http import HttpResponse\n'), ((1009, 1082), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['UserSocialAuth'], {'user': 'request.user', 'provider': '"""facebook"...
lviala-zaack/zephyr
samples/modules/tensorflow/magic_wand/train/data_split_person.py
bf3c6e7ba415dd85f1b68eb69ea2779b234c686f
# Lint as: python3 # coding=utf-8 # Copyright 2019 The TensorFlow 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.apache.org/licenses/LICE...
[((1405, 1420), 'random.seed', 'random.seed', (['(30)'], {}), '(30)\n', (1416, 1420), False, 'import random\n'), ((1425, 1451), 'random.shuffle', 'random.shuffle', (['whole_data'], {}), '(whole_data)\n', (1439, 1451), False, 'import random\n'), ((2055, 2088), 'data_split.read_data', 'read_data', (['"""./data/complete_d...
josebalius/go-spacemesh
tests/k8s_handler.py
7ad61dcbe30f361b348e93c97eb3871ab79f1848
from datetime import datetime from kubernetes import client from kubernetes.client.rest import ApiException import os import time import yaml from tests import config as conf import tests.utils as ut def remove_clusterrole_binding(shipper_name, crb_name): # remove clusterrolebind k8s_client = client.RbacAuth...
[((305, 336), 'kubernetes.client.RbacAuthorizationV1Api', 'client.RbacAuthorizationV1Api', ([], {}), '()\n', (334, 336), False, 'from kubernetes import client\n'), ((9695, 9709), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (9707, 9709), False, 'from datetime import datetime\n'), ((2378, 2510), 'tests.uti...
m4rcu5/natlas
natlas-agent/config.py
d1057c5349a5443cecffb3db9a6428f7271b07ad
import os from dotenv import load_dotenv class Config: # Current Version NATLAS_VERSION = "0.6.10" BASEDIR = os.path.abspath(os.path.dirname(__file__)) load_dotenv(os.path.join(BASEDIR, '.env')) def get_int(self, varname): tmp = os.environ.get(varname) if tmp: return int(tmp) return None def get_bo...
[((132, 157), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (147, 157), False, 'import os\n'), ((172, 201), 'os.path.join', 'os.path.join', (['BASEDIR', '""".env"""'], {}), "(BASEDIR, '.env')\n", (184, 201), False, 'import os\n'), ((241, 264), 'os.environ.get', 'os.environ.get', (['varname']...
rubind/host_unity
rdr2019/mcmc_lc_jla_fit.py
a1908d80a8b6354e4516cccbf2b1a214cbc7daa9
import os import sys import click import pickle import sncosmo import numpy as np from astropy.table import Table DATA_PATH = '/home/samdixon/jla_light_curves/' def modify_error(lc, error_floor=0.): """Add an error floor of `error_floor` times the maximum flux of the band to each observation """ ...
[((841, 868), 'astropy.table.Table', 'Table', (['new_lc'], {'meta': 'lc.meta'}), '(new_lc, meta=lc.meta)\n', (846, 868), False, 'from astropy.table import Table\n'), ((693, 720), 'numpy.max', 'np.max', (['data.flux[band_cut]'], {}), '(data.flux[band_cut])\n', (699, 720), True, 'import numpy as np\n'), ((759, 835), 'num...
toddrme2178/OpenMDAO
openmdao/core/tests/test_system.py
379cc6216d13d380e11cb3a46f03960981de4660
""" Unit tests for the system interface.""" import unittest from six import assertRaisesRegex from six.moves import cStringIO import numpy as np from openmdao.api import Problem, Group, IndepVarComp, ExecComp from openmdao.test_suite.components.options_feature_vector import VectorDoublingComp from openmdao.utils.ass...
[((10995, 11010), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11008, 11010), False, 'import unittest\n'), ((467, 474), 'openmdao.api.Group', 'Group', ([], {}), '()\n', (472, 474), False, 'from openmdao.api import Problem, Group, IndepVarComp, ExecComp\n'), ((698, 705), 'openmdao.api.Group', 'Group', ([], {}), ...
fabiangunzinger/sample_project
code/src/db/create_db.py
a5c87d0c3ff2f6ed39f3e3a18557c0ab439f6b42
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import os import sqlite3 import sys import pandas as pd from src import config def parse_args(argv): parser = argparse.ArgumentParser() parser.add_argument('sample') parser.add_argument('replace') return parser.parse_args() def db_table...
[((180, 205), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (203, 205), False, 'import argparse\n'), ((380, 437), 'pandas.read_sql', 'pd.read_sql', (['"""select name from sqlite_master"""', 'connection'], {}), "('select name from sqlite_master', connection)\n", (391, 437), True, 'import pandas...
craigderington/responder-persons-api
tests/test_responder.py
d2270d2f761c5dd3dbe253113d410f3e37d4d217
# coding: utf-8 import pytest import app as service import yaml import responder from starlette.responses import PlainTextResponse @pytest.fixture def api(): return service.api def test_hello_world(api): r = api.requests.get("/api/v1.0/index") assert r.text == "Hello, World!" def test_basic_route(api...
[((993, 1013), 'yaml.load', 'yaml.load', (['r.content'], {}), '(r.content)\n', (1002, 1013), False, 'import yaml\n'), ((1366, 1408), 'starlette.responses.PlainTextResponse', 'PlainTextResponse', (['"""Suppressed error"""', '(500)'], {}), "('Suppressed error', 500)\n", (1383, 1408), False, 'from starlette.responses impo...
axdahl/SC-MMGP
examples/solar/p25_nonsparse_cmmgp.py
c6cd9d9de66bb7074925a4b6485f10a74bdd9f68
# -*- coding: utf-8 -*- """ Script to execute example covarying MMGP regression forecasting model with full Krhh. Inputs: Data training and test sets (dictionary pickle) Data for example: - normalised solar data for 25 sites for 15 minute forecast - N_train = 4200, N_test = 2276, P = 25, D = 51 - Xtr[:, :5...
[((2670, 2691), 'mmgp.util.util.get_flags', 'util.util.get_flags', ([], {}), '()\n', (2689, 2691), False, 'from mmgp import util\n'), ((6258, 6331), 'mmgp.likelihoods.CovaryingRegressionNetwork', 'likelihoods.CovaryingRegressionNetwork', (['output_dim', 'node_dim'], {'std_dev': '(0.2)'}), '(output_dim, node_dim, std_de...
cfreebuf/kubeedge-examples
cruiser-lib/test/positioning/test_position_hl_commander.py
9b2ab402c33546215a0a9e02e92f5b0aa88bcff9
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 2018 Bitcraze AB # # Th...
[((1401, 1420), 'unittest.mock.patch', 'patch', (['"""time.sleep"""'], {}), "('time.sleep')\n", (1406, 1420), False, 'from unittest.mock import MagicMock, patch, call\n'), ((11056, 11071), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11069, 11071), False, 'import unittest\n'), ((1522, 1556), 'unittest.mock.Magi...
NaomiatLibrary/OpenNMT-kpg-release
onmt/keyphrase/pke/unsupervised/graph_based/expandrank.py
1da3468d7dad22529a77f3526abf9b373bd3dc4c
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Florian Boudin # Date: 10-02-2018 """ExpandRank keyphrase extraction model. Graph-based ranking approach to keyphrase extraction described in: * Xiaojun Wan and Jianguo Xiao. Single Document Keyphrase Extraction Using Neighborhood Knowledge. *In proceedings...
[((3236, 3246), 'onmt.keyphrase.pke.base.LoadFile', 'LoadFile', ([], {}), '()\n', (3244, 3246), False, 'from onmt.keyphrase.pke.base import LoadFile\n'), ((5908, 5966), 'networkx.pagerank_scipy', 'nx.pagerank_scipy', (['self.graph'], {'alpha': '(0.85)', 'weight': '"""weight"""'}), "(self.graph, alpha=0.85, weight='weig...
mmeidlinger/cdk-microservices-labs
5-serverless-xray-stack/app.py
a646c05d4bb0950f9915f9b15f810e82ba8d4e9a
#!/usr/bin/env python3 from aws_cdk import core from fagate_serverless.fagate_serverless_stack import FagateServerlessStack app = core.App() FagateServerlessStack(app, "serverless-xray-stack") app.synth()
[((134, 144), 'aws_cdk.core.App', 'core.App', ([], {}), '()\n', (142, 144), False, 'from aws_cdk import core\n'), ((145, 196), 'fagate_serverless.fagate_serverless_stack.FagateServerlessStack', 'FagateServerlessStack', (['app', '"""serverless-xray-stack"""'], {}), "(app, 'serverless-xray-stack')\n", (166, 196), False, ...
nickmelnikov82/dash
dash/long_callback/managers/celery_manager.py
e774908da770bee83f3213e0307c27ed8a40500e
import json import inspect import hashlib from _plotly_utils.utils import PlotlyJSONEncoder from dash.long_callback.managers import BaseLongCallbackManager class CeleryLongCallbackManager(BaseLongCallbackManager): def __init__(self, celery_app, cache_by=None, expire=None): """ Long callback manag...
[((4202, 4223), 'inspect.getsource', 'inspect.getsource', (['fn'], {}), '(fn)\n', (4219, 4223), False, 'import inspect\n'), ((3614, 3632), 'json.loads', 'json.loads', (['result'], {}), '(result)\n', (3624, 3632), False, 'import json\n'), ((3298, 3323), 'json.loads', 'json.loads', (['progress_data'], {}), '(progress_dat...
victor-kironde/botbuilder-python
libraries/botframework-connector/botframework/connector/token_api/_token_api_client.py
e893d9b036d7cf33cf9c9afd1405450c354cdbcd
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
[((1681, 1706), 'msrest.Serializer', 'Serializer', (['client_models'], {}), '(client_models)\n', (1691, 1706), False, 'from msrest import Serializer, Deserializer\n'), ((1735, 1762), 'msrest.Deserializer', 'Deserializer', (['client_models'], {}), '(client_models)\n', (1747, 1762), False, 'from msrest import Serializer,...
shikshan/soppi
soppi/sample.py
007f654b0e9fe4bf7fc09e967615cb205a67dbaa
# content of test_sample.py def inc(x: int) -> int: return x + 1
[]
fairhopeweb/saleor
saleor/order/migrations/0081_auto_20200406_0456.py
9ac6c22652d46ba65a5b894da5f1ba5bec48c019
# Generated by Django 3.0.4 on 2020-04-06 09:56 from django.db import migrations from saleor.order import OrderStatus def match_orders_with_users(apps, *_args, **_kwargs): Order = apps.get_model("order", "Order") User = apps.get_model("account", "User") orders_without_user = Order.objects.filter( ...
[((774, 819), 'django.db.migrations.RunPython', 'migrations.RunPython', (['match_orders_with_users'], {}), '(match_orders_with_users)\n', (794, 819), False, 'from django.db import migrations\n')]
jhpark428/studio
function/python/brightics/function/textanalytics/regex.py
539457b3026dda827c1b17b4cb851946e34e3b85
""" Copyright 2019 Samsung SDS 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 ...
[((820, 872), 'brightics.common.utils.check_required_parameters', 'check_required_parameters', (['_regex', 'params', "['table']"], {}), "(_regex, params, ['table'])\n", (845, 872), False, 'from brightics.common.utils import check_required_parameters\n'), ((2179, 2202), 're.compile', 're.compile', (['raw_pattern'], {}),...
travc/outbreak-reporter
bin/temperature_functions.py
0f03ca66993827ae1866d09e3cf5d9f6d4acb633
#!/usr/bin/env python3 import sys import os import logging import numpy as np import pandas as pd import dateutil def tempF2C(x): return (x-32.0)*5.0/9.0 def tempC2F(x): return (x*9.0/5.0)+32.0 def load_temperature_hdf5(temps_fn, local_time_offset, basedir=None, start_year=None, truncate_to_full_day=False): ## ...
[((562, 592), 'pandas.read_hdf', 'pd.read_hdf', (['temps_fn', '"""table"""'], {}), "(temps_fn, 'table')\n", (573, 592), True, 'import pandas as pd\n'), ((688, 732), 'dateutil.tz.tzoffset', 'dateutil.tz.tzoffset', (['local_time_offset', 'tmp'], {}), '(local_time_offset, tmp)\n', (708, 732), False, 'import dateutil\n'), ...
lkusch/Kratos
applications/CSharpWrapperApplication/tests/test_CSharpWrapperApplication.py
e8072d8e24ab6f312765185b19d439f01ab7b27b
# import Kratos import KratosMultiphysics import KratosMultiphysics.StructuralMechanicsApplication as StructuralMechanicsApplication import KratosMultiphysics.CSharpWrapperApplication as CSharpWrapperApplication import run_cpp_unit_tests # Import Kratos "wrapper" for unittests import KratosMultiphysics.KratosUnittest ...
[((469, 544), 'KratosMultiphysics.kratos_utilities.CheckIfApplicationsAvailable', 'kratos_utilities.CheckIfApplicationsAvailable', (['"""ExternalSolversApplication"""'], {}), "('ExternalSolversApplication')\n", (514, 544), True, 'import KratosMultiphysics.kratos_utilities as kratos_utilities\n'), ((2172, 2259), 'Kratos...
mezidia/mezidia-airlines-backend
backend/api/models.py
bc0b27b785f45ac83552f7fbb879cd977171c2fc
from sqlalchemy import Column, Integer, String, ForeignKey, Float from sqlalchemy.orm import relationship from .database import Base class Post(Base): __tablename__ = "posts" id = Column(Integer, primary_key=True, nullable=False, index=True) full_name = Column(String, nullable=False) last_place = Co...
[((192, 253), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'nullable': '(False)', 'index': '(True)'}), '(Integer, primary_key=True, nullable=False, index=True)\n', (198, 253), False, 'from sqlalchemy import Column, Integer, String, ForeignKey, Float\n'), ((270, 300), 'sqlalchemy.Column', 'Colu...
Ganeshrockz/Flask-Python-Dev
run.py
522b280484e8f4cf3877b378a1334c501ffbc41e
from flask import Flask, flash, render_template, redirect, url_for from flask.ext.pymongo import PyMongo from flask import request app=Flask(__name__) app.config['MONGO_DBNAME']='stud' app.config['MONGO_URI']='mongodb://localhost:27017/stud' mongo=PyMongo(app) """ @app.route('/add') def add(): user=mongo.db.users ...
[((135, 150), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (140, 150), False, 'from flask import Flask, flash, render_template, redirect, url_for\n'), ((248, 260), 'flask.ext.pymongo.PyMongo', 'PyMongo', (['app'], {}), '(app)\n', (255, 260), False, 'from flask.ext.pymongo import PyMongo\n'), ((2007, 2058...
jussiarpalahti/respa
resources/tests/conftest.py
c308bcb96e56d9401e22df94d3073e248618e243
# -*- coding: utf-8 -*- import pytest import datetime from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from rest_framework.test import APIClient, APIRequestFactory from resources.enums import UnitAuthorizationLevel from resources.models import Resource, ResourceType, Unit, Pu...
[((970, 1021), 'pytest.fixture', 'pytest.fixture', ([], {'params': "[None, 'user', 'staff_user']"}), "(params=[None, 'user', 'staff_user'])\n", (984, 1021), False, 'import pytest\n'), ((660, 671), 'rest_framework.test.APIClient', 'APIClient', ([], {}), '()\n', (669, 671), False, 'from rest_framework.test import APIClie...
x2dev/device_leeco_x2
qcmetadataprinter/struct.py
9bf4549b5f64390ca4da291745b2a66a8e3f006e
#!/bin/python3 with open('../camera/QCamera2/stack/common/cam_intf.h', 'r') as f: data = f.read() f.closed start = data.find(' INCLUDE(CAM_INTF_META_HISTOGRAM') end = data.find('} metadata_data_t;') data = data[start:end] metadata = data.split("\n") metalist = list() for line in metadata: if (line.starts...
[]
c-yan/atcoder
abc/abc121/abc121d-2.py
940e49d576e6a2d734288fadaf368e486480a948
def g(A, n): if A == -1: return 0 return A // (2 * n) * n + max(A % (2 * n) - (n - 1), 0) def f(A, B): result = 0 for i in range(48): t = 1 << i if (g(B, t) - g(A - 1, t)) % 2 == 1: result += t return result A, B = map(int, input().split()) print(f(A, B))
[]
kizunai/Weather-Scrapy
log_mysql.py
d2104d28dc303f6710b043f9821dcb84c665665d
import logging from logging.handlers import TimedRotatingFileHandler class MyLog(): def __init__(self, name, filename): self.logger = logging.getLogger(name) if not self.logger.handlers: self.logger.setLevel(logging.INFO) ch = TimedRotatingFileHandler(filename=filename, when...
[((147, 170), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (164, 170), False, 'import logging\n'), ((272, 350), 'logging.handlers.TimedRotatingFileHandler', 'TimedRotatingFileHandler', ([], {'filename': 'filename', 'when': '"""midnight"""', 'encoding': '"""utf-8"""'}), "(filename=filename, when...
lerooze/django-fiesta
src/fiesta/urls.py
d521f50bcdd3d40e91f0474ec2fa7e256758e0a5
# urls.py from django.urls import path, register_converter from fiesta import converters from fiesta.views import views from rest_framework.urlpatterns import format_suffix_patterns # "http://django-sdmx.org/wsrest/" # "http://django-sdmx.org/ws/" register_converter(converters.ResourceConverter, 'res') register_con...
[((252, 307), 'django.urls.register_converter', 'register_converter', (['converters.ResourceConverter', '"""res"""'], {}), "(converters.ResourceConverter, 'res')\n", (270, 307), False, 'from django.urls import path, register_converter\n'), ((308, 361), 'django.urls.register_converter', 'register_converter', (['converte...
code-knayam/DataStructureAlgorithms
code-wars/010.moving-zeros-to-the-end.py
8425911633d4d343c58798a123175289ed0df1fe
# Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements. def move_zeros(array): #your code here new_array = [] new_index = 0 while len(array) > 0: item = array.pop(0) if item == 0 and not type(item) == bool : ...
[]
jason-gm/python_sepa
sepa_generator/definitions.py
542c48326c07ab68d341a07d5ee12502f7248690
def construct_tag_data(tag_name, attrs=None, value=None, sorting=None): data = { '_name': tag_name, '_attrs': attrs or [], '_value': value, } if sorting: data['_sorting'] = sorting return data def add_simple_child(data, child_friendly_name, child_tag_name, child_attr...
[]
miezebieze/scott-launcher
__main__.py
a03597d0883af075128d1ea4ea53e7b5132807b1
from enum import Enum from window import Window D = Enum ('Directions','N NE E SE S SW W NW') selector_map = { D.NW: [0.5,0.5], D.N: [1.5,0], D.NE: [2.5,0.5], D.W: [0,1.5], D.E: [3,1.5], D.SW: [0.5,2.5], D.S: [1.5,3], D.SE: [2.5,2.5], } selector_size = 100 window_si...
[((53, 94), 'enum.Enum', 'Enum', (['"""Directions"""', '"""N NE E SE S SW W NW"""'], {}), "('Directions', 'N NE E SE S SW W NW')\n", (57, 94), False, 'from enum import Enum\n'), ((351, 427), 'window.Window', 'Window', (['window_size', 'window_size', 'selector_map', 'selector_size', 'selector_size'], {}), '(window_size,...
monteals/C-Ride
cride/circles/serializers.py
6e9368011f49ff619d1edaeaf1e8232685cc2095
from rest_framework import serializers from rest_framework.validators import UniqueValidator from cride.circles.models import Circle class CircleSerializer(serializers.Serializer): name = serializers.CharField() slug_name = serializers.SlugField() rides_taken = serializers.IntegerField() rides_offered ...
[((193, 216), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {}), '()\n', (214, 216), False, 'from rest_framework import serializers\n'), ((233, 256), 'rest_framework.serializers.SlugField', 'serializers.SlugField', ([], {}), '()\n', (254, 256), False, 'from rest_framework import serializers\n'),...
Dimstella/blockchain-contact-tracing-app-hospitals
contact/views.py
e0b2bf2b3b8c06e58032faed99900d1c7b7d300d
from django.shortcuts import render from django.template import loader from django.http import HttpResponse from django.shortcuts import render, redirect from .models import Patient from django.contrib import messages import pandas as pd from django.contrib.auth.decorators import login_required from web3 import...
[((519, 535), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {}), '()\n', (533, 535), False, 'from django.contrib.auth.decorators import login_required\n'), ((693, 709), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {}), '()\n', (707, 709), False, 'from django.contrib....
brandon-rhodes/pycon2010-mighty-dictionary
figures/collide1a.py
1f75fdd42cd243c9f86a87f7b48f6b3498d032e8
import _dictdraw, sys d = {} surface = _dictdraw.draw_dictionary(d, [4]) surface.write_to_png(sys.argv[1])
[((40, 73), '_dictdraw.draw_dictionary', '_dictdraw.draw_dictionary', (['d', '[4]'], {}), '(d, [4])\n', (65, 73), False, 'import _dictdraw, sys\n')]
SeveNNoff/InstagramReportBot
ReportBot.py
0a613b5f2733d988a952d64d8141cb7390527b9e
# coding=utf-8 #!/usr/bin/env python3 from libs.check_modules import check_modules from sys import exit from os import _exit check_modules() from os import path from libs.logo import print_logo from libs.utils import print_success from libs.utils import print_error from libs.utils import ask_question ...
[((134, 149), 'libs.check_modules.check_modules', 'check_modules', ([], {}), '()\n', (147, 149), False, 'from libs.check_modules import check_modules\n'), ((1323, 1385), 'libs.utils.ask_question', 'ask_question', (['"""Enter the link of the video you want to report"""'], {}), "('Enter the link of the video you want to ...
viathor/OpenFermion-Cirq
openfermioncirq/variational/ansatzes/default_initial_params_test.py
b4b7f8d82c40f0a6282873b5d2867e9d8778cea6
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distribu...
[((1096, 1169), 'openfermion.random_diagonal_coulomb_hamiltonian', 'openfermion.random_diagonal_coulomb_hamiltonian', (['(4)'], {'real': '(True)', 'seed': '(47141)'}), '(4, real=True, seed=47141)\n', (1143, 1169), False, 'import openfermion\n'), ((2856, 2889), 'openfermioncirq.HamiltonianObjective', 'HamiltonianObjecti...
seryj/spyder
spyder/plugins/variableexplorer/widgets/arrayeditor.py
acea4f501c1a04d57b02e5e817708a69b503f430
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ NumPy Array Editor Dialog based on Qt """ # pylint: disable=C0103 # pylint: disable=R0903 # pylint: disable=R0911 # pylint: disable=R0201 # Stand...
[((20131, 20137), 'qtpy.QtCore.Slot', 'Slot', ([], {}), '()\n', (20135, 20137), False, 'from qtpy.QtCore import QAbstractTableModel, QItemSelection, QLocale, QItemSelectionRange, QModelIndex, Qt, Slot\n'), ((30224, 30254), 'qtpy.QtCore.Slot', 'Slot', (['QModelIndex', 'QModelIndex'], {}), '(QModelIndex, QModelIndex)\n',...
dddpaul/beats
libbeat/tests/system/idxmgmt.py
0d4a830fea46210ee264c52a977834d39493c750
import datetime import unittest import pytest from elasticsearch import NotFoundError class IdxMgmt(unittest.TestCase): def __init__(self, client, index): self._client = client self._index = index if index != '' and index != '*' else 'mockbeat' def needs_init(self, s): return s == ''...
[((1743, 1771), 'pytest.raises', 'pytest.raises', (['NotFoundError'], {}), '(NotFoundError)\n', (1756, 1771), False, 'import pytest\n'), ((3380, 3408), 'pytest.raises', 'pytest.raises', (['NotFoundError'], {}), '(NotFoundError)\n', (3393, 3408), False, 'import pytest\n'), ((4398, 4421), 'datetime.datetime.now', 'dateti...
atsgen/tf-test
scripts/policy/sdn_single_vm_multiple_policy_topology.py
2748fcd81491450c75dadc71849d2a1c11061029
'''*******AUTO-GENERATED TOPOLOGY*********''' from __future__ import print_function from builtins import range from builtins import object from tcutils.util import get_random_name,get_random_cidr class sdn_single_vm_multiple_policy_config(object): def __init__(self, domain='default-domain', project='admin', user...
[((9620, 9656), 'topo_helper.topology_helper', 'topo_helper.topology_helper', (['my_topo'], {}), '(my_topo)\n', (9647, 9656), False, 'import topo_helper\n'), ((1104, 1113), 'builtins.range', 'range', (['(10)'], {}), '(10)\n', (1109, 1113), False, 'from builtins import range\n'), ((661, 685), 'tcutils.util.get_random_na...
burnpanck/chaco
chaco/polygon_plot.py
6457cdd28625991ba69fbbee105051cab237aa51
""" Defines the PolygonPlot class. """ from __future__ import with_statement # Major library imports import numpy as np # Enthought library imports. from enable.api import LineStyle, black_color_trait, \ transparent_color_trait from kiva.agg import points_in_polygon from traits.api ...
[((1659, 1669), 'traits.api.Float', 'Float', (['(1.0)'], {}), '(1.0)\n', (1664, 1669), False, 'from traits.api import Enum, Float, Tuple, Property, cached_property, on_trait_change\n'), ((1923, 1952), 'traits.api.Enum', 'Enum', (['"""poly"""', '"""point"""', '"""line"""'], {}), "('poly', 'point', 'line')\n", (1927, 195...
evgenyss/investing
webapp/template_config.py
b72da8587a4783bfdd389f1781dcd108d1a5e53f
import os from datetime import timedelta basedir = os.path.abspath(os.path.dirname(__file__)) API_DATA_URL = "https://invest-public-api.tinkoff.ru/rest/tinkoff.public.invest.api.contract.v1.InstrumentsService/" API_LASTPRICES_URL = "https://invest-public-api.tinkoff.ru/rest/\ tinkoff.public.invest.api.contract.v1.Mar...
[((461, 478), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (470, 478), False, 'from datetime import timedelta\n'), ((68, 93), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (83, 93), False, 'import os\n'), ((392, 432), 'os.path.join', 'os.path.join', (['basedir', '"...
dytk2134/humann2
humann2/quantify/families.py
9b8f212bdd910ee7187f06f1550f0c86bce0473b
""" HUMAnN2: quantify_families module Compute alignments by gene family Copyright (c) 2014 Harvard School of Public Health 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, inc...
[((1298, 1325), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1315, 1325), False, 'import logging\n')]
RazvanBalau/parallel-2020
Buta Nicolae/threads.py
bd9c0dea6cc70e167320f64632d7a235522dfdb3
import threading from multiprocessing import Queue results = [] results2 = [] def take_numbers(q): print('Enter the numbers:') for i in range(0,3): num1 = int(input('Enter first number: ')) num2 = int(input('Enter second number: ')) q.put(num1) q.put(num2) def add_num(q): ...
[((464, 471), 'multiprocessing.Queue', 'Queue', ([], {}), '()\n', (469, 471), False, 'from multiprocessing import Queue\n'), ((477, 520), 'threading.Thread', 'threading.Thread', ([], {'target': 'add_num', 'args': '(q,)'}), '(target=add_num, args=(q,))\n', (493, 520), False, 'import threading\n'), ((527, 575), 'threadin...
dylanlee101/leetcode
code_week11_76_712/unique_paths.py
b059afdadb83d504e62afd1227107de0b59557af
''' 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。 问总共有多少条不同的路径? 例如,上图是一个7 x 3 的网格。有多少可能的路径?   示例 1: 输入: m = 3, n = 2 输出: 3 解释: 从左上角开始,总共有 3 条路径可以到达右下角。 1. 向右 -> 向右 -> 向下 2. 向右 -> 向下 -> 向右 3. 向下 -> 向右 -> 向右 示例 2: 输入: m = 7, n = 3 输出: 28 来源:力扣(LeetCode) 链接:https:...
[]
JonaBecher/spektral
spektral/datasets/qm9.py
ff59e16d959e0ec698428997363be20462625699
import os import os.path as osp import numpy as np from joblib import Parallel, delayed from tensorflow.keras.utils import get_file from tqdm import tqdm from spektral.data import Dataset, Graph from spektral.utils import label_to_one_hot, sparse from spektral.utils.io import load_csv, load_sdf ATOM_TYPES = [1, 6, 7...
[((2701, 2749), 'spektral.utils.label_to_one_hot', 'label_to_one_hot', (["atom['atomic_num']", 'ATOM_TYPES'], {}), "(atom['atomic_num'], ATOM_TYPES)\n", (2717, 2749), False, 'from spektral.utils import label_to_one_hot, sparse\n'), ((2840, 2895), 'numpy.concatenate', 'np.concatenate', (['(atomic_num, coords, [charge, i...
tscofield/cpx-training
code/Level 1 - Intro to CPX/5-acceleration/main.py
682a2cef6bb164bc7c374744de94c21581258392
from adafruit_circuitplayground.express import cpx # Main loop gets x, y and z axis acceleration, prints the values, and turns on # red, green and blue, at levels related to the x, y and z values. while True: if cpx.switch: print("Slide switch off!") cpx.pixels.fill((0, 0, 0)) continue ...
[((272, 298), 'adafruit_circuitplayground.express.cpx.pixels.fill', 'cpx.pixels.fill', (['(0, 0, 0)'], {}), '((0, 0, 0))\n', (287, 298), False, 'from adafruit_circuitplayground.express import cpx\n'), ((574, 600), 'adafruit_circuitplayground.express.cpx.pixels.fill', 'cpx.pixels.fill', (['(R, G, B)'], {}), '((R, G, B))...
QinganZhao/ML-based-driving-motion-prediction
src/data_preprocess.py
5a7772cf199d30e4e33bbe943775c2e19aac5d5b
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.patches as patches def load_data(file_name, car_flag): if car_flag == 1: data = np.loadtxt('./car1/'+str(file_name)) elif car_flag == 2: data = np.loadtxt('./car2/'+str(file_name)) return data def get...
[((7584, 7615), 'numpy.loadtxt', 'np.loadtxt', (['"""./data_matrix.txt"""'], {}), "('./data_matrix.txt')\n", (7594, 7615), True, 'import numpy as np\n'), ((436, 464), 'numpy.zeros', 'np.zeros', (['(1, data.shape[1])'], {}), '((1, data.shape[1]))\n', (444, 464), True, 'import numpy as np\n'), ((1272, 1289), 'numpy.zeros...
tylertjburns/ledgerkeeper
balancesheet/equityManager.py
cd69e9f48f35a973d08e450dfffdfea46bdc3802
import balancesheet.mongoData.equities_data_service as dsvce from userInteraction.financeCliInteraction import FinanceCliInteraction import ledgerkeeper.mongoData.account_data_service as dsvca from balancesheet.enums import EquityClass, AssetType, LiabiltyType, EquityTimeHorizon, EquityStatus, EquityContingency import ...
[((2670, 2704), 'ledgerkeeper.mongoData.account_data_service.account_by_name', 'dsvca.account_by_name', (['accountName'], {}), '(accountName)\n', (2691, 2704), True, 'import ledgerkeeper.mongoData.account_data_service as dsvca\n'), ((2921, 2977), 'balancesheet.mongoData.equities_data_service.record_value_on_equity', 'd...
agustinhenze/mibs.snmplabs.com
pysnmp-with-texts/CISCO-DOT11-QOS-MIB.py
1fc5c07860542b89212f4c8ab807057d9a9206c7
# # PySNMP MIB module CISCO-DOT11-QOS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-DOT11-QOS-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:55:50 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
[]
liuyu81/SnapSearch-Client-Python
examples/django/hello_world/wsgi.py
41857806c2b26f0537de2dcc23a145107a4ecd04
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hello_world.settings") # django WSGI application from django.core.wsgi import get_wsgi_application application = get_wsgi_application() # load SnapSearch API credentials api_email = "<email>" api_key = "<key>" # initialize the interceptor from SnapSearch im...
[((11, 82), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""hello_world.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'hello_world.settings')\n", (32, 82), False, 'import os\n'), ((174, 196), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', ([], {}), '()\n', (19...
xcat2/confluent
confluent_server/confluent/syncfiles.py
47a83f4628df48638c2aebbfbcddc1531aac20d0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2021 Lenovo # # 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 ...
[((8126, 8152), 'os.path.join', 'os.path.join', (['targdir', 'dst'], {}), '(targdir, dst)\n', (8138, 8152), False, 'import os\n'), ((8296, 8317), 'os.path.isdir', 'os.path.isdir', (['source'], {}), '(source)\n', (8309, 8317), False, 'import os\n'), ((10220, 10277), 'eventlet.spawn', 'eventlet.spawn', (['sync_list_to_no...
JungYT/fym
fym/models/missile.py
d519c50086e3c7793b960e0326c92ed407836790
import numpy as np from fym.core import BaseSystem class MissilePlanar(BaseSystem): R = 288 g = 9.80665 S = 1 t1 = 1.5 t2 = 8.5 name = 'missile' def __init__(self, initial_state): super().__init__(initial_state) def external(self, states, controls): return 0 ...
[((1764, 1803), 'numpy.vstack', 'np.vstack', (['[dxdt, dydt, dVdt, dgammadt]'], {}), '([dxdt, dydt, dVdt, dgammadt])\n', (1773, 1803), True, 'import numpy as np\n'), ((1607, 1620), 'numpy.cos', 'np.cos', (['gamma'], {}), '(gamma)\n', (1613, 1620), True, 'import numpy as np\n'), ((1638, 1651), 'numpy.sin', 'np.sin', (['...
chengemily/EGG
egg/zoo/addition/data.py
40e84228e9d6e9ae785c0e4a846bb7e12e2b9291
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Iterable, Optional, Tuple import torch from torch.utils.data import DataLoader class ScaledDataset: def __init__(self,...
[((1358, 1421), 'torch.utils.data.DataLoader', 'DataLoader', (['train_set'], {'batch_size': 'opts.batch_size', 'shuffle': '(True)'}), '(train_set, batch_size=opts.batch_size, shuffle=True)\n', (1368, 1421), False, 'from torch.utils.data import DataLoader\n'), ((1577, 1628), 'torch.utils.data.DataLoader', 'DataLoader', ...
lsbardel/mathfun
mathfun/lexographic.py
98e7c210409c2b5777e91059c3651cef4f3045dd
""" Next lexicographical permutation algorithm https://www.nayuki.io/page/next-lexicographical-permutation-algorithm """ def next_lexo(S): b = S[-1] for i, a in enumerate(reversed(S[:-1]), 2): if a < b: # we have the pivot a for j, b in enumerate(reversed(S), 1): ...
[]
miker83z/cloud-chain
simulation-web3py/utility.py
0f5c43159544da547173ee0425e78bede261513b
import json import os from argparse import ArgumentTypeError from eth_typing import Address from web3.contract import Contract from settings import MIN_VAL, MAX_VAL, DEPLOYED_CONTRACTS, CONFIG_DIR async def init_simulation(contracts: [], factor: float, fn: str, status_init: bool) -> bool: statuses = [True] ...
[((2789, 2800), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2798, 2800), False, 'import os\n'), ((2125, 2140), 'json.load', 'json.load', (['file'], {}), '(file)\n', (2134, 2140), False, 'import json\n'), ((2560, 2580), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (2574, 2580), False, 'import os\n'),...
OpenASL/HowSignBot
migrations/versions/816ea3631582_add_topics.py
bd9c5bc0edfd6fb50bdce7c7c1d84462e1e704c2
"""add topics Revision ID: 816ea3631582 Revises: 37a124b0099b Create Date: 2021-03-13 14:20:10.044131 """ from alembic import op import sqlalchemy as sa import bot # revision identifiers, used by Alembic. revision = "816ea3631582" down_revision = "37a124b0099b" branch_labels = None depends_on = None def upgrade()...
[((749, 772), 'alembic.op.drop_table', 'op.drop_table', (['"""topics"""'], {}), "('topics')\n", (762, 772), False, 'from alembic import op\n'), ((583, 617), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""content"""'], {}), "('content')\n", (606, 617), True, 'import sqlalchemy as sa\n'), ((456, 465)...
NUS-ALSET/ace-react-redux-brython
src/Lib/importlib/__init__.py
d009490263c5716a145d9691cd59bfcd5aff837a
"""A pure Python implementation of import.""" __all__ = ['__import__', 'import_module', 'invalidate_caches'] # Bootstrap help ##################################################### # Until bootstrapping is complete, DO NOT import any modules that attempt # to import importlib._bootstrap (directly or indirectly)....
[]
swyddfa/stylo
lib/arlunio/arlunio/image.py
4d6b348ce5812dc5c2554bfd21a1550375aa05e1
from __future__ import annotations import base64 import io import logging import pathlib from typing import Optional # TODO: Remove these, as they should be contained in the numpy backend. import numpy as np import PIL.Image as PImage import arlunio.ast as ast import arlunio.color as color import arlunio.mask as mas...
[((360, 387), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (377, 387), False, 'import logging\n'), ((2591, 2634), 'arlunio.ast.Node.builtin', 'ast.Node.builtin', ([], {'name': '"""image"""', 'color': 'color'}), "(name='image', color=color)\n", (2607, 2634), True, 'import arlunio.ast as ...
smarie/python-yamlable
yamlable/tests/test_yamlable.py
c726f5c56eea037968560ce83f9753bde1514991
from copy import copy try: # Python 2 only: from StringIO import StringIO # create a variant that can serve as a context manager class StringIO(StringIO): def __enter__(self): return self def __exit__(self, exception_type, exception_value, traceback): self.close(...
[((1534, 1569), 'yamlable.yaml_info', 'yaml_info', ([], {'yaml_tag_ns': '"""yaml.tests"""'}), "(yaml_tag_ns='yaml.tests')\n", (1543, 1569), False, 'from yamlable import YamlAble, yaml_info\n'), ((3261, 3296), 'yamlable.yaml_info', 'yaml_info', ([], {'yaml_tag_ns': '"""yaml.tests"""'}), "(yaml_tag_ns='yaml.tests')\n", (...
vmario/twisted
src/twisted/web/server.py
34f3d8f8c6f51772eaed92a89257ea011e9a818d
# -*- test-case-name: twisted.web.test.test_web -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This is a web server which integrates with the twisted.internet infrastructure. @var NOT_DONE_YET: A token value which L{twisted.web.resource.IResource.render} implementations can return...
[((2482, 2508), 'zope.interface.implementer', 'implementer', (['iweb.IRequest'], {}), '(iweb.IRequest)\n', (2493, 2508), False, 'from zope.interface import implementer\n'), ((20318, 20359), 'zope.interface.implementer', 'implementer', (['iweb._IRequestEncoderFactory'], {}), '(iweb._IRequestEncoderFactory)\n', (20329, 2...
jaschadub/pycoin
pycoin/symbols/doge.py
1e8d0d9fe20ce0347b97847bb529cd1bd84c7442
from pycoin.networks.bitcoinish import create_bitcoinish_network network = create_bitcoinish_network( symbol="DOGE", network_name="Dogecoin", subnet_name="mainnet", wif_prefix_hex="9e", address_prefix_hex="1e", pay_to_script_prefix_hex="16", bip32_prv_prefix_hex="02fd3955", bip32_pub_prefix_hex="02fd3929")...
[((76, 319), 'pycoin.networks.bitcoinish.create_bitcoinish_network', 'create_bitcoinish_network', ([], {'symbol': '"""DOGE"""', 'network_name': '"""Dogecoin"""', 'subnet_name': '"""mainnet"""', 'wif_prefix_hex': '"""9e"""', 'address_prefix_hex': '"""1e"""', 'pay_to_script_prefix_hex': '"""16"""', 'bip32_prv_prefix_hex'...
MarkHershey/python-learning
Pset/hamming_numbers.py
8d6c87941af6db5878b59483526ed402f4b319b3
def hamming(n): """Returns the nth hamming number""" hamming = {1} x = 1 while len(hamming) <= n * 3.5: new_hamming = {1} for i in hamming: new_hamming.add(i * 2) new_hamming.add(i * 3) new_hamming.add(i * 5) # merge new number into hamming set...
[]
needlehaystack/needlestack
examples/run_merger.py
e00529a2a7c2d85059936a85f54dfb55e515b6ef
import logging from grpc_health.v1 import health_pb2, health_pb2_grpc from grpc_health.v1.health import HealthServicer from needlestack.apis import servicers_pb2_grpc from needlestack.servicers import factory from needlestack.servicers.merger import MergerServicer from examples import configs logging.getLogger("kaz...
[((369, 396), 'examples.configs.LocalDockerConfig', 'configs.LocalDockerConfig', ([], {}), '()\n', (394, 396), False, 'from examples import configs\n'), ((411, 440), 'needlestack.servicers.factory.create_server', 'factory.create_server', (['config'], {}), '(config)\n', (432, 440), False, 'from needlestack.servicers imp...
lidevelopers/Lishogi-Bot-1
engine_wrapper.py
5e669870930fe497e323324f36ccdbf5b04d26d3
import os import shogi import backoff import subprocess from util import * import logging logger = logging.getLogger(__name__) import engine_ctrl @backoff.on_exception(backoff.expo, BaseException, max_time=120) def create_engine(config, board): cfg = config["engine"] engine_path = os.path.realpath(os.path.j...
[((100, 127), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (117, 127), False, 'import logging\n'), ((151, 214), 'backoff.on_exception', 'backoff.on_exception', (['backoff.expo', 'BaseException'], {'max_time': '(120)'}), '(backoff.expo, BaseException, max_time=120)\n', (171, 214), False,...
sloriot/cgal-swig-bindings
examples/python/test_as2.py
c9c5afdf64fa0c52f9c3785173159167ab2b3163
from CGAL.CGAL_Kernel import Point_2 from CGAL.CGAL_Kernel import Weighted_point_2 from CGAL.CGAL_Alpha_shape_2 import Alpha_shape_2 from CGAL.CGAL_Alpha_shape_2 import Weighted_alpha_shape_2 from CGAL.CGAL_Alpha_shape_2 import Weighted_alpha_shape_2_Face_handle from CGAL.CGAL_Alpha_shape_2 import GENERAL, EXTERIOR, SI...
[((702, 732), 'CGAL.CGAL_Alpha_shape_2.Alpha_shape_2', 'Alpha_shape_2', (['lst', '(0)', 'GENERAL'], {}), '(lst, 0, GENERAL)\n', (715, 732), False, 'from CGAL.CGAL_Alpha_shape_2 import Alpha_shape_2\n'), ((738, 759), 'CGAL.CGAL_Alpha_shape_2.Alpha_shape_2', 'Alpha_shape_2', (['lst', '(0)'], {}), '(lst, 0)\n', (751, 759)...
pavithra-mahamani/TAF
connections/mode.py
ff854adcc6ca3e50d9dc64e7756ca690251128d3
''' Created on Jan 18, 2018 @author: riteshagarwal ''' java = False rest = False cli = False
[]
encela95dus/ios_pythonista_examples
scene_action2.py
e136cdcb05126f0f9b9f6fb6365870876b419619
import scene class MyScene(scene.Scene): def setup(self): self.label_node = scene.LabelNode('A', position=(100,400), parent=self) self.start_flag = False def update(self): if self.start_flag: x,y = self.label_node.position if x < 34...
[((91, 145), 'scene.LabelNode', 'scene.LabelNode', (['"""A"""'], {'position': '(100, 400)', 'parent': 'self'}), "('A', position=(100, 400), parent=self)\n", (106, 145), False, 'import scene\n')]
aq1/vkPostman
bot/commands/disconnect.py
db6b8d387d484ff53d12dcaf77ba3dcaa6da3822
from bot.commands import BaseCommand import mongo class DisconnectCommand(BaseCommand): _COMMAND = 'disconnect' _DESCRIPTION = 'Close currently active chat.' _SUCCESS_MESSAGE = 'Disconnected from chat' def _callback(self, user, _bot, update, **kwargs): return self._call(user, _bot, update, ...
[((397, 448), 'mongo.chats.get_active_chat_by_telegram_id', 'mongo.chats.get_active_chat_by_telegram_id', (['user.id'], {}), '(user.id)\n', (439, 448), False, 'import mongo\n'), ((478, 515), 'mongo.chats.disable_chat', 'mongo.chats.disable_chat', (["chat['_id']"], {}), "(chat['_id'])\n", (502, 515), False, 'import mong...
JordanKoeller/Pysch
pysh/bash_vm/shell_command.py
6775db00e6d551328ce49a50a5987223a9e9a9c3
from __future__ import annotations import subprocess import os from typing import List, Dict, Iterator, Optional, Tuple class ShellCommand: def __init__(self, cmd: str): self.run_args = [ "bash", "-c", f'{cmd}' ] # self.run_args: List[str] = [executable, *args] def exe...
[((390, 510), 'subprocess.run', 'subprocess.run', (['self.run_args'], {'stdout': 'subprocess.PIPE', 'env': '{**os.environ, **extra_environ if extra_environ else {}}'}), '(self.run_args, stdout=subprocess.PIPE, env={**os.environ, **\n extra_environ if extra_environ else {}})\n', (404, 510), False, 'import subprocess\...
jgrigera/indico
indico/web/forms/fields/protection.py
b5538f2755bc38a02313d079bac831ee3dfb44ab
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import absolute_import, unicode_literals from flask import render_template from markupsaf...
[((634, 697), 'indico.web.forms.widgets.JinjaWidget', 'JinjaWidget', (['"""forms/protection_widget.html"""'], {'single_kwargs': '(True)'}), "('forms/protection_widget.html', single_kwargs=True)\n", (645, 697), False, 'from indico.web.forms.widgets import JinjaWidget\n'), ((717, 813), 'indico.web.forms.widgets.JinjaWidg...
masterapps-au/pysaml2
src/saml2/saml.py
97ad6c066c93cb31a3c3b9d504877c02e93ca9a9
#!/usr/bin/env python # # Generated Mon May 2 14:23:33 2011 by parse_xsd.py version 0.4. # # A summary of available specifications can be found at: # https://wiki.oasis-open.org/security/FrontPage # # saml core specifications to be found at: # if any question arise please query the following pdf. # http://docs.oasis-...
[((14076, 14102), 'saml2.SamlBase.c_children.copy', 'SamlBase.c_children.copy', ([], {}), '()\n', (14100, 14102), False, 'from saml2 import SamlBase\n'), ((14122, 14150), 'saml2.SamlBase.c_attributes.copy', 'SamlBase.c_attributes.copy', ([], {}), '()\n', (14148, 14150), False, 'from saml2 import SamlBase\n'), ((14217, ...
PierreExeter/custom_gym_envs
ROS_packages/custom_ROS_envs/turtlebot2_maze_env/src/turtlebot2_maze_random.py
2b6a1c16a4198c8d9fa64f10fe09a041826ac81a
#!/usr/bin/env python import gym import rospy from openai_ros.openai_ros_common import StartOpenAI_ROS_Environment # initialise environment rospy.init_node('turtlebot2_maze_random', anonymous=True, log_level=rospy.WARN) task_and_robot_environment_name = rospy.get_param('/turtlebot2/task_and_robot_environment_name') e...
[((142, 221), 'rospy.init_node', 'rospy.init_node', (['"""turtlebot2_maze_random"""'], {'anonymous': '(True)', 'log_level': 'rospy.WARN'}), "('turtlebot2_maze_random', anonymous=True, log_level=rospy.WARN)\n", (157, 221), False, 'import rospy\n'), ((256, 318), 'rospy.get_param', 'rospy.get_param', (['"""/turtlebot2/tas...
jacobchh/Sudoku-Solver
solver.py
946a954e8eda234760872c55fcd2354dc0a8a4f9
import numpy as np board = np.zeros(shape=(9, 9)) count = 0 def solve(): global count count += 1 if count % 1000 == 0: print('\rCurrent number of computations made:', count, end='') freePos = find() if freePos is None: return True i = freePos[0] j = freePos[1] for w in...
[((28, 50), 'numpy.zeros', 'np.zeros', ([], {'shape': '(9, 9)'}), '(shape=(9, 9))\n', (36, 50), True, 'import numpy as np\n')]
johny-c/theano_exercises
01_basics/01_building_expressions/02_vector_mat_soln.py
7fd43315bf7c475a6f218091316c0bd34e0688c4
import numpy as np from theano import function import theano.tensor as T def make_vector(): """ Returns a new Theano vector. """ return T.vector() def make_matrix(): """ Returns a new Theano matrix. """ return T.matrix() def elemwise_mul(a, b): """ a: A theano matrix b: ...
[]
bopopescu/nova-8
nova/api/openstack/compute/used_limits.py
768d7cc0a632e1a880f00c5840c1ec8051e161be
# Copyright 2012 OpenStack Foundation # # 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 ...
[((1173, 1203), 'nova.api.openstack.extensions.expected_errors', 'extensions.expected_errors', (['()'], {}), '(())\n', (1199, 1203), False, 'from nova.api.openstack import extensions\n'), ((1426, 1519), 'nova.api.openstack.api_version_request.is_supported', 'api_version_request.is_supported', (['req'], {'min_version': ...
howards11/agents
tf_agents/bandits/agents/examples/v2/trainer.py
8d5627d9b9c3680468a63564c25a4d82fa1befb0
# coding=utf-8 # Copyright 2020 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
[((1417, 1538), 'tf_agents.replay_buffers.tf_uniform_replay_buffer.TFUniformReplayBuffer', 'tf_uniform_replay_buffer.TFUniformReplayBuffer', ([], {'data_spec': 'data_spec', 'batch_size': 'batch_size', 'max_length': 'steps_per_loop'}), '(data_spec=data_spec,\n batch_size=batch_size, max_length=steps_per_loop)\n', (14...
RSE-Cambridge/rally-openstack
rally_openstack/cfg/manila.py
32bbc091bbce1db625a2fc22da28b32718befa13
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
[((687, 860), 'rally.common.cfg.FloatOpt', 'cfg.FloatOpt', (['"""manila_share_create_prepoll_delay"""'], {'default': '(2.0)', 'deprecated_group': '"""benchmark"""', 'help': '"""Delay between creating Manila share and polling for its status."""'}), "('manila_share_create_prepoll_delay', default=2.0,\n deprecated_grou...
matayoos/invoice-scrapper
app/backend/app/crud/crud_register_invoice.py
d36c944c10714e61d304693d0fce28769d2a746a
from sqlalchemy.orm.session import Session from app import crud from .utils import insert, get_content def register_invoice(db: Session, url: str): content = get_content.get_invoice_info(url) grocery_store_id = insert.insert_grocery_store_info( db, obj_in=content["grocery_store"] ) invoice_...
[((529, 570), 'app.crud.get_invoice_by_id', 'crud.get_invoice_by_id', (['db'], {'id': 'invoice_id'}), '(db, id=invoice_id)\n', (551, 570), False, 'from app import crud\n')]
nicoddemus/aioworkers
examples/web/handlers.py
4ab85064844dc28141833d1348989d8c891f3d7d
async def handler(context): return await context.data
[]
garronej/linphone
tools/genapixml.py
f61a337f5363b991d6e866a6aa7d303658c04073
#!/usr/bin/python # Copyright (C) 2014 Belledonne Communications SARL # # This program 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; either version 2 # of the License, or (at your option) any later version....
[((27754, 27839), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate XML version of the Linphone API."""'}), "(description='Generate XML version of the Linphone API.'\n )\n", (27777, 27839), False, 'import argparse\n'), ((6873, 6889), 'metadoc.Parser', 'metadoc.Parser', ([], {}),...
aaronstjohn/incubator-heron
examples/src/python/join_streamlet_topology.py
bdc35f8d23296472983956a477ea38da54d16b2b
#!/usr/bin/env python # -*- encoding: utf-8 -*- # 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...
[((1364, 1373), 'heronpy.streamlet.builder.Builder', 'Builder', ([], {}), '()\n', (1371, 1373), False, 'from heronpy.streamlet.builder import Builder\n'), ((1655, 1663), 'heronpy.streamlet.runner.Runner', 'Runner', ([], {}), '()\n', (1661, 1663), False, 'from heronpy.streamlet.runner import Runner\n'), ((1675, 1683), '...
yolkdata/yolk-python
yolk/test/utils.py
978d98cbe637c1309a1be766a40bb874e996c61d
from datetime import date, datetime, timedelta from decimal import Decimal import unittest from dateutil.tz import tzutc import six from yolk import utils class TestUtils(unittest.TestCase): def test_timezone_utils(self): now = datetime.now() utcnow = datetime.now(tz=tzutc()) self.asser...
[((245, 259), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (257, 259), False, 'from datetime import date, datetime, timedelta\n'), ((413, 438), 'yolk.utils.guess_timezone', 'utils.guess_timezone', (['now'], {}), '(now)\n', (433, 438), False, 'from yolk import utils\n'), ((517, 545), 'yolk.utils.guess_time...
kw1122/MKS66
09Scan/matrix.py
25986e79077692afbc085920af1fef276c22d967
""" A matrix will be an N sized list of 4 element lists. Each individual list will represent an [x, y, z, 1] point. For multiplication purposes, consider the lists like so: x0 x1 xn y0 y1 yn z0 z1 ... zn 1 1 1 """ import math def make_bezier(): return [ [-1, 3, -3, 1], ...
[((1101, 1116), 'math.cos', 'math.cos', (['theta'], {}), '(theta)\n', (1109, 1116), False, 'import math\n'), ((1164, 1179), 'math.sin', 'math.sin', (['theta'], {}), '(theta)\n', (1172, 1179), False, 'import math\n'), ((1195, 1210), 'math.cos', 'math.cos', (['theta'], {}), '(theta)\n', (1203, 1210), False, 'import math\...
Nekmo/spice
tests/test.py
717a2cc24ad969e1caec2aabeffc30a796c6ec91
from bs4 import BeautifulSoup import requests import sys, os from time import sleep sys.path.insert(0, '/home/may/Dropbox/Programming/spice/') import spice_api as spice def main(): creds = spice.load_auth_from_file('auth') print(creds) results = spice.search('Re:Zero Kara Hajimeru Isekai Seikatsu', spic...
[((86, 144), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/home/may/Dropbox/Programming/spice/"""'], {}), "(0, '/home/may/Dropbox/Programming/spice/')\n", (101, 144), False, 'import sys, os\n'), ((197, 230), 'spice_api.load_auth_from_file', 'spice.load_auth_from_file', (['"""auth"""'], {}), "('auth')\n", (222, 23...
prog-serhii/MyMoney_v2
backend/project/settings.py
8d2aa3ec0497c7afd1a25bb9266bfc405e9c9397
import os from pathlib import Path from datetime import timedelta from celery.schedules import crontab from django.utils.translation import gettext_lazy as _ # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = os.environ.get( 'SECRET_...
[((292, 387), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""'], {'default': '"""m8/o)3$n^03w)mxgvnrxb46__@6qnte9l0dkb7$6%lpbcox+v!"""'}), "('SECRET_KEY', default=\n 'm8/o)3$n^03w)mxgvnrxb46__@6qnte9l0dkb7$6%lpbcox+v!')\n", (306, 387), False, 'import os\n'), ((3704, 3736), 'os.path.join', 'os.path.join', (['...
jeanmarc2019/PTHacks2019-Planning
app/flaskApp/config.py
bc0c71588187fde8498494b3e74728c09de56f18
import configparser import os dir_path = os.path.dirname(os.path.realpath(__file__)) dir_path += '/cfg.ini' class Configuration(object): def __init__(self,debug=False): section = "Flask-debug" if debug else "Flask" cfg = configparser.ConfigParser() cfg.read(dir_path if debug e...
[((62, 88), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (78, 88), False, 'import os\n'), ((256, 283), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (281, 283), False, 'import configparser\n')]
cleo4zheng/neutron
neutron/db/models/l3ha.py
6d65318308edfd984bdd0ff1ac7fef9486a040f7
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
[((1579, 1611), 'sqlalchemy.orm.relationship', 'orm.relationship', (['models_v2.Port'], {}), '(models_v2.Port)\n', (1595, 1611), False, 'from sqlalchemy import orm\n'), ((1974, 2009), 'sqlalchemy.orm.relationship', 'orm.relationship', (['agent_model.Agent'], {}), '(agent_model.Agent)\n', (1990, 2009), False, 'from sqla...
anae09/electionWebService
authentication/migrate.py
756968e5cd6db1422ae5fe8445a9e92a25953073
from flask import Flask; from configuration import Configuration; from flask_migrate import Migrate, init, migrate, upgrade; from models import database, Role, UserRole, User; from sqlalchemy_utils import database_exists, create_database; application = Flask(__name__); application.config.from_object(Configuration); m...
[((254, 269), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (259, 269), False, 'from flask import Flask\n'), ((335, 365), 'flask_migrate.Migrate', 'Migrate', (['application', 'database'], {}), '(application, database)\n', (342, 365), False, 'from flask_migrate import Migrate, init, migrate, upgrade\n'), (...
gitter-lab/pria-ams-enamine
output/ensemble_analysis.py
b37bc7edf3c21af6653267ecd4bb9fd232eeb575
from __future__ import print_function import os import json import numpy as np def extract(file_path): if not os.path.isfile(file_path): return -1, -1, -1 with open(file_path, 'r') as f: lines = f.readlines() test_roc, test_precision, test_NEF = -1, -1, -1 for line ...
[((127, 152), 'os.path.isfile', 'os.path.isfile', (['file_path'], {}), '(file_path)\n', (141, 152), False, 'import os\n'), ((2821, 2843), 'numpy.mean', 'np.mean', (['test_roc_list'], {}), '(test_roc_list)\n', (2828, 2843), True, 'import numpy as np\n'), ((2898, 2926), 'numpy.mean', 'np.mean', (['test_precision_list'], ...