code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
"logging.getLogger",
"sawtooth_integration.tests.intkey_client.IntkeyClient",
"sawtooth_integration.tests.integration_tools.wait_for_rest_apis",
"time.time"
] | [((890, 917), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (907, 917), False, 'import logging\n'), ((1231, 1270), 'sawtooth_integration.tests.integration_tools.wait_for_rest_apis', 'wait_for_rest_apis', (['endpoints'], {'tries': '(10)'}), '(endpoints, tries=10)\n', (1249, 1270), False, ... |
#! /usr/bin/python3
from gg_sdk import GG, GGThunk
import sys
import math
VPXENC = 'vpxenc --ivf --codec=vp8 --good --cpu-used=0 --end-usage=cq --min-q=0 --max-q=63 --cq-level={quality} --buf-initial-sz=10000 --buf-optimal-sz=20000 --buf-sz=40000 --undershoot-pct=100 --passes=2 --auto-alt-ref=1 --threads=1 --token-pa... | [
"gg_sdk.GG",
"gg_sdk.GGThunk",
"math.ceil",
"sys.exit"
] | [((8465, 8469), 'gg_sdk.GG', 'GG', ([], {}), '()\n', (8467, 8469), False, 'from gg_sdk import GG, GGThunk\n'), ((1756, 1868), 'gg_sdk.GGThunk', 'GGThunk', ([], {'exe': 'vpxenc_split[0]', 'outname': "('%s-vpxenc.ivf' % name)", 'exe_args': 'vpxenc_split[1:]', 'args_infiles': '(False)'}), "(exe=vpxenc_split[0], outname='%... |
#
# 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... | [
"tests.test_utils.mock_executor.MockExecutor",
"mock.patch.dict",
"airflow.utils.dag_processing.SimpleDagBag",
"tests.test_utils.db.set_default_pool_slots",
"psutil.Process",
"airflow.models.taskinstance.TaskInstanceKey",
"airflow.utils.file.list_py_file_paths",
"airflow.jobs.scheduler_job.SchedulerJo... | [((2620, 2672), 'os.path.join', 'os.path.join', (['ROOT_FOLDER', '"""scripts"""', '"""perf"""', '"""dags"""'], {}), "(ROOT_FOLDER, 'scripts', 'perf', 'dags')\n", (2632, 2672), False, 'import os\n'), ((2692, 2740), 'os.path.join', 'os.path.join', (['PERF_DAGS_FOLDER', '"""elastic_dag.py"""'], {}), "(PERF_DAGS_FOLDER, 'e... |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Profile(models.Model):
profilePic = models.ImageField(upload_to='profile/',null=True,blank=True)
bio = models.CharField(max_length=60,blank=True)
user = models.ForeignKey(User,on_delete=models.CASCADE)... | [
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.models.PositiveIntegerField",
"django.db.models.ImageField",
"django.db.models.CharField"
] | [((147, 209), 'django.db.models.ImageField', 'models.ImageField', ([], {'upload_to': '"""profile/"""', 'null': '(True)', 'blank': '(True)'}), "(upload_to='profile/', null=True, blank=True)\n", (164, 209), False, 'from django.db import models\n'), ((218, 261), 'django.db.models.CharField', 'models.CharField', ([], {'max... |
from __future__ import absolute_import
from __future__ import unicode_literals
import json
import os
import uuid
import re
import logging
import yaml
from collections import OrderedDict, namedtuple
from copy import deepcopy
from io import open
from couchdbkit import ResourceNotFound
from couchdbkit.exceptions import... | [
"logging.getLogger",
"corehq.apps.app_manager.models.DetailColumn",
"re.compile",
"corehq.apps.builds.models.CommCareBuildConfig.fetch",
"io.open",
"corehq.apps.domain.models.Domain.get_by_name",
"copy.deepcopy",
"corehq.apps.domain.models.Domain.get",
"corehq.apps.app_manager.dbaccessors.get_apps_i... | [((1488, 1515), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1505, 1515), False, 'import logging\n'), ((5945, 5972), 're.compile', 're.compile', (['CASE_TYPE_REGEX'], {}), '(CASE_TYPE_REGEX)\n', (5955, 5972), False, 'import re\n'), ((16222, 16281), 'collections.namedtuple', 'namedtuple... |
import serial
import time
PORT = "/dev/ttyACM0"
MODE = "paste" # "paste" or "raw"
BLOCK_SIZE = 256
LENGTH_OF_STRING_LITERAL = 1000 # affects the size of the script sent to the device
NUM_ITERATIONS = 10000 # how many times to send the script to the device
# The output of following code tells me whether the code was ... | [
"serial.Serial",
"time.sleep",
"time.time"
] | [((1149, 1176), 'serial.Serial', 'serial.Serial', (['PORT', '(115200)'], {}), '(PORT, 115200)\n', (1162, 1176), False, 'import serial\n'), ((2880, 2891), 'time.time', 'time.time', ([], {}), '()\n', (2889, 2891), False, 'import time\n'), ((2056, 2072), 'time.sleep', 'time.sleep', (['(0.01)'], {}), '(0.01)\n', (2066, 207... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import torch as T
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from curious_agent.models import Model
class A2CModel(Model):
def __init__(self, env, config, name):
super(A2CModel, self).__init__(env=env, args=config, name=n... | [
"torch.nn.ReLU",
"torch.nn.LeakyReLU",
"torch.Tensor",
"torch.nn.Conv2d",
"torch.nn.Linear"
] | [((487, 553), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': '(4)', 'out_channels': '(32)', 'kernel_size': '(8)', 'stride': '(4)'}), '(in_channels=4, out_channels=32, kernel_size=8, stride=4)\n', (496, 553), True, 'import torch.nn as nn\n'), ((601, 610), 'torch.nn.ReLU', 'nn.ReLU', ([], {}), '()\n', (608, 610), T... |
"""
.. _quadtree_gridded-forecast-evaluation:
Quadtree Grid-based Forecast Evaluation
=======================================
This example demonstrates how to create a quadtree based single resolution-grid and multi-resolution grid.
Multi-resolution grid is created using earthquake catalog, in which seismic density ... | [
"csep.core.catalogs.CSEPCatalog.from_dataframe",
"pandas.read_csv",
"csep.core.regions.QuadtreeGrid2D.from_catalog",
"csep.utils.time_utils.decimal_year_to_utc_epoch",
"csep.core.forecasts.GriddedForecast",
"numpy.array",
"csep.core.regions.QuadtreeGrid2D.from_single_resolution",
"csep.core.poisson_ev... | [((2674, 2711), 'pandas.read_csv', 'pandas.read_csv', (['"""cat_train_2013.csv"""'], {}), "('cat_train_2013.csv')\n", (2689, 2711), False, 'import pandas\n'), ((3148, 3181), 'csep.core.catalogs.CSEPCatalog.from_dataframe', 'CSEPCatalog.from_dataframe', (['dfcat'], {}), '(dfcat)\n', (3174, 3181), False, 'from csep.core.... |
import unittest
import os
import json
pymongo_missing = False
try:
import pymongo
except:
pymongo_missing = True
import logging
from reporter_config.Config import Config, Parser
class RCMultipleActionsTest(unittest.TestCase):
def setUp(self):
"""
Example message created by a conv functi... | [
"os.path.exists",
"unittest.skipIf",
"reporter_config.Config.Config",
"os.path.dirname",
"json.load",
"pymongo.MongoClient",
"os.remove"
] | [((761, 856), 'unittest.skipIf', 'unittest.skipIf', (['pymongo_missing', '"""missing pymongo, skipping mongodb test with elseactions"""'], {}), "(pymongo_missing,\n 'missing pymongo, skipping mongodb test with elseactions')\n", (776, 856), False, 'import unittest\n'), ((481, 520), 'pymongo.MongoClient', 'pymongo.Mon... |
from sqlalchemy import text
from sqlalchemy.exc import SQLAlchemyError
from jet_bridge import fields
from jet_bridge.db import Session
from jet_bridge.exceptions.sql import SqlError
from jet_bridge.exceptions.validation_error import ValidationError
from jet_bridge.fields.sql_params import SqlParamsSerializers
from jet... | [
"jet_bridge.exceptions.sql.SqlError",
"sqlalchemy.text",
"jet_bridge.fields.sql_params.SqlParamsSerializers",
"jet_bridge.db.Session",
"jet_bridge.exceptions.validation_error.ValidationError",
"jet_bridge.fields.CharField"
] | [((416, 434), 'jet_bridge.fields.CharField', 'fields.CharField', ([], {}), '()\n', (432, 434), False, 'from jet_bridge import fields\n'), ((448, 484), 'jet_bridge.fields.sql_params.SqlParamsSerializers', 'SqlParamsSerializers', ([], {'required': '(False)'}), '(required=False)\n', (468, 484), False, 'from jet_bridge.fie... |
##########################################################################
#
# Copyright (c) 2012, <NAME>. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... | [
"GafferArnold.ArnoldRender",
"arnold.AiNodeGetMatrix",
"GafferArnold.ArnoldLight",
"GafferScene.Parent",
"GafferArnold.ArnoldOptions",
"Gaffer.Context",
"arnold.AiArrayGetType",
"GafferScene.SceneAlgo.deregisterRenderAdaptor",
"arnold.AiGetVersion",
"GafferArnold.ArnoldShader",
"imath.Box2f",
... | [((37710, 37763), 'GafferTest.TestRunner.PerformanceTestMethod', 'GafferTest.TestRunner.PerformanceTestMethod', ([], {'repeat': '(1)'}), '(repeat=1)\n', (37753, 37763), False, 'import GafferTest\n'), ((55647, 55662), 'unittest.main', 'unittest.main', ([], {}), '()\n', (55660, 55662), False, 'import unittest\n'), ((2315... |
"""
Subclasses the bokeh serve commandline handler to extend it in various
ways.
"""
import ast
import base64
import logging # isort:skip
import os
from glob import glob
from types import ModuleType
from bokeh.command.subcommands.serve import Serve as _BkServe
from bokeh.command.util import build_single_handler_appl... | [
"logging.getLogger",
"base64.urlsafe_b64decode",
"types.ModuleType",
"tornado.ioloop.IOLoop.current",
"tornado.ioloop.PeriodicCallback",
"ast.literal_eval",
"os.path.dirname",
"cryptography.fernet.Fernet",
"bokeh.application.handlers.document_lifecycle.DocumentLifecycleHandler",
"glob.glob",
"bo... | [((941, 968), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (958, 968), False, 'import logging\n'), ((2291, 2352), 'tornado.ioloop.PeriodicCallback', 'PeriodicCallback', (['self.cleanup_sessions', 'self._unused_timeout'], {}), '(self.cleanup_sessions, self._unused_timeout)\n', (2307, 235... |
import datetime
import json
DATE_FORMAT = "%Y-%m-%d"
def date_to_string(date):
return date.strftime(DATE_FORMAT)
def string_to_date(string):
return datetime.datetime.strptime(string, DATE_FORMAT)
def segment_month_date(start, end):
"""
start : YYYY-MM-DD
end : YYYY-MM-DD
"""
start_dat... | [
"datetime.datetime.strptime",
"json.dumps",
"datetime.date.today",
"datetime.date",
"datetime.datetime.today",
"datetime.timedelta"
] | [((161, 208), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['string', 'DATE_FORMAT'], {}), '(string, DATE_FORMAT)\n', (187, 208), False, 'import datetime\n'), ((4522, 4547), 'datetime.date', 'datetime.date', (['year', '(1)', '(1)'], {}), '(year, 1, 1)\n', (4535, 4547), False, 'import datetime\n'), ((485... |
# -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <<EMAIL>> (c) ... | [
"dateutil.easter.easter",
"dateutil.relativedelta.MO",
"datetime.date",
"dateutil.relativedelta.FR",
"holidays.holiday_base.HolidayBase.__init__"
] | [((991, 1027), 'holidays.holiday_base.HolidayBase.__init__', 'HolidayBase.__init__', (['self'], {}), '(self, **kwargs)\n', (1011, 1027), False, 'from holidays.holiday_base import HolidayBase\n'), ((1197, 1214), 'datetime.date', 'date', (['(1997)', '(6)', '(27)'], {}), '(1997, 6, 27)\n', (1201, 1214), False, 'from datet... |
from flask import Flask
from . import api, web
app = Flask(
__name__,
static_url_path='/assets',
static_folder='static',
template_folder='templates')
app.config['SECRET_KEY'] = 'secret' # this is fine if running locally
app.register_blueprint(api.bp)
app.register_blueprint(web.bp)
| [
"flask.Flask"
] | [((55, 154), 'flask.Flask', 'Flask', (['__name__'], {'static_url_path': '"""/assets"""', 'static_folder': '"""static"""', 'template_folder': '"""templates"""'}), "(__name__, static_url_path='/assets', static_folder='static',\n template_folder='templates')\n", (60, 154), False, 'from flask import Flask\n')] |
from pydataset import data
import time
import sys
sys.path.insert(1, '../')
import fastg3.ncrisp as g3ncrisp
df = data("diamonds").sample(n=100, random_state=27)
xparams = {
'carat':{
'type': 'numerical',
'predicate': 'absolute_distance',
'params': [0.05]
},
'cut':{
'type'... | [
"sys.path.insert",
"pydataset.data",
"fastg3.ncrisp.create_vpe_instance",
"fastg3.ncrisp.RSolver",
"time.time"
] | [((51, 76), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../"""'], {}), "(1, '../')\n", (66, 76), False, 'import sys\n'), ((807, 910), 'fastg3.ncrisp.create_vpe_instance', 'g3ncrisp.create_vpe_instance', (['df', 'xparams', 'yparams'], {'blocking': '(True)', 'join_type': '"""auto"""', 'verbose': '(False)'}), "(df,... |
# Copyright (c) 2019-2021 Vector 35 Inc
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, ... | [
"dataclasses.dataclass"
] | [((1374, 1408), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)', 'repr': '(False)'}), '(frozen=True, repr=False)\n', (1383, 1408), False, 'from dataclasses import dataclass\n'), ((2338, 2372), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)', 'repr': '(False)'}), '(frozen=True, repr=False)\... |
import codecs
import os
import tempfile
from xml.dom import minidom
from six import PY2
from junit_xml import to_xml_report_file, to_xml_report_string
def serialize_and_read(test_suites, to_file=False, prettyprint=False, encoding=None):
"""writes the test suite to an XML string and then re-reads it using minido... | [
"xml.dom.minidom.parse",
"os.close",
"junit_xml.to_xml_report_string",
"xml.dom.minidom.parseString",
"junit_xml.to_xml_report_file",
"codecs.open",
"tempfile.mkstemp",
"os.remove"
] | [((528, 555), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {'text': '(True)'}), '(text=True)\n', (544, 555), False, 'import tempfile\n'), ((564, 576), 'os.close', 'os.close', (['fd'], {}), '(fd)\n', (572, 576), False, 'import os\n'), ((816, 839), 'xml.dom.minidom.parse', 'minidom.parse', (['filename'], {}), '(filename)... |
from __future__ import absolute_import
import itertools
__all__ = ["Registry"]
class Registry(object):
"""The registry of access control list."""
def __init__(self):
self._roles = {}
self._resources = {}
self._allowed = {}
self._denied = {}
# to allow additional sh... | [
"itertools.product"
] | [((3205, 3252), 'itertools.product', 'itertools.product', (['roles', 'operations', 'resources'], {}), '(roles, operations, resources)\n', (3222, 3252), False, 'import itertools\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of "Linux Studio Installer" project
#
# Author: <NAME> <<EMAIL>>
# License: MIT License
#
# SPDX-License-Identifier: MIT
# License text is available in the LICENSE file and online:
# http://www.opensource.org/licenses/MIT
#
# Copyright (c) 2021... | [
"spawned.Spawned",
"spawned.Spawned.do",
"spawned.SpawnedSU.do_script",
"spawned.SpawnedSU.do"
] | [((673, 712), 'spawned.SpawnedSU.do', 'SpawnedSU.do', (['"""rm -rf /var/lib/partman"""'], {}), "('rm -rf /var/lib/partman')\n", (685, 712), False, 'from spawned import Spawned, SpawnedSU\n'), ((822, 1131), 'spawned.SpawnedSU.do_script', 'SpawnedSU.do_script', (['"""\n if [ ! -d /var/cache/debconf.back ]; the... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# This file is auto-generated by h2o-3/h2o-bindings/bin/gen_python.py
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.estimators.estimator_base ... | [
"h2o.frame.H2OFrame._validate",
"h2o.utils.typechecks.Enum",
"h2o.utils.typechecks.assert_is_type",
"h2o.exceptions.H2OValueError"
] | [((2421, 2473), 'h2o.frame.H2OFrame._validate', 'H2OFrame._validate', (['training_frame', '"""training_frame"""'], {}), "(training_frame, 'training_frame')\n", (2439, 2473), False, 'from h2o.frame import H2OFrame\n'), ((2818, 2866), 'h2o.utils.typechecks.assert_is_type', 'assert_is_type', (['score_each_iteration', 'Non... |
import json
import b2luigi
import root_pandas
import basf2_mva
from contre.training import SplitSample, Training
from contre.weights import get_weights
@b2luigi.inherits(Training)
class ValidationExpert(b2luigi.Task):
"""Apply BDT to test samples and save result as `validaion_expert.root`.
Parameters:
... | [
"json.dump",
"contre.weights.get_weights",
"b2luigi.inherits",
"b2luigi.Parameter",
"json.load",
"contre.training.Training.requires",
"basf2_mva.vector"
] | [((155, 181), 'b2luigi.inherits', 'b2luigi.inherits', (['Training'], {}), '(Training)\n', (171, 181), False, 'import b2luigi\n'), ((1028, 1062), 'b2luigi.inherits', 'b2luigi.inherits', (['ValidationExpert'], {}), '(ValidationExpert)\n', (1044, 1062), False, 'import b2luigi\n'), ((2517, 2536), 'b2luigi.Parameter', 'b2lu... |
#!/usr/bin/env python
# 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... | [
"sys.path.insert",
"yaml.safe_dump",
"argparse.ArgumentParser",
"oslo_utils.uuidutils.generate_uuid",
"cryptography.hazmat.primitives.serialization.NoEncryption",
"os.path.realpath",
"cryptography.hazmat.backends.default_backend",
"os.path.abspath",
"random.SystemRandom",
"os.path.expanduser"
] | [((1257, 1289), 'sys.path.insert', 'sys.path.insert', (['(0)', 'PROJECT_ROOT'], {}), '(0, PROJECT_ROOT)\n', (1272, 1289), False, 'import sys\n'), ((1892, 1917), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1915, 1917), False, 'import argparse\n'), ((2145, 2179), 'os.path.expanduser', 'os.pat... |
from sympy.core.numbers import (Float, pi)
from sympy.core.symbol import symbols
from sympy.functions.elementary.trigonometric import (cos, sin)
from sympy.matrices.immutable import ImmutableDenseMatrix as Matrix
from sympy.physics.vector import ReferenceFrame, Vector, dynamicsymbols, outer
from sympy.physics.vect... | [
"sympy.functions.elementary.trigonometric.cos",
"sympy.core.numbers.Float",
"sympy.core.symbol.symbols",
"sympy.physics.vector.dyadic._check_dyadic",
"sympy.matrices.immutable.ImmutableDenseMatrix",
"sympy.physics.vector.dynamicsymbols",
"sympy.physics.vector.outer",
"sympy.physics.vector.ReferenceFra... | [((419, 438), 'sympy.physics.vector.ReferenceFrame', 'ReferenceFrame', (['"""A"""'], {}), "('A')\n", (433, 438), False, 'from sympy.physics.vector import ReferenceFrame, Vector, dynamicsymbols, outer\n'), ((1122, 1141), 'sympy.physics.vector.dynamicsymbols', 'dynamicsymbols', (['"""q"""'], {}), "('q')\n", (1136, 1141),... |
from pp.component import Component
from pp.components.electrical.pad import pad
from pp.container import container
from pp.routing.connect_electrical import connect_electrical_shortest_path
@container
def add_electrical_pads_shortest(component, pad=pad, pad_port_spacing=50, **kwargs):
"""add a pad to each closest... | [
"pp.c.cross",
"pp.routing.connect_electrical.connect_electrical_shortest_path",
"pp.show",
"pp.c.mzi2x2",
"pp.component.Component",
"pp.components.electrical.pad.pad"
] | [((544, 576), 'pp.component.Component', 'Component', (['f"""{component.name}_e"""'], {}), "(f'{component.name}_e')\n", (553, 576), False, 'from pp.component import Component\n'), ((1656, 1713), 'pp.c.cross', 'pp.c.cross', ([], {'length': '(100)', 'layer': 'pp.LAYER.M3', 'port_type': '"""dc"""'}), "(length=100, layer=pp... |
# coding: utf-8
# uow/model.py
import datetime
from sqlalchemy import Column, Date, ForeignKey, Integer, MetaData, String, Table
from sqlalchemy.orm import mapper, relationship
from model import Line, Order
metadata = MetaData()
# child
line = Table(
"line",
metadata,
Column("id", Integer, primary_key... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.ForeignKey",
"sqlalchemy.MetaData",
"sqlalchemy.String",
"datetime.datetime.now",
"sqlalchemy.Column"
] | [((223, 233), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (231, 233), False, 'from sqlalchemy import Column, Date, ForeignKey, Integer, MetaData, String, Table\n'), ((287, 346), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), "('id', Integer, prim... |
import numpy as np
import tensorflow as tf
## TensorFlow helper functions
WEIGHT_DECAY_KEY = 'WEIGHT_DECAY'
def _relu(x, leakness=0.0, name=None):
if leakness > 0.0:
name = 'lrelu' if name is None else name
return tf.maximum(x, x*leakness, name='lrelu')
else:
name = 'relu' if name is ... | [
"numpy.sqrt",
"tensorflow.reduce_sum",
"tensorflow.nn.conv1d",
"tensorflow.nn.moments",
"tensorflow.get_variable_scope",
"tensorflow.zeros_initializer",
"tensorflow.slice",
"tensorflow.diag",
"numpy.max",
"tensorflow.concat",
"tensorflow.histogram_summary",
"tensorflow.matmul",
"tensorflow.m... | [((6993, 7009), 'tensorflow.add_n', 'tf.add_n', (['S_list'], {}), '(S_list)\n', (7001, 7009), True, 'import tensorflow as tf\n'), ((7014, 7053), 'tensorflow.add_to_collection', 'tf.add_to_collection', (['"""WEIGHT_SPLIT"""', 'S'], {}), "('WEIGHT_SPLIT', S)\n", (7034, 7053), True, 'import tensorflow as tf\n'), ((7157, 7... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Libpulsar(CMakePackage):
"""libpulsar is a C/C++ client library implementation o... | [
"os.path.join"
] | [((1995, 2059), 'os.path.join', 'os.path.join', (['self.stage.source_path', '"""pulsar-client-cpp/python"""'], {}), "(self.stage.source_path, 'pulsar-client-cpp/python')\n", (2007, 2059), False, 'import os\n'), ((2291, 2355), 'os.path.join', 'os.path.join', (['self.stage.source_path', '"""pulsar-client-cpp/python"""'],... |
# Electron ID [DEEP TRAINING] steering code
#
# <NAME>, 2020
# <EMAIL>
# icenet system paths
import _icepaths_
import uproot
import math
import numpy as np
import torch
import argparse
import pprint
import os
import datetime
import json
import pickle
import sys
import yaml
import copy
#import graphviz
import torch_g... | [
"iceid.common.read_config",
"icenet.deep.dopt.model_to_cuda",
"icenet.deep.graph.GINENet",
"icenet.tools.aux.pdf_2D_hist",
"numpy.linspace",
"uproot.open",
"icenet.deep.graph.DECNet",
"numpy.ceil",
"icenet.deep.graph.ECNet",
"icenet.deep.graph.SUPNet",
"icenet.deep.graph.SAGENet",
"icenet.deep... | [((967, 1135), 'iceid.graphio.parse_graph_data', 'graphio.parse_graph_data', ([], {'X': 'X[0:100]', 'Y': 'Y[0:100]', 'VARS': 'VARS', 'features': 'features', 'global_on': "args['graph_param']['global_on']", 'coord': "args['graph_param']['coord']"}), "(X=X[0:100], Y=Y[0:100], VARS=VARS, features=\n features, global_on... |
import os
from sys import exit
from .generator import UfwConfigGenerator
def main():
os.system("clear")
print(
"\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u2015\u... | [
"os.system",
"sys.exit"
] | [((97, 115), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (106, 115), False, 'import os\n'), ((1306, 1312), 'sys.exit', 'exit', ([], {}), '()\n', (1310, 1312), False, 'from sys import exit\n'), ((1525, 1531), 'sys.exit', 'exit', ([], {}), '()\n', (1529, 1531), False, 'from sys import exit\n'), ((2389... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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 require... | [
"ros2node.api.get_publisher_info",
"ros2node.api.get_subscriber_info",
"ros2cli.node.strategy.add_arguments",
"ros2node.api.get_service_info",
"ros2cli.node.strategy.NodeStrategy",
"ros2node.api.get_node_names",
"ros2cli.node.direct.DirectNode",
"ros2node.api.NodeNameCompleter"
] | [((1286, 1307), 'ros2cli.node.strategy.add_arguments', 'add_arguments', (['parser'], {}), '(parser)\n', (1299, 1307), False, 'from ros2cli.node.strategy import add_arguments\n'), ((1455, 1474), 'ros2node.api.NodeNameCompleter', 'NodeNameCompleter', ([], {}), '()\n', (1472, 1474), False, 'from ros2node.api import NodeNa... |
# 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 fairseq import utils
class FairseqIncrementalState(object):
def __init__(self, *args, **kwargs):
super().__init__(*args, **... | [
"fairseq.utils.INCREMENTAL_STATE_INSTANCE_ID.get"
] | [((829, 888), 'fairseq.utils.INCREMENTAL_STATE_INSTANCE_ID.get', 'utils.INCREMENTAL_STATE_INSTANCE_ID.get', (['obj.module_name', '(0)'], {}), '(obj.module_name, 0)\n', (868, 888), False, 'from fairseq import utils\n')] |
'''
Given a 2D array of black and white entries representing a maze with designated entry
and exit points, find a path from the entrance to the exit if once exists.
Notes:
* Use DFS
* what went right
* implemented DFS correctly including accounting visited nodes
* what went wrong
* initializing a 2D array usin... | [
"queue.Queue"
] | [((726, 733), 'queue.Queue', 'Queue', ([], {}), '()\n', (731, 733), False, 'from queue import Queue\n')] |
import numpy as np
def parse_res(res):
min = -1
avg = -1
if res != "":
if "," not in res:
min = int(res)
avg = int(res)
else:
all = np.array([int(r) for r in res.split(",")])
min = np.min(all)
avg = np.mean(all)
return min,avg
... | [
"numpy.mean",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.concatenate",
"numpy.min",
"numpy.transpose"
] | [((1822, 1844), 'numpy.array', 'np.array', (['final_result'], {}), '(final_result)\n', (1830, 1844), True, 'import numpy as np\n'), ((1997, 2015), 'numpy.sum', 'np.sum', (['np_topn', '(0)'], {}), '(np_topn, 0)\n', (2003, 2015), True, 'import numpy as np\n'), ((2155, 2188), 'numpy.concatenate', 'np.concatenate', (['(np_... |
# APPARENT MAG -> ABSOLUTE MAG WITH DISTANCE INFO.
#============================================================
import glob
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import ascii, fits
from astropy.table import Table, vstack
from astropy import units as u
def app2abs(m, mer, d, der):
M = m -... | [
"numpy.log",
"numpy.log10",
"astropy.io.ascii.read"
] | [((547, 569), 'astropy.io.ascii.read', 'ascii.read', (['path_table'], {}), '(path_table)\n', (557, 569), False, 'from astropy.io import ascii, fits\n'), ((717, 728), 'numpy.log10', 'np.log10', (['d'], {}), '(d)\n', (725, 728), True, 'import numpy as np\n'), ((324, 335), 'numpy.log10', 'np.log10', (['d'], {}), '(d)\n', ... |
# -*- coding: utf-8 -*-
# pip install pycryptodome
from datetime import datetime
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
from urllib.parse import quote_plus
from base64 import decodebytes, encodebytes
import json
class AliPay(object):
"""
支付宝支... | [
"base64.encodebytes",
"json.dumps",
"datetime.datetime.now",
"Crypto.Signature.PKCS1_v1_5.new",
"Crypto.Hash.SHA256.new",
"urllib.parse.quote_plus"
] | [((3655, 3674), 'Crypto.Signature.PKCS1_v1_5.new', 'PKCS1_v1_5.new', (['key'], {}), '(key)\n', (3669, 3674), False, 'from Crypto.Signature import PKCS1_v1_5\n'), ((3984, 4003), 'Crypto.Signature.PKCS1_v1_5.new', 'PKCS1_v1_5.new', (['key'], {}), '(key)\n', (3998, 4003), False, 'from Crypto.Signature import PKCS1_v1_5\n'... |
import random
import torch
import torch.optim as optim
from parlai.agents.dialog_evaluator.auto_evaluator import (
TorchGeneratorWithDialogEvalAgent,
CorpusSavedDictionaryAgent
)
from parlai.core.metrics import AverageMetric
from parlai.core.torch_agent import History
from parlai.core.torch_generator_agent im... | [
"parlai.core.metrics.AverageMetric.many",
"torch.LongTensor",
"torch.from_numpy",
"parlai.core.torch_generator_agent.Output",
"parlai.core.torch_generator_agent.PPLMetric.many",
"parlai.utils.misc.warn_once",
"parlai.utils.misc.round_sigfigs",
"random.random",
"torch.ones"
] | [((21332, 21365), 'torch.LongTensor', 'torch.LongTensor', (['([3] * batchsize)'], {}), '([3] * batchsize)\n', (21348, 21365), False, 'import torch\n'), ((24206, 24218), 'parlai.core.torch_generator_agent.Output', 'Output', (['text'], {}), '(text)\n', (24212, 24218), False, 'from parlai.core.torch_generator_agent import... |
import os
import pytest
from git import Repo
from dvc.scm import SCM, Git, NoSCM
from dvc.scm.base import SCMError
from dvc.system import System
from tests.basic_env import TestGit, TestGitSubmodule
from tests.utils import get_gitignore_content
def test_init_none(tmp_dir):
assert isinstance(SCM(os.fspath(tmp_di... | [
"dvc.scm.SCM",
"dvc.scm.git.Stash",
"os.fspath",
"pytest.mark.parametrize",
"pytest.raises",
"dvc.system.System.symlink",
"os.path.abspath",
"dvc.scm.Git",
"tests.utils.get_gitignore_content"
] | [((5525, 5663), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ref, include_untracked"""', "[(None, True), (None, False), ('refs/foo/stash', True), ('refs/foo/stash', \n False)]"], {}), "('ref, include_untracked', [(None, True), (None, \n False), ('refs/foo/stash', True), ('refs/foo/stash', False)])\... |
from grafana_backup.create_org import main as create_org
from grafana_backup.api_checks import main as api_checks
from grafana_backup.create_folder import main as create_folder
from grafana_backup.create_datasource import main as create_datasource
from grafana_backup.create_dashboard import main as create_dashboard
fro... | [
"grafana_backup.azure_storage_download.main",
"collections.OrderedDict",
"tarfile.open",
"tempfile.TemporaryDirectory",
"grafana_backup.api_checks.main",
"tarfile.is_tarfile",
"os.path.join",
"grafana_backup.s3_download.main",
"shutil.rmtree",
"tempfile.mkdtemp",
"sys.exit"
] | [((959, 979), 'grafana_backup.api_checks.main', 'api_checks', (['settings'], {}), '(settings)\n', (969, 979), True, 'from grafana_backup.api_checks import main as api_checks\n'), ((2066, 2091), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (2089, 2091), False, 'import sys, tarfile, tempfile, o... |
from cereal import car
from selfdrive.car.volkswagen.values import CAR, BUTTON_STATES, CANBUS, NetworkLocation, TransmissionType, GearShifter, PQ_CARS
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config
from selfdrive.car.interfaces import CarInterfa... | [
"selfdrive.car.gen_empty_fingerprint",
"common.dp_common.common_interface_get_params_lqr",
"selfdrive.car.scale_tire_stiffness",
"cereal.car.CarState.ButtonEvent.new_message",
"selfdrive.car.volkswagen.values.BUTTON_STATES.copy",
"selfdrive.car.scale_rot_inertia",
"selfdrive.car.interfaces.CarInterfaceB... | [((655, 675), 'selfdrive.car.volkswagen.values.BUTTON_STATES.copy', 'BUTTON_STATES.copy', ([], {}), '()\n', (673, 675), False, 'from selfdrive.car.volkswagen.values import CAR, BUTTON_STATES, CANBUS, NetworkLocation, TransmissionType, GearShifter, PQ_CARS\n'), ((923, 946), 'selfdrive.car.gen_empty_fingerprint', 'gen_em... |
"""Support for Nature Remo AC."""
import logging
from homeassistant.core import callback
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
DEFAULT_MAX_TEMP,
DEFAULT_MIN_TEMP,
HVAC_MODE_AUTO,
HVAC_MODE_COOL,
HVAC_MODE_DRY,
HVAC_MODE_F... | [
"logging.getLogger"
] | [((591, 618), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (608, 618), False, 'import logging\n')] |
# sql/compiler.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base SQL and DDL compiler implementations.
Classes provided include:
:class:`.c... | [
"re.escape",
"itertools.count",
"re.compile"
] | [((2600, 2633), 're.compile', 're.compile', (['"""^[A-Z0-9_$]+$"""', 're.I'], {}), "('^[A-Z0-9_$]+$', re.I)\n", (2610, 2633), False, 'import re\n'), ((2665, 2699), 're.compile', 're.compile', (['"""^[A-Z0-9_ $]+$"""', 're.I'], {}), "('^[A-Z0-9_ $]+$', re.I)\n", (2675, 2699), False, 'import re\n'), ((2790, 2863), 're.co... |
import unittest
import solution
class TestQ(unittest.TestCase):
def test_case_0(self):
self.assertEqual(solution.serviceLane([2, 3, 1, 2, 3, 2, 3, 3], [[0, 3], [4, 6], [6, 7], [3, 5], [0, 7]]),
[1, 2, 3, 2, 1])
def test_case_1(self):
self.assertEqual(solution.service... | [
"unittest.main",
"solution.serviceLane"
] | [((460, 475), 'unittest.main', 'unittest.main', ([], {}), '()\n', (473, 475), False, 'import unittest\n'), ((119, 211), 'solution.serviceLane', 'solution.serviceLane', (['[2, 3, 1, 2, 3, 2, 3, 3]', '[[0, 3], [4, 6], [6, 7], [3, 5], [0, 7]]'], {}), '([2, 3, 1, 2, 3, 2, 3, 3], [[0, 3], [4, 6], [6, 7], [3,\n 5], [0, 7]... |
"""Scraper module."""
import logging
from collections import deque
import zoneh.exceptions as exc
from zoneh.captcha import captcha
from zoneh.clients.zoneh import ZoneHAPI
from zoneh.conf import get_config
from zoneh.const import START_PAGE
from zoneh.managers.captcha import captcha_manager
from zoneh.parsers.htmlpa... | [
"logging.getLogger",
"zoneh.parsers.htmlparser.HTMLParser",
"zoneh.utils.get_lock",
"collections.deque",
"zoneh.utils.shallow_sleep",
"zoneh.exceptions.ScraperError",
"zoneh.managers.captcha.captcha_manager.init_captcha",
"zoneh.utils.sleep_time",
"zoneh.clients.zoneh.ZoneHAPI",
"zoneh.conf.get_co... | [((411, 438), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (428, 438), False, 'import logging\n'), ((447, 459), 'zoneh.conf.get_config', 'get_config', ([], {}), '()\n', (457, 459), False, 'from zoneh.conf import get_config\n'), ((595, 605), 'zoneh.clients.zoneh.ZoneHAPI', 'ZoneHAPI', ([... |
import sys, asyncio, os
from catalog import searchDomains, findOpenPorts, kafkaProducer, festin, filterRepeated, S3Store, S3Write
from aux import consumer, producer
async def dispatcher(p, kafkaQ, S3Q):
if p["port"] == "80":
await kafkaQ.put(p)
else:
await S3Q.put(p)
async def main():
task... | [
"asyncio.Queue",
"asyncio.gather",
"aux.consumer",
"catalog.S3Write",
"aux.producer"
] | [((351, 366), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (364, 366), False, 'import sys, asyncio, os\n'), ((389, 404), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (402, 404), False, 'import sys, asyncio, os\n'), ((422, 437), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (435, 437), False, 'import... |
from django.urls import path
from . import views
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from registration.backends.simple.views import RegistrationView
from django.conf.urls import include
from django.contrib.au... | [
"django.conf.urls.include",
"django.urls.path"
] | [((553, 583), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '""""""'}), "('', views.index, name='')\n", (557, 583), False, 'from django.urls import path, include\n'), ((593, 648), 'django.urls.path', 'path', (['"""upload_pdf/"""', 'views.upload_pdf'], {'name': '"""uploadPDF"""'}), "('upload_pdf/', vi... |
#!/usr/bin/env python3
# coding=UTF-8
import xlrd
import xlsxwriter
import os
class xlsx_hlp:
wb = None
folder_name = ""
filename = ""
current = ""
ws_main = None
headers_main = [ 'id', 'date_maj', 'nb_consult', 'date_der_consult', 'photo_url', 'name', 'poste', 'experience', 'titl... | [
"xlrd.open_workbook",
"os.path.join",
"os.path.isdir",
"os.mkdir",
"xlsxwriter.Workbook"
] | [((1673, 1710), 'xlsxwriter.Workbook', 'xlsxwriter.Workbook', (['xlsx_hlp.current'], {}), '(xlsx_hlp.current)\n', (1692, 1710), False, 'import xlsxwriter\n'), ((2322, 2358), 'xlrd.open_workbook', 'xlrd.open_workbook', (['xlsx_hlp.current'], {}), '(xlsx_hlp.current)\n', (2340, 2358), False, 'import xlrd\n'), ((2414, 245... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 18 14:44:30 2018
@author: ujejskik
"""
from bs4 import BeautifulSoup, SoupStrainer
from urllib.request import urlopen
import urllib.request as ul
from urllib.parse import urlparse, urljoin
import time
from random import randint
import multiprocessing as mp
from Blacklist... | [
"random.randint",
"urllib.parse.urlparse",
"bs4.SoupStrainer",
"urllib.request.Request",
"time.strftime",
"bs4.BeautifulSoup",
"multiprocessing.Pool",
"urllib.parse.urljoin",
"urllib.request.urlopen"
] | [((3944, 3954), 'multiprocessing.Pool', 'mp.Pool', (['(4)'], {}), '(4)\n', (3951, 3954), True, 'import multiprocessing as mp\n'), ((1546, 1559), 'urllib.parse.urlparse', 'urlparse', (['url'], {}), '(url)\n', (1554, 1559), False, 'from urllib.parse import urlparse, urljoin\n'), ((2750, 2783), 'urllib.request.Request', '... |
import pytest
from sfa_api import create_app
@pytest.fixture()
def api():
app = create_app(config_name='TestingConfig')
api = app.test_client()
return api
| [
"pytest.fixture",
"sfa_api.create_app"
] | [((48, 64), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (62, 64), False, 'import pytest\n'), ((86, 125), 'sfa_api.create_app', 'create_app', ([], {'config_name': '"""TestingConfig"""'}), "(config_name='TestingConfig')\n", (96, 125), False, 'from sfa_api import create_app\n')] |
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list
from floodsystem.plot import plot_water_levels
import datetime
from tqdm import tqdm
stations = build_station_list()
topTenStations = []
for station in tqdm(stations, desc = "Loading: "):
dt = 10
... | [
"floodsystem.stationdata.build_station_list",
"floodsystem.plot.plot_water_levels",
"tqdm.tqdm",
"datetime.timedelta"
] | [((209, 229), 'floodsystem.stationdata.build_station_list', 'build_station_list', ([], {}), '()\n', (227, 229), False, 'from floodsystem.stationdata import build_station_list\n'), ((269, 301), 'tqdm.tqdm', 'tqdm', (['stations'], {'desc': '"""Loading: """'}), "(stations, desc='Loading: ')\n", (273, 301), False, 'from tq... |
#!/usr/bin/env python
# encoding: utf-8
"""
@version: ??
@author: liangliangyy
@license: MIT Licence
@contact: <EMAIL>
@site: https://www.lylinux.net/
@software: PyCharm
@file: ping_baidu.py
@time: 2017/1/17 下午15:29
"""
from django.core.management.base import BaseCommand, CommandError
from blog.models import Article... | [
"website.utils.get_current_site",
"website.spider_notify.SpiderNotify.baidu_notify",
"blog.models.Tag.objects.all",
"blog.models.Category.objects.all",
"blog.models.Article.objects.filter"
] | [((434, 452), 'website.utils.get_current_site', 'get_current_site', ([], {}), '()\n', (450, 452), False, 'from website.utils import get_current_site\n'), ((1671, 1702), 'website.spider_notify.SpiderNotify.baidu_notify', 'SpiderNotify.baidu_notify', (['urls'], {}), '(urls)\n', (1696, 1702), False, 'from website.spider_n... |
import unittest
from aiohttp.test_utils import unittest_run_loop
import wyrm.base_test
import os
import sys
import shutil
from wyrm import lib
sys.path.append( os.getcwd() )
from app.controllers.strong_parameters import StrongParametersController
from aioweb.core.controller.strong_parameters import StrongParameters
c... | [
"os.environ.setdefault",
"wyrm.lib.init_orator",
"unittest.main",
"os.getcwd"
] | [((160, 171), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (169, 171), False, 'import os\n'), ((2121, 2180), 'os.environ.setdefault', 'os.environ.setdefault', (['"""AIOWEB_SETTINGS_MODULE"""', '"""settings"""'], {}), "('AIOWEB_SETTINGS_MODULE', 'settings')\n", (2142, 2180), False, 'import os\n'), ((2291, 2316), 'wyrm.li... |
from mock import patch
from bs4 import BeautifulSoup
from django.test import TestCase
from wagtail.wagtailcore.rich_text import (
PageLinkHandler,
DbWhitelister,
extract_attrs,
expand_db_html,
RichText
)
class TestPageLinkHandler(TestCase):
fixtures = ['test.json']
def test_get_db_attri... | [
"mock.patch",
"wagtail.wagtailcore.rich_text.extract_attrs",
"wagtail.wagtailcore.rich_text.expand_db_html",
"wagtail.wagtailcore.rich_text.PageLinkHandler.get_db_attributes",
"wagtail.wagtailcore.rich_text.RichText",
"wagtail.wagtailcore.rich_text.DbWhitelister.clean_tag_node",
"bs4.BeautifulSoup",
"... | [((3170, 3226), 'mock.patch', 'patch', (['"""wagtail.wagtailembeds.finders.oembed.find_embed"""'], {}), "('wagtail.wagtailembeds.finders.oembed.find_embed')\n", (3175, 3226), False, 'from mock import patch\n'), ((348, 405), 'bs4.BeautifulSoup', 'BeautifulSoup', (['"""<a data-id="test-id">foo</a>"""', '"""html5lib"""'],... |
import copy
import gc
import inspect
import logging
import os
import pickle
import sys
import time
import warnings
from typing import Union
import numpy as np
import pandas as pd
from ._tags import _DEFAULT_TAGS
from .model_trial import model_trial
from ... import metrics, Space
from ...constants import AG_ARGS_FIT, ... | [
"logging.getLogger",
"pathlib.Path",
"pickle.dumps",
"shutil.rmtree",
"pandas.concat",
"gc.collect",
"copy.deepcopy",
"time.time",
"inspect.getmro"
] | [((1005, 1032), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1022, 1032), False, 'import logging\n'), ((38498, 38517), 'copy.deepcopy', 'copy.deepcopy', (['self'], {}), '(self)\n', (38511, 38517), False, 'import copy\n'), ((39756, 39788), 'copy.deepcopy', 'copy.deepcopy', (['scheduler_... |
# Copyright 2021 Google LLC. 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 applicable law o... | [
"google3.cloud.graphite.mmv2.services.google.network_security.server_tls_policy_pb2.NetworksecurityAlphaServerTlsPolicyServerCertificateLocalFilepath",
"google3.cloud.graphite.mmv2.services.google.network_security.server_tls_policy_pb2.NetworksecurityAlphaServerTlsPolicyMtlsPolicy",
"google3.cloud.graphite.mmv2... | [((1309, 1329), 'connector.channel.initialize', 'channel.initialize', ([], {}), '()\n', (1327, 1329), False, 'from connector import channel\n'), ((1857, 1928), 'google3.cloud.graphite.mmv2.services.google.network_security.server_tls_policy_pb2.ApplyNetworksecurityAlphaServerTlsPolicyRequest', 'server_tls_policy_pb2.App... |
# --------------
#Header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#path of the data file- path
data=pd.read_csv(path)
data['Gender'].replace('-','Agender')
gender_count=data['Gender'].value_counts()
#Code starts here
data.plot.bar()
#print(data)
# --------------
... | [
"matplotlib.pyplot.boxplot",
"pandas.read_csv",
"matplotlib.pyplot.pie",
"pandas.DataFrame",
"matplotlib.pyplot.title"
] | [((145, 162), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (156, 162), True, 'import pandas as pd\n'), ((365, 382), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (376, 382), True, 'import pandas as pd\n'), ((428, 470), 'matplotlib.pyplot.pie', 'plt.pie', (['alignment'], {'labels': 'alig... |
import tensorflow as tf
import numpy as np
import pysc2.my_agent.layer as layer
import pysc2.my_agent.agent_network as Network
if __name__ == "__main__":
# with tf.name_scope('some_scope1'):
# a = tf.Variable(111, 'a')
# b = tf.Variable(222, 'b')
# c = tf.Variable(333, 'c')
#
# wit... | [
"pysc2.my_agent.agent_network.ProbeNetwork"
] | [((945, 967), 'pysc2.my_agent.agent_network.ProbeNetwork', 'Network.ProbeNetwork', ([], {}), '()\n', (965, 967), True, 'import pysc2.my_agent.agent_network as Network\n')] |
# Village People, 2017
from pexpect import pxssh
import time
PATH = 'Documents/Malmo-0.21.0-Linux-Ubuntu-16.04-64bit_withBoost/Minecraft/'
def get_session(ip, user, password):
s = pxssh.pxssh()
if not s.login(ip, user, password):
print("SSH session failed on login.")
print(str(s))
else:
... | [
"time.sleep",
"pexpect.pxssh.pxssh"
] | [((187, 200), 'pexpect.pxssh.pxssh', 'pxssh.pxssh', ([], {}), '()\n', (198, 200), False, 'from pexpect import pxssh\n'), ((526, 541), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (536, 541), False, 'import time\n')] |
from typing import Dict, Optional
from models_library.projects import KEY_RE, VERSION_RE, Node
from pydantic import BaseModel, EmailStr, Field, Json
class DAGBase(BaseModel):
key: str = Field(
..., regex=KEY_RE, example="simcore/services/frontend/nodes-group/macros/1"
)
version: str = Field(..., ... | [
"pydantic.Field"
] | [((193, 280), 'pydantic.Field', 'Field', (['...'], {'regex': 'KEY_RE', 'example': '"""simcore/services/frontend/nodes-group/macros/1"""'}), "(..., regex=KEY_RE, example=\n 'simcore/services/frontend/nodes-group/macros/1')\n", (198, 280), False, 'from pydantic import BaseModel, EmailStr, Field, Json\n'), ((309, 354),... |
import torch
DEVICE = torch.device('cpu') | [
"torch.device"
] | [((24, 43), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (36, 43), False, 'import torch\n')] |
import FWCore.ParameterSet.Config as cms
# Set the HLT paths
import HLTrigger.HLTfilters.hltHighLevel_cfi
ALCARECOSiStripCalZeroBiasHLT = HLTrigger.HLTfilters.hltHighLevel_cfi.hltHighLevel.clone(
andOr = True, # choose logical OR between Triggerbits
# HLTPaths = [
# #SiStripCalZeroBias
# "HLT_Zero... | [
"FWCore.ParameterSet.Config.Sequence",
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.string"
] | [((2541, 2726), 'FWCore.ParameterSet.Config.Sequence', 'cms.Sequence', (['(ALCARECOSiStripCalZeroBiasHLT *\n HLTPixelActivityFilterForSiStripCalZeroBias *\n DCSStatusForSiStripCalZeroBias * calZeroBiasClusters * APVPhases *\n consecutiveHEs)'], {}), '(ALCARECOSiStripCalZeroBiasHLT *\n HLTPixelActivityFilter... |
#!/usr/bin/env python
# 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
#... | [
"json.loads",
"logging.warning",
"requests.get",
"re.search"
] | [((3633, 3657), 'json.loads', 'json.loads', (['req.text[4:]'], {}), '(req.text[4:])\n', (3643, 3657), False, 'import json\n'), ((4792, 4816), 'json.loads', 'json.loads', (['req.text[4:]'], {}), '(req.text[4:])\n', (4802, 4816), False, 'import json\n'), ((2263, 2342), 're.search', 're.search', (['"""Depends-On: *(I[0-9a... |
import unittest
import numpy as np
import time
import uuid
from arch.api import session
from federatedml.param.intersect_param import IntersectParam
class TestRsaIntersectGuest(unittest.TestCase):
def setUp(self):
self.jobid = str(uuid.uuid1())
session.init(self.jobid)
from feder... | [
"arch.api.session.parallelize",
"arch.api.session.init",
"federatedml.statistic.intersect.intersect_guest.RsaIntersectionGuest",
"federatedml.param.intersect_param.IntersectParam",
"uuid.uuid1",
"arch.api.session.cleanup",
"unittest.main",
"federatedml.statistic.intersect.intersect.RsaIntersect",
"a... | [((1623, 1638), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1636, 1638), False, 'import unittest\n'), ((268, 292), 'arch.api.session.init', 'session.init', (['self.jobid'], {}), '(self.jobid)\n', (280, 292), False, 'from arch.api import session\n'), ((492, 508), 'federatedml.param.intersect_param.IntersectPara... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/fitting/variables.py
# Module with decoration of some RooFit variables for efficient usage in python
# @see RooAbsReal
# @see RooRealVar
# @author <NAME> <EMAIL>
# @date 20... | [
"array.array",
"ROOT.RooBinning",
"ostap.utils.docme.docme",
"ROOT.RooNumber.infinity",
"array.array.array",
"ostap.core.core.VE",
"ostap.core.core.Ostap.FormulaVar",
"ostap.core.core.hID",
"ROOT.RooRealVar",
"ostap.logger.logger.getLogger",
"ROOT.RooArgList",
"ROOT.RooParamBinning",
"ROOT.R... | [((1930, 1966), 'ostap.logger.logger.getLogger', 'getLogger', (['"""ostap.fitting.variables"""'], {}), "('ostap.fitting.variables')\n", (1939, 1966), False, 'from ostap.logger.logger import getLogger\n'), ((2007, 2026), 'ostap.logger.logger.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (2016, 2026), Fals... |
import tkinter as tk
def getText(event):
print(event.widget.get())
def generateWindow():
window = tk.Tk()
greetings = tk.Label(text="Test test test label")
greetings.pack()
button = tk.Button(text="Click me")
button.pack()
inputUsr = tk.Entry(width=50)
inputUsr.bind("<Return>", getText... | [
"tkinter.Button",
"tkinter.Tk",
"tkinter.Entry",
"tkinter.Label"
] | [((108, 115), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (113, 115), True, 'import tkinter as tk\n'), ((132, 169), 'tkinter.Label', 'tk.Label', ([], {'text': '"""Test test test label"""'}), "(text='Test test test label')\n", (140, 169), True, 'import tkinter as tk\n'), ((204, 230), 'tkinter.Button', 'tk.Button', ([], {'t... |
from __future__ import unicode_literals
import re
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from datetime import datetime, timedelta
import django
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
t... | [
"django_comments_xtd.django_comments.get_model",
"mock.patch",
"imp.find_module",
"django_comments_xtd.django_comments.get_form",
"django.core.urlresolvers.reverse",
"django.contrib.comments.models.CommentFlag.objects.filter",
"datetime.datetime.now",
"datetime.timedelta",
"django.contrib.auth.model... | [((705, 739), 'imp.find_module', 'imp.find_module', (['"""django_comments"""'], {}), "('django_comments')\n", (720, 739), False, 'import imp\n'), ((966, 982), 'mock.patch', 'patch', (['send_mail'], {}), '(send_mail)\n', (971, 982), False, 'from mock import patch\n'), ((1006, 1050), 'mock.patch', 'patch', (['"""django_c... |
from django.urls import path
from . import views
urlpatterns = [
path('<prof_id>/<course_name>', views.addReview, name='add-review'),
path('<review_id>/<prof_id>/<course_name>', views.deleteReview, name='delete-review'),
path('<review_id>/<vote>/<prof_id>/<course_name>', views.voteReview, name='vote-review... | [
"django.urls.path"
] | [((70, 137), 'django.urls.path', 'path', (['"""<prof_id>/<course_name>"""', 'views.addReview'], {'name': '"""add-review"""'}), "('<prof_id>/<course_name>', views.addReview, name='add-review')\n", (74, 137), False, 'from django.urls import path\n'), ((143, 233), 'django.urls.path', 'path', (['"""<review_id>/<prof_id>/<c... |
# Copyright (c) 2019 SUSE LINUX GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | [
"logging.getLogger",
"os.path.join",
"requests.get",
"tests.config.converter",
"yaml.load_all",
"tests.lib.common.recursive_replace",
"tests.lib.common.execute"
] | [((791, 818), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (808, 818), False, 'import logging\n'), ((1003, 1049), 'os.path.join', 'os.path.join', (['self.workspace.build_dir', '"""rook"""'], {}), "(self.workspace.build_dir, 'rook')\n", (1015, 1049), False, 'import os\n'), ((1074, 1138),... |
#!/usr/bin/env python3
"""Solve subset sum problem."""
import argparse
import sys
import os
import platform
from collections import defaultdict
from collections import Counter
from datetime import datetime as dt
from math import log
import ctypes
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__version__ = 0.1
# within ... | [
"ctypes.POINTER",
"ctypes.cdll.LoadLibrary",
"argparse.ArgumentParser",
"math.log",
"collections.Counter",
"sys.stderr.write",
"datetime.datetime.now",
"ctypes.c_bool",
"os.path.dirname",
"os.path.isfile",
"sys.exit",
"ctypes.c_uint64"
] | [((5728, 5753), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5751, 5753), False, 'import argparse\n'), ((7309, 7336), 'sys.stderr.write', 'sys.stderr.write', (['(msg + end)'], {}), '(msg + end)\n', (7325, 7336), False, 'import sys\n'), ((7432, 7440), 'datetime.datetime.now', 'dt.now', ([], {... |
#!/usr/bin/env python
import asyncio
import cytoolz
from hexbytes import HexBytes
import logging
import math
from typing import (
List,
Dict,
Iterable,
Set,
Optional
)
from web3 import Web3
from web3.contract import Contract
from web3.datastructures import AttributeDict
from hummingbot.logger impo... | [
"logging.getLogger",
"hummingbot.core.event.events.TokenApprovedEvent",
"hummingbot.core.utils.async_utils.safe_gather",
"cytoolz.concat",
"math.pow",
"asyncio.Queue",
"hummingbot.core.event.event_forwarder.EventForwarder",
"hummingbot.core.event.events.WalletReceivedAssetEvent"
] | [((2381, 2396), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (2394, 2396), False, 'import asyncio\n'), ((2445, 2488), 'hummingbot.core.event.event_forwarder.EventForwarder', 'EventForwarder', (['self.did_receive_new_blocks'], {}), '(self.did_receive_new_blocks)\n', (2459, 2488), False, 'from hummingbot.core.even... |
"""The keenetic_ndms2 component."""
from __future__ import annotations
import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_SCAN_INTERVAL, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry, entity_regi... | [
"logging.getLogger",
"homeassistant.helpers.device_registry.async_get",
"homeassistant.helpers.entity_registry.async_get"
] | [((702, 729), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (719, 729), False, 'import logging\n'), ((1993, 2024), 'homeassistant.helpers.entity_registry.async_get', 'entity_registry.async_get', (['hass'], {}), '(hass)\n', (2018, 2024), False, 'from homeassistant.helpers import device_re... |
# Copyright (c) 2016 Riverbank Computing Limited <<EMAIL>>
#
# This file is part of PyQt5.
#
# This file may be used under the terms of the GNU General Public License
# version 3.0 as published by the Free Software Foundation and appearing in
# the file LICENSE included in the packaging of this file. Please re... | [
"PyQt5.QtCore.QDir.cleanPath",
"sys.stderr.write",
"PyQt5.QtCore.QFile.exists",
"sys.exit"
] | [((2299, 2344), 'sys.stderr.write', 'sys.stderr.write', (['"""PyQt5 resource compiler\n"""'], {}), "('PyQt5 resource compiler\\n')\n", (2315, 2344), False, 'import sys\n'), ((2419, 2943), 'sys.stderr.write', 'sys.stderr.write', (['"""Usage: pyrcc5 [options] <inputs>\n\nOptions:\n -o file Write output to fi... |
# Copyright 2022 Quantapix 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/LICENSE-2.0
#
# Unless required by applicable l... | [
"csv.DictReader",
"os.path.join",
"datasets.Version",
"datasets.ClassLabel",
"datasets.Value"
] | [((1580, 1624), 'os.path.join', 'join', (["fs['train']", '"""XNLI-MT-1.0"""', '"""multinli"""'], {}), "(fs['train'], 'XNLI-MT-1.0', 'multinli')\n", (1584, 1624), False, 'from os.path import join\n'), ((1637, 1666), 'os.path.join', 'join', (["fs['valid']", '"""XNLI-1.0"""'], {}), "(fs['valid'], 'XNLI-1.0')\n", (1641, 16... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"warnings.warn",
"pulumi.log.warn",
"pulumi.runtime.invoke",
"pulumi.InvokeOptions"
] | [((449, 625), 'warnings.warn', 'warnings.warn', (['"""The \'latest\' version is deprecated. Please migrate to the function in the top-level module: \'azure-nextgen:aad:getDomainService\'."""', 'DeprecationWarning'], {}), '(\n "The \'latest\' version is deprecated. Please migrate to the function in the top-level modu... |
import numpy as np
import uncertainties.unumpy as unumpy
from uncertainties import ufloat
from scipy.stats import sem
print('Wellenlaenge')
dd1, za = np.genfromtxt('python/wellenlaenge.txt', unpack=True)
dd = (dd1*10**(-3))/5.017
lam = 2 * dd / za
mlam = np.mean(lam)
slam = sem(lam)
rlam = ufloat(mlam, slam)
np.savetx... | [
"numpy.mean",
"numpy.column_stack",
"scipy.stats.sem",
"uncertainties.ufloat",
"numpy.genfromtxt"
] | [((151, 204), 'numpy.genfromtxt', 'np.genfromtxt', (['"""python/wellenlaenge.txt"""'], {'unpack': '(True)'}), "('python/wellenlaenge.txt', unpack=True)\n", (164, 204), True, 'import numpy as np\n'), ((256, 268), 'numpy.mean', 'np.mean', (['lam'], {}), '(lam)\n', (263, 268), True, 'import numpy as np\n'), ((276, 284), '... |
import requests
import csv
from bs4 import BeautifulSoup
import time
import wget
import ssl
import random
ssl._create_default_https_context = ssl._create_unverified_context
domain = "https://digital.lib.umd.edu"
attributes = {'Title'}
downloaded_map_cnt = 0
def download_image(record):
time.sleep(random.random() *... | [
"csv.DictWriter",
"wget.download",
"requests.get",
"bs4.BeautifulSoup",
"random.random"
] | [((550, 568), 'requests.get', 'requests.get', (['link'], {}), '(link)\n', (562, 568), False, 'import requests\n'), ((584, 630), 'bs4.BeautifulSoup', 'BeautifulSoup', (['map_page.content', '"""html.parser"""'], {}), "(map_page.content, 'html.parser')\n", (597, 630), False, 'from bs4 import BeautifulSoup\n'), ((1798, 184... |
"""Tests for the Sonos battery sensor platform."""
from unittest.mock import PropertyMock
from soco.exceptions import NotSupportedException
from homeassistant.components.sensor import SCAN_INTERVAL
from homeassistant.components.sonos.binary_sensor import ATTR_BATTERY_POWER_SOURCE
from homeassistant.const import STATE... | [
"unittest.mock.PropertyMock",
"homeassistant.util.dt.utcnow",
"homeassistant.helpers.entity_registry.async_get"
] | [((763, 786), 'homeassistant.helpers.entity_registry.async_get', 'ent_reg.async_get', (['hass'], {}), '(hass)\n', (780, 786), True, 'from homeassistant.helpers import entity_registry as ent_reg\n'), ((1165, 1188), 'homeassistant.helpers.entity_registry.async_get', 'ent_reg.async_get', (['hass'], {}), '(hass)\n', (1182,... |
# Copyright 2019 Extreme Networks, 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 i... | [
"orquesta.utils.schema.check_schemas_compatible",
"orquesta.utils.schema.get_schema_type",
"orquesta.utils.schema.merge_schema",
"orquesta.utils.schema.check_schema_mergeable"
] | [((1029, 1069), 'orquesta.utils.schema.check_schema_mergeable', 'schema_util.check_schema_mergeable', (['None'], {}), '(None)\n', (1063, 1069), True, 'from orquesta.utils import schema as schema_util\n'), ((1078, 1116), 'orquesta.utils.schema.check_schema_mergeable', 'schema_util.check_schema_mergeable', (['{}'], {}), ... |
from typing import List, Callable, Optional, Union, Dict, Awaitable, Any
from aiogram.types import InlineKeyboardButton, CallbackQuery
from aiogram_dialog.dialog import Dialog
from aiogram_dialog.manager.manager import DialogManager
from aiogram_dialog.widgets.text import Text
from aiogram_dialog.widgets.widget_event... | [
"aiogram_dialog.widgets.widget_event.ensure_event_processor"
] | [((784, 816), 'aiogram_dialog.widgets.widget_event.ensure_event_processor', 'ensure_event_processor', (['on_click'], {}), '(on_click)\n', (806, 816), False, 'from aiogram_dialog.widgets.widget_event import WidgetEventProcessor, ensure_event_processor\n')] |
"""This module implements an microphone interface"""
from time import time
import numpy as np
try:
IMPORT_ERROR = False
import sounddevice as sd
except Exception as e:
IMPORT_ERROR = True
print(e)
from scipy.fft import rfft
class Microphone:
"""
This class provides a simple interface to the ... | [
"sounddevice.Stream",
"numpy.linspace",
"time.time",
"scipy.fft.rfft"
] | [((3769, 3843), 'numpy.linspace', 'np.linspace', ([], {'start': '(0)', 'stop': '(samplerate // 2)', 'num': '(samplerate * duration // 2)'}), '(start=0, stop=samplerate // 2, num=samplerate * duration // 2)\n', (3780, 3843), True, 'import numpy as np\n'), ((5145, 5151), 'time.time', 'time', ([], {}), '()\n', (5149, 5151... |
import torch
import torch.nn as nn
import torch.optim
import torch.cuda.amp
import torch.backends.cudnn
from torch.utils.data import DataLoader
from torchvision.transforms import Compose, Normalize, ToTensor, Resize, RandomCrop, RandomHorizontalFlip, RandomApply, RandomGrayscale, ColorJitter, GaussianBlur
from tqdm imp... | [
"torch.nn.GELU",
"torchvision.transforms.ColorJitter",
"torch.cuda.is_available",
"torch.cuda.amp.GradScaler",
"torch.nn.LayerNorm",
"torch.cuda.amp.autocast",
"torch.nn.Identity",
"torchvision.transforms.ToTensor",
"visiont.models.VisionTransformer",
"visiont.transforms.ToImageMode",
"torchvisi... | [((1144, 1169), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1167, 1169), False, 'import torch\n'), ((1897, 1947), 'visiont.datasets.ImageDirectory', 'ImageDirectory', (['args.dataset', 'transform', 'transform'], {}), '(args.dataset, transform, transform)\n', (1911, 1947), False, 'from visio... |
import subprocess, os
path = "/home/luka/kriptonavti/data/USER"
print("Do you wanna set up user account? [y/n]")
answer1 = str(input())
if answer1 == str("y"):
try:
os.mkdir(path)
except:
pass
with open(path + "/bitcoin.txt","w") as f:
f.write("regtest=1\n")
f.write("rpcus... | [
"os.rename",
"subprocess.run",
"os.mkdir"
] | [((739, 795), 'os.rename', 'os.rename', (["(path + '/bitcoin.txt')", "(path + '/bitcoin.conf')"], {}), "(path + '/bitcoin.txt', path + '/bitcoin.conf')\n", (748, 795), False, 'import subprocess, os\n'), ((180, 194), 'os.mkdir', 'os.mkdir', (['path'], {}), '(path)\n', (188, 194), False, 'import subprocess, os\n'), ((932... |
# Copyright (C) 2018 <NAME>
#
# SPDX-License-Identifier: MIT
"""This module contains a collection of functions related to
geographical data.
"""
from bokeh.tile_providers import get_provider, Vendors
from haversine import haversine # for calculating distance between points
from .utils import sorted_by_key # noqa
fro... | [
"converter.lat2y",
"haversine.haversine",
"bokeh.plotting.show",
"bokeh.plotting.figure",
"converter.lon2x",
"bokeh.tile_providers.get_provider",
"bokeh.plotting.output_file"
] | [((4048, 4163), 'bokeh.plotting.figure', 'figure', ([], {'x_range': '(-1100000, 300000)', 'y_range': '(6300000, 8200000)', 'x_axis_type': '"""mercator"""', 'y_axis_type': '"""mercator"""'}), "(x_range=(-1100000, 300000), y_range=(6300000, 8200000), x_axis_type=\n 'mercator', y_axis_type='mercator')\n", (4054, 4163),... |
import LevelBuilder
from sprites import *
def render(name,bg):
lb = LevelBuilder.LevelBuilder(name+".plist",background=bg)
lb.addObject(Hero.HeroSprite(x=19, y=27,width=32,height=32))
lb.addObject(Hero.HeroSprite(x=457, y=27,width=32,height=32))
lb.addObject(Star.StarSprite(x=237, y=90,width=32,height=3... | [
"LevelBuilder.LevelBuilder"
] | [((72, 129), 'LevelBuilder.LevelBuilder', 'LevelBuilder.LevelBuilder', (["(name + '.plist')"], {'background': 'bg'}), "(name + '.plist', background=bg)\n", (97, 129), False, 'import LevelBuilder\n')] |
# -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import OptionProperty
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.modalview import ModalView
from kivy.utils import get_color_from_hex
from kivymd.backgroundcolorbehavior import SpecificBackgroundColorBehavior
from kivymd.button... | [
"kivy.utils.get_color_from_hex",
"kivy.lang.Builder.load_string",
"kivymd.theming.ThemeManager",
"kivy.properties.OptionProperty"
] | [((496, 13444), 'kivy.lang.Builder.load_string', 'Builder.load_string', (['"""\n#:import MDTabbedPanel kivymd.tabs.MDTabbedPanel\n#:import MDTab kivymd.tabs.MDTab\n\n\n<ColorSelector>:\n size: dp(40), dp(40)\n pos: self.pos\n size_hint: (None, None)\n canvas:\n Color:\n rgba: root.rgb_hex(... |
from random import random
import pytest
from DataStructures.BinarySearchTree.binary_search_tree import BinarySearchTree
@pytest.fixture()
def binary_search_tree():
return BinarySearchTree()
def populate_tree(binary_search_tree, items):
for i in items:
binary_search_tree.insert(i)
class TestBinar... | [
"pytest.fixture",
"random.random",
"DataStructures.BinarySearchTree.binary_search_tree.BinarySearchTree"
] | [((125, 141), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (139, 141), False, 'import pytest\n'), ((179, 197), 'DataStructures.BinarySearchTree.binary_search_tree.BinarySearchTree', 'BinarySearchTree', ([], {}), '()\n', (195, 197), False, 'from DataStructures.BinarySearchTree.binary_search_tree import BinarySe... |
import socket
from p2p.connection_manager import ConnectionManager
STATE_INIT = 0
STATE_STANDBY = 1
STATE_CONNECTED_TO_NETWORK = 2
STATE_SHUTTING_DOWN = 3
class ServerCore:
def __init__(self, my_port=50082, core_node_host=None, core_node_port=None):
self.server_state = STATE_INIT
print('Initial... | [
"p2p.connection_manager.ConnectionManager",
"socket.socket"
] | [((488, 531), 'p2p.connection_manager.ConnectionManager', 'ConnectionManager', (['self.my_ip', 'self.my_port'], {}), '(self.my_ip, self.my_port)\n', (505, 531), False, 'from p2p.connection_manager import ConnectionManager\n'), ((1253, 1301), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}... |
import filecmp
import logging
import os
import tempfile
from galaxy.tools import (
create_tool_from_source,
get_tool_source,
parameters,
Tool
)
from galaxy.tools.fetcher import ToolLocationFetcher
from galaxy.tools.parameters import dynamic_options
from tool_shed.tools.data_table_manager import ShedToo... | [
"logging.getLogger",
"tool_shed.util.basic_util.strip_path",
"tool_shed.util.tool_util.copy_sample_file",
"tool_shed.util.hg_util.get_config_from_disk",
"os.walk",
"os.path.exists",
"tool_shed.util.hg_util.get_named_tmpfile_from_ctx",
"os.unlink",
"tool_shed.util.hg_util.copy_file_from_manifest",
... | [((454, 481), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (471, 481), False, 'import logging\n'), ((587, 621), 'tool_shed.tools.data_table_manager.ShedToolDataTableManager', 'ShedToolDataTableManager', (['self.app'], {}), '(self.app)\n', (611, 621), False, 'from tool_shed.tools.data_ta... |
# pylint: disable=g-bad-file-header
# Copyright 2015 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/LICENS... | [
"tensorflow.core.framework.graph_pb2.GraphDef",
"tensorflow.core.framework.node_def_pb2.NodeDef",
"tensorflow.core.framework.attr_value_pb2.AttrValue",
"tensorflow.python.framework.graph_util.extract_sub_graph",
"tensorflow.python.platform.gfile.FastGFile",
"google.protobuf.text_format.MessageToString",
... | [((1963, 1983), 'tensorflow.core.framework.graph_pb2.GraphDef', 'graph_pb2.GraphDef', ([], {}), '()\n', (1981, 1983), False, 'from tensorflow.core.framework import graph_pb2\n'), ((2878, 2952), 'tensorflow.python.framework.graph_util.extract_sub_graph', 'graph_util.extract_sub_graph', (['inputs_replaced_graph_def', 'ou... |
import warnings
import cx_Oracle
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.encoding import force_text
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps ty... | [
"warnings.warn",
"django.utils.encoding.force_text"
] | [((5496, 5615), 'warnings.warn', 'warnings.warn', (['"""get_indexes() is deprecated in favor of get_constraints()."""', 'RemovedInDjango21Warning'], {'stacklevel': '(2)'}), "('get_indexes() is deprecated in favor of get_constraints().',\n RemovedInDjango21Warning, stacklevel=2)\n", (5509, 5615), False, 'import warni... |
from google.cloud import storage
import tempfile
import h5py
import os
class GCSH5Writer(object):
def __init__(self, fn):
self.fn = fn
if fn.startswith('gs://'):
self.gclient = storage.Client()
self.storage_dir = tempfile.TemporaryDirectory()
self.writer = h5py.F... | [
"google.cloud.storage.Client",
"os.path.exists",
"tempfile.TemporaryDirectory",
"os.path.join",
"h5py.File"
] | [((210, 226), 'google.cloud.storage.Client', 'storage.Client', ([], {}), '()\n', (224, 226), False, 'from google.cloud import storage\n'), ((258, 287), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (285, 287), False, 'import tempfile\n'), ((693, 716), 'h5py.File', 'h5py.File', (['self.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The Project U-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import re
import fasm
import bitstream
... | [
"fasm.Annotation",
"re.match",
"fasm.FasmLine",
"fasm.SetFasmFeature"
] | [((572, 633), 're.match', 're.match', (['"""([A-Za-z0-9_]+).([^\\\\[]+)(\\\\[[0-9]+\\\\])?"""', 'feature'], {}), "('([A-Za-z0-9_]+).([^\\\\[]+)(\\\\[[0-9]+\\\\])?', feature)\n", (580, 633), False, 'import re\n'), ((846, 939), 'fasm.SetFasmFeature', 'fasm.SetFasmFeature', ([], {'feature': 'feature', 'start': 'address', ... |
import hydra
import pytorch_lightning
import pytorch_lightning.callbacks
from . import model, dataset
@hydra.main(config_name='conf', config_path=None)
def main(config: model.PlacesTrainingConfig):
callbacks = [
pytorch_lightning.callbacks.GPUStatsMonitor(),
pytorch_lightning.callbacks.LearningRa... | [
"hydra.main",
"hydra.core.config_store.ConfigStore",
"pytorch_lightning.Trainer",
"pytorch_lightning.callbacks.GPUStatsMonitor",
"pytorch_lightning.callbacks.LearningRateMonitor"
] | [((106, 154), 'hydra.main', 'hydra.main', ([], {'config_name': '"""conf"""', 'config_path': 'None'}), "(config_name='conf', config_path=None)\n", (116, 154), False, 'import hydra\n'), ((750, 793), 'pytorch_lightning.Trainer', 'pytorch_lightning.Trainer', ([], {}), '(**trainer_kwargs)\n', (775, 793), False, 'import pyto... |
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import subprocess
from pathlib import Path
from ogr import GithubService, GitlabService
from packit.local_project import LocalProject
from tests.spellbook import initiate_git_repo
def test_pr_id_and_ref(tmp_path: Path):
""" p-s passes... | [
"subprocess.check_output",
"ogr.GitlabService",
"ogr.GithubService",
"subprocess.check_call"
] | [((425, 490), 'subprocess.check_call', 'subprocess.check_call', (["['git', 'init', '--bare', '.']"], {'cwd': 'remote'}), "(['git', 'init', '--bare', '.'], cwd=remote)\n", (446, 490), False, 'import subprocess\n'), ((847, 933), 'subprocess.check_call', 'subprocess.check_call', (["['git', 'branch', local_tmp_branch, ref]... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
jax = pytest.importorskip("jax")
jax.config.update("jax_enable_x64", True)
def test_from_jax():
jax_array_1d = jax.numpy.arange... | [
"awkward._v2.backend",
"awkward._v2.from_jax",
"awkward._v2.Array",
"awkward._v2.to_list",
"numpy.array",
"pytest.importorskip"
] | [((192, 218), 'pytest.importorskip', 'pytest.importorskip', (['"""jax"""'], {}), "('jax')\n", (211, 218), False, 'import pytest\n'), ((433, 462), 'awkward._v2.from_jax', 'ak._v2.from_jax', (['jax_array_1d'], {}), '(jax_array_1d)\n', (448, 462), True, 'import awkward as ak\n'), ((485, 514), 'awkward._v2.from_jax', 'ak._... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import platform
import multiprocessing.pool
from setuptools import setup, Extension
lib_name = 'duckdb'
extensions = ['parquet', 'icu', 'fts', 'tpch', 'tpcds', 'visualizer']
if platform.system() == 'Windows':
extensions = ['parquet', 'icu', 'ft... | [
"os.listdir",
"os.getenv",
"package_build.get_libraries",
"amalgamation.list_includes_files",
"sys.argv.append",
"os.path.join",
"setuptools.setup",
"package_build.get_relative_path",
"setuptools.Extension",
"os.path.realpath",
"platform.system",
"pybind11.get_include",
"numpy.get_include",
... | [((3608, 3651), 'os.path.join', 'os.path.join', (['script_path', '"""src"""', '"""include"""'], {}), "(script_path, 'src', 'include')\n", (3620, 3651), False, 'import os\n'), ((3671, 3703), 'os.path.join', 'os.path.join', (['script_path', '"""src"""'], {}), "(script_path, 'src')\n", (3683, 3703), False, 'import os\n'),... |
import json
from logger import log
from os import path
class DictStore():
status = "Empty"
dataStore = ""
data = dict()
def getStatus(self):
return self.status
def save(self):
with open( self.dataStore, 'w' ) as outfile:
jstr = json.dumps( self.data )
out... | [
"os.path.isfile",
"logger.log",
"json.dumps",
"json.load"
] | [((281, 302), 'json.dumps', 'json.dumps', (['self.data'], {}), '(self.data)\n', (291, 302), False, 'import json\n'), ((373, 400), 'os.path.isfile', 'path.isfile', (['self.dataStore'], {}), '(self.dataStore)\n', (384, 400), False, 'from os import path\n'), ((610, 624), 'logger.log', 'log', (['self.data'], {}), '(self.da... |
from nmigen import Elaboratable, Module, Signal, Array, unsigned, Const
from nmigen.build import Platform
from nmigen.cli import main_parser, main_runner, main
from nmigen.back.pysim import Simulator, Delay
from nmigen.test import *
from src.ldpc_decoder import LDPC_Decoder
import unittest
def Positive_Test(output, in... | [
"nmigen.back.pysim.Simulator",
"src.ldpc_decoder.LDPC_Decoder",
"nmigen.back.pysim.Delay"
] | [((1250, 1287), 'src.ldpc_decoder.LDPC_Decoder', 'LDPC_Decoder', (['parityCheckMatrix', '(6)', '(3)'], {}), '(parityCheckMatrix, 6, 3)\n', (1262, 1287), False, 'from src.ldpc_decoder import LDPC_Decoder\n'), ((359, 378), 'nmigen.back.pysim.Simulator', 'Simulator', (['self.dut'], {}), '(self.dut)\n', (368, 378), False, ... |
"""Week I Assignment
Simulate the trajectory of a robot approximated using a unicycle model given the
following start states, dt, velocity commands and timesteps
State = (x, y, theta);
Velocity = (v, w)
1. Start=(0, 0, 0); dt=0.1; vel=(1, 0.5); timesteps: 25
2. Start=(0, 0, 1.57); dt=0.2; vel=(0.5, 1); timesteps:... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"math.cos",
"matplotlib.pyplot.title",
"math.sin",
"matplotlib.pyplot.show"
] | [((2104, 2142), 'matplotlib.pyplot.title', 'plt.title', (['f"""Unicycle Model: {v}, {w}"""'], {}), "(f'Unicycle Model: {v}, {w}')\n", (2113, 2142), True, 'import matplotlib.pyplot as plt\n'), ((2152, 2179), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""X-Coordinates"""'], {}), "('X-Coordinates')\n", (2162, 2179), Tru... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | [
"plaso.parsers.sqlite.SQLiteParser.RegisterPlugin"
] | [((15389, 15445), 'plaso.parsers.sqlite.SQLiteParser.RegisterPlugin', 'sqlite.SQLiteParser.RegisterPlugin', (['FirefoxHistoryPlugin'], {}), '(FirefoxHistoryPlugin)\n', (15423, 15445), False, 'from plaso.parsers import sqlite\n'), ((15446, 15504), 'plaso.parsers.sqlite.SQLiteParser.RegisterPlugin', 'sqlite.SQLiteParser.... |