code stringlengths 21 1.03M | apis list | extract_api stringlengths 74 8.23M |
|---|---|---|
from django.contrib import admin
from Apis.canino.models import *
# Register your models here.
admin.site.register(Perro)
admin.site.register(Raza)
admin.site.register(Sexo)
admin.site.register(Vacuna)
| [
"django.contrib.admin.site.register"
] | [((97, 123), 'django.contrib.admin.site.register', 'admin.site.register', (['Perro'], {}), '(Perro)\n', (116, 123), False, 'from django.contrib import admin\n'), ((124, 149), 'django.contrib.admin.site.register', 'admin.site.register', (['Raza'], {}), '(Raza)\n', (143, 149), False, 'from django.contrib import admin\n')... |
""" A bitcoind proxy that allows instrumentation and canned responses
"""
from flask import Flask, request # type: ignore
from bitcoin.rpc import JSONRPCError # type: ignore
from bitcoin.rpc import RawProxy as BitcoinProxy # type: ignore
from cheroot.wsgi import Server # type: ignore
from cheroot.wsgi import PathIn... | [
"cheroot.wsgi.PathInfoDispatcher",
"cheroot.wsgi.Server",
"flask.request.data.decode",
"bitcoin.rpc.RawProxy",
"json.dumps",
"threading.Thread",
"flask.Flask"
] | [((847, 869), 'flask.Flask', 'Flask', (['"""BitcoindProxy"""'], {}), "('BitcoindProxy')\n", (852, 869), False, 'from flask import Flask, request\n'), ((1152, 1203), 'bitcoin.rpc.RawProxy', 'BitcoinProxy', ([], {'btc_conf_file': 'self.bitcoind.conf_file'}), '(btc_conf_file=self.bitcoind.conf_file)\n', (1164, 1203), True... |
"""Implementation of sample attack."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
from scipy.misc import imread
from scipy.misc import imsave
import tensorflow as tf
tf.flags.DEFINE_string(
'master', '', 'The addres... | [
"os.path.join",
"os.path.basename",
"tensorflow.gfile.Open",
"scipy.misc.imread",
"scipy.misc.imsave",
"numpy.zeros",
"tensorflow.flags.DEFINE_integer",
"tensorflow.app.run",
"tensorflow.flags.DEFINE_float",
"tensorflow.flags.DEFINE_string"
] | [((267, 355), 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (['"""master"""', '""""""', '"""The address of the TensorFlow master to use."""'], {}), "('master', '',\n 'The address of the TensorFlow master to use.')\n", (289, 355), True, 'import tensorflow as tf\n'), ((358, 429), 'tensorflow.flags.DEFINE... |
import ssl
from urllib.parse import urlsplit
def hostname_matches(hostname, pattern):
try:
ssl.match_hostname({'subject': ((('commonName', pattern),),)}, hostname)
return True
except:
return False
def uri_matches(uri, patterns, allow_wildcard=False):
if uri in patterns:
return True
if allow_wildcard:
... | [
"ssl.match_hostname",
"urllib.parse.urlsplit"
] | [((96, 168), 'ssl.match_hostname', 'ssl.match_hostname', (["{'subject': ((('commonName', pattern),),)}", 'hostname'], {}), "({'subject': ((('commonName', pattern),),)}, hostname)\n", (114, 168), False, 'import ssl\n'), ((332, 345), 'urllib.parse.urlsplit', 'urlsplit', (['uri'], {}), '(uri)\n', (340, 345), False, 'from ... |
import hub
from sys import exit
from utime import sleep_ms, ticks_ms, ticks_diff
class TFLcam :
# Configures `port` for the TFLcam sensor
def __init__(self,port) :
# Claim port
if not port in "ABCDEF" :
raise Exception("port must be A,B,C,D,E, or F")
self.port = ev... | [
"utime.sleep_ms",
"hub.Image",
"utime.ticks_ms",
"sys.exit",
"hub.display.align"
] | [((4278, 4288), 'utime.ticks_ms', 'ticks_ms', ([], {}), '()\n', (4286, 4288), False, 'from utime import sleep_ms, ticks_ms, ticks_diff\n'), ((4512, 4519), 'sys.exit', 'exit', (['(0)'], {}), '(0)\n', (4516, 4519), False, 'from sys import exit\n'), ((458, 471), 'utime.sleep_ms', 'sleep_ms', (['(100)'], {}), '(100)\n', (4... |
"""Implementation of Rule L018."""
from typing import cast
from sqlfluff.core.parser import (
IdentitySet,
NewlineSegment,
PositionMarker,
WhitespaceSegment,
)
from sqlfluff.core.rules.base import BaseRule, LintFix, LintResult, RuleContext
from sqlfluff.core.rules.doc_decorators import (
document... | [
"sqlfluff.core.parser.NewlineSegment",
"sqlfluff.core.rules.base.LintResult",
"sqlfluff.core.rules.functional.sp.is_name",
"sqlfluff.core.parser.IdentitySet",
"sqlfluff.core.rules.base.LintFix.delete",
"sqlfluff.core.rules.functional.sp.is_type",
"sqlfluff.core.parser.WhitespaceSegment",
"typing.cast"... | [((3336, 3349), 'sqlfluff.core.parser.IdentitySet', 'IdentitySet', ([], {}), '()\n', (3347, 3349), False, 'from sqlfluff.core.parser import IdentitySet, NewlineSegment, PositionMarker, WhitespaceSegment\n'), ((2152, 2164), 'sqlfluff.core.rules.base.LintResult', 'LintResult', ([], {}), '()\n', (2162, 2164), False, 'from... |
"""
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import *
from django.db.back... | [
"django.core.exceptions.ImproperlyConfigured",
"django.db.backends.creation.BaseDatabaseCreation"
] | [((404, 476), 'django.core.exceptions.ImproperlyConfigured', 'ImproperlyConfigured', (['"""You haven\'t set the database ENGINE setting yet."""'], {}), '("You haven\'t set the database ENGINE setting yet.")\n', (424, 476), False, 'from django.core.exceptions import ImproperlyConfigured\n'), ((1270, 1296), 'django.db.ba... |
from mycv.utils.general import disable_multithreads
disable_multithreads()
import os
from pathlib import Path
import argparse
import json
import time
from tqdm import tqdm
from collections import defaultdict
import torch
import torch.cuda.amp as amp
from torch.nn.parallel import DistributedDataParallel as DDP
from myc... | [
"torch.cuda.device_count",
"torch.distributed.init_process_group",
"argparse.ArgumentParser",
"torch.save",
"mycv.utils.torch_utils.de_parallel",
"pathlib.Path",
"torch.cuda.amp.autocast",
"os.path.exists",
"mycv.utils.general.ANSI.headerstr",
"torch.distributed.destroy_process_group",
"mycv.uti... | [((52, 74), 'mycv.utils.general.disable_multithreads', 'disable_multithreads', ([], {}), '()\n', (72, 74), False, 'from mycv.utils.general import disable_multithreads\n'), ((637, 662), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (660, 662), False, 'import argparse\n'), ((10189, 10220), 'torc... |
import os
import shutil
import pathlib
# Class to recreate file system changes on client here on server side
class DropBoxService:
def __init__(self, dir_loc : pathlib.Path) -> None:
self._dir_loc = dir_loc
def create_directory(self, new_dir : str):
new_dir = os.path.join(self._dir_lo... | [
"os.path.join",
"pathlib.Path",
"os.remove",
"os.path.exists",
"shutil.rmtree",
"shutil.move",
"os.makedirs"
] | [((295, 331), 'os.path.join', 'os.path.join', (['self._dir_loc', 'new_dir'], {}), '(self._dir_loc, new_dir)\n', (307, 331), False, 'import os\n'), ((479, 516), 'os.path.join', 'os.path.join', (['self._dir_loc', 'new_path'], {}), '(self._dir_loc, new_path)\n', (491, 516), False, 'import os\n'), ((759, 792), 'os.path.joi... |
from twisted.trial.unittest import TestCase
from txaws.server.call import Call
class CallTestCase(TestCase):
def test_default_version(self):
"""
If no version is explicitly requested, C{version} is set to
2009-11-30, which is the earliest version we support.
"""
call = Ca... | [
"txaws.server.call.Call"
] | [((318, 324), 'txaws.server.call.Call', 'Call', ([], {}), '()\n', (322, 324), False, 'from txaws.server.call import Call\n')] |
#!/usr/bin/env python
"""
@package npt
Runs a simulation to compute condensed phase properties (for example, the density
or the enthalpy of vaporization) and compute the derivative with respect
to changing the force field parameters. This script is a part of ForceBalance.
All code in this repository is released u... | [
"forcebalance.nifty.lp_dump",
"forcebalance.forcefield.FF.print_map",
"argparse.ArgumentParser",
"builtins.range",
"numpy.sum",
"numpy.zeros",
"numpy.log",
"numpy.ones",
"forcebalance.finite_difference.fdwrap",
"forcebalance.output.getLogger",
"os.path.splitext",
"numpy.sqrt",
"forcebalance.... | [((1116, 1135), 'forcebalance.output.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1125, 1135), False, 'from forcebalance.output import getLogger\n'), ((1324, 1349), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1347, 1349), False, 'import argparse\n'), ((3891, 3904), 'collect... |
import ast
from typing import Tuple
import pytest
from flake8_cls_attr_order.plugin import CL100, CL200, ClassAttrOrder
pytestmark = pytest.mark.unit
_FOO = 'Foo'
def _plugin_results(py_content: str) -> Tuple[str, ...]:
plugin = ClassAttrOrder(ast.parse(py_content))
return tuple(
f'{line}:{column ... | [
"ast.parse",
"flake8_cls_attr_order.plugin.CL200.format"
] | [((254, 275), 'ast.parse', 'ast.parse', (['py_content'], {}), '(py_content)\n', (263, 275), False, 'import ast\n'), ((1043, 1082), 'flake8_cls_attr_order.plugin.CL200.format', 'CL200.format', ([], {'name': '_FOO', 'sv': '"""ABRA, BAR"""'}), "(name=_FOO, sv='ABRA, BAR')\n", (1055, 1082), False, 'from flake8_cls_attr_ord... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.InsProduct import InsProduct
from alipay.aop.api.domain.InsProduct import InsProduct
class AlipayInsAutoAutoinsprodQuoteApplyModel(object):
def __init__(self):
self._... | [
"alipay.aop.api.domain.InsProduct.InsProduct.from_alipay_dict"
] | [((901, 935), 'alipay.aop.api.domain.InsProduct.InsProduct.from_alipay_dict', 'InsProduct.from_alipay_dict', (['value'], {}), '(value)\n', (928, 935), False, 'from alipay.aop.api.domain.InsProduct import InsProduct\n'), ((2332, 2366), 'alipay.aop.api.domain.InsProduct.InsProduct.from_alipay_dict', 'InsProduct.from_alip... |
"""Example rq worker to handle /panorama chat commands with 1 subcommand addition."""
import logging
import os
import re
from ipaddress import ip_network
from typing import List, Tuple, Union
from netmiko import NetMikoTimeoutException
from netutils.protocol_mapper import PROTO_NAME_TO_NUM
from django_rq import job
f... | [
"nautobot.dcim.models.Interface.objects.filter",
"logging.getLogger",
"nautobot_plugin_chatops_panorama.utils.panorama.connect_panorama",
"re.findall",
"nautobot_chatops.workers.handle_subcommands",
"nautobot_plugin_chatops_panorama.utils.panorama.get_rule_match",
"nautobot_chatops.workers.subcommand_of... | [((861, 891), 'logging.getLogger', 'logging.getLogger', (['"""rq.worker"""'], {}), "('rq.worker')\n", (878, 891), False, 'import logging\n'), ((3718, 3732), 'django_rq.job', 'job', (['"""default"""'], {}), "('default')\n", (3721, 3732), False, 'from django_rq import job\n'), ((3884, 3909), 'nautobot_chatops.workers.sub... |
import os
import sys
import re
import time
def binary_search():
test_arr = [12, 15, 18, 22, 24, 27, 31, 35, 38, 40, 43, 46, 49, 54, 57, 61]
os.system('cls' if os.name=='nt' else 'clear')
print('┌───────────────────────────────────┐')
print('│ 4. Binary Search Algorithm │')
print('└─────────────────────────... | [
"re.match",
"time.sleep",
"os.system"
] | [((143, 191), 'os.system', 'os.system', (["('cls' if os.name == 'nt' else 'clear')"], {}), "('cls' if os.name == 'nt' else 'clear')\n", (152, 191), False, 'import os\n'), ((639, 668), 're.match', 're.match', (['"""[IiRr]"""', 'user_pick'], {}), "('[IiRr]', user_pick)\n", (647, 668), False, 'import re\n'), ((1235, 1248)... |
from datetime import date, datetime
from functools import reduce
from typing import Any, Union
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
import polars as pl
from polars import testing
from polars.datatypes import Float64, Int32, Int64, UInt32, UInt64
def _getattr_multi(obj: object, o... | [
"numpy.power",
"polars.repeat",
"polars.concat",
"polars.testing.assert_series_equal",
"datetime.datetime",
"pyarrow.array",
"polars.concat_list",
"numpy.sqrt",
"polars.element",
"polars.col",
"numpy.array",
"polars.arange",
"numpy.multiply",
"pytest.raises",
"pandas.Series",
"datetime... | [((14494, 14544), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""key"""', '[True, False, 1.0]'], {}), "('key', [True, False, 1.0])\n", (14517, 14544), False, 'import pytest\n'), ((15264, 15340), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dtype"""', '[np.int32, np.int64, np.uint32, np.uint6... |
from itertools import groupby
from pydoc import describe
import streamlit as st
import pandas as pd
import altair as alt
from vega_datasets import data
st.set_page_config(layout="wide")
from iso3166 import Country
from IPython.display import display, HTML
alt.data_transformers.enable('default', max_rows = None)
alt.da... | [
"altair.binding_select",
"streamlit.image",
"altair.Color",
"altair.layer",
"altair.Tooltip",
"altair.data_transformers.enable",
"streamlit.altair_chart",
"altair.LookupData",
"pandas.read_csv",
"altair.data_transformers.disable_max_rows",
"IPython.display.HTML",
"altair.Legend",
"streamlit.... | [((152, 185), 'streamlit.set_page_config', 'st.set_page_config', ([], {'layout': '"""wide"""'}), "(layout='wide')\n", (170, 185), True, 'import streamlit as st\n'), ((256, 310), 'altair.data_transformers.enable', 'alt.data_transformers.enable', (['"""default"""'], {'max_rows': 'None'}), "('default', max_rows=None)\n", ... |
import urllib.request
import json
import io
from PIL import Image
from google.cloud import storage
from google.appengine.api import images
def get_random_quote() -> str:
url: str = 'https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?'
try:
req = urllib.request.Request(url,... | [
"io.BytesIO",
"google.cloud.storage.Client",
"json.loads"
] | [((1576, 1592), 'google.cloud.storage.Client', 'storage.Client', ([], {}), '()\n', (1590, 1592), False, 'from google.cloud import storage\n'), ((1751, 1772), 'io.BytesIO', 'io.BytesIO', (['raw_image'], {}), '(raw_image)\n', (1761, 1772), False, 'import io\n'), ((503, 519), 'json.loads', 'json.loads', (['text'], {}), '(... |
#
# 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... | [
"ai_flow.get_ai_flow_client",
"ai_flow.job_config",
"ai_flow.current_workflow_config",
"os.mkdir",
"ai_flow.workflow_operation.start_new_workflow_execution",
"os.path.exists",
"ai_flow.workflow_operation.submit_workflow",
"ai_flow.get_dataset_by_name",
"ai_flow.init_ai_flow_context",
"time.sleep"
... | [((1895, 1920), 'ai_flow.init_ai_flow_context', 'af.init_ai_flow_context', ([], {}), '()\n', (1918, 1920), True, 'import ai_flow as af\n'), ((2249, 2301), 'ai_flow.workflow_operation.submit_workflow', 'af.workflow_operation.submit_workflow', (['workflow_name'], {}), '(workflow_name)\n', (2286, 2301), True, 'import ai_f... |
import os
from time import time
import numpy as np
from numpy.random import default_rng
import matplotlib.pyplot as plt
from utility.pickle_io import pickle_export, pickle_import
from problem_data_gen import setup_rand_system
from experiment import experiment
from plotting import relative_plot
def load_and_plot(ti... | [
"os.path.join",
"experiment.experiment",
"plotting.relative_plot",
"problem_data_gen.setup_rand_system",
"matplotlib.pyplot.subplots",
"numpy.random.default_rng",
"matplotlib.pyplot.close",
"utility.pickle_io.pickle_import",
"utility.pickle_io.pickle_export",
"numpy.array",
"time.time"
] | [((433, 477), 'os.path.join', 'os.path.join', (['experiment_folder', 'filename_in'], {}), '(experiment_folder, filename_in)\n', (445, 477), False, 'import os\n'), ((492, 514), 'utility.pickle_io.pickle_import', 'pickle_import', (['path_in'], {}), '(path_in)\n', (505, 514), False, 'from utility.pickle_io import pickle_e... |
# flake8: noqa: F841
#
# 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
# "L... | [
"os.path.join",
"apache_beam.pipeline.PipelineOptions",
"apache_beam.Map",
"json.loads",
"argparse.ArgumentParser",
"json.dumps",
"base64.b64decode"
] | [((4852, 4877), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4875, 4877), False, 'import argparse\n'), ((4022, 4035), 'json.dumps', 'json.dumps', (['x'], {}), '(x)\n', (4032, 4035), False, 'import json\n'), ((4117, 4130), 'json.loads', 'json.loads', (['x'], {}), '(x)\n', (4127, 4130), False,... |
from rest_framework import serializers
from .models import Keyword, RescueRequest, Cluster, FirstResponders
class KeywordSerializer(serializers.ModelSerializer):
class Meta:
model = Keyword
fields = ('id', 'name', 'type', 'longitude', 'latitude', "city", "state")
class ClusterSerializer(serializ... | [
"rest_framework.serializers.PrimaryKeyRelatedField"
] | [((364, 425), 'rest_framework.serializers.PrimaryKeyRelatedField', 'serializers.PrimaryKeyRelatedField', ([], {'many': '(True)', 'read_only': '(True)'}), '(many=True, read_only=True)\n', (398, 425), False, 'from rest_framework import serializers\n')] |
#!/usr/bin/env python
"""
Script to create html version of the notebook for a give pseudo for the pseudo-dojo.org website.
"""
import sys
from pseudo_dojo.util.notebook import write_notebook_html
def main():
pspath = sys.argv[1].replace('.in', '.psp8')
write_notebook_html(pspath, tmpfile=False, mock=False)
... | [
"pseudo_dojo.util.notebook.write_notebook_html"
] | [((264, 318), 'pseudo_dojo.util.notebook.write_notebook_html', 'write_notebook_html', (['pspath'], {'tmpfile': '(False)', 'mock': '(False)'}), '(pspath, tmpfile=False, mock=False)\n', (283, 318), False, 'from pseudo_dojo.util.notebook import write_notebook_html\n')] |
# -*- coding: utf-8 -*-
"""
Created on Fri May 14 21:41:24 2021
@author: rringuet
routines to output satellite flythrough time series into various file formats
Oct 12, 2021: adding coordinate system to metadata of each file (in and out)
"""
import numpy as np
def SFcdf_reader(filename):
'''Loads the ... | [
"numpy.array",
"csv.reader",
"netCDF4.Dataset"
] | [((469, 491), 'netCDF4.Dataset', 'Dataset', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (476, 491), False, 'from netCDF4 import Dataset\n'), ((1273, 1321), 'netCDF4.Dataset', 'Dataset', (["(filename + '.nc')", '"""w"""'], {'format': '"""NETCDF4"""'}), "(filename + '.nc', 'w', format='NETCDF4')\n", (1280, 1321),... |
#----------------------------------------------------------------------
# Libraries
import colorama
#----------------------------------------------------------------------
# Colorama
colorama.init()
# Class
class Error(Exception):
def __init__(self, message = ''):
super().__init__... | [
"colorama.init"
] | [((200, 215), 'colorama.init', 'colorama.init', ([], {}), '()\n', (213, 215), False, 'import colorama\n')] |
import numpy as np
import gym
def makeFilteredEnv(env):
""" crate a new environment class with actions and states normalized to [-1,1] """
acsp = env.action_space
obsp = env.observation_space
if not type(acsp)==gym.spaces.box.Box:
raise RuntimeError('Environment with continous action space (i.e... | [
"numpy.zeros_like",
"numpy.any",
"numpy.ones_like",
"numpy.all"
] | [((683, 716), 'numpy.any', 'np.any', (['(obsp.high < 10000000000.0)'], {}), '(obsp.high < 10000000000.0)\n', (689, 716), True, 'import numpy as np\n'), ((910, 934), 'numpy.zeros_like', 'np.zeros_like', (['obsp.high'], {}), '(obsp.high)\n', (923, 934), True, 'import numpy as np\n'), ((963, 986), 'numpy.ones_like', 'np.o... |
import guppy.v1 as gp
def main():
task_configs = [
(("cuda_10_0", "target-ubuntu_16_04.cached"), (("require_cuda", "10.0"), ("require_distro", "ubuntu 16.04"))),
(("cuda_9_2", "target-ubuntu_16_04.cached"), (("require_cuda", "9.2"), ("require_distro", "ubuntu 16.04"))),
(("cuda_9_1", "target-ubu... | [
"guppy.v1.run",
"guppy.v1.out"
] | [((1002, 1010), 'guppy.v1.run', 'gp.run', ([], {}), '()\n', (1008, 1010), True, 'import guppy.v1 as gp\n'), ((1545, 1556), 'guppy.v1.out', 'gp.out', (['run'], {}), '(run)\n', (1551, 1556), True, 'import guppy.v1 as gp\n')] |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: <NAME>(<EMAIL>)
import argparse
import os
import numpy as np
from lib.utils.helpers.image_helper import ImageHelper
from lib.utils.tools.logger import Logger as Log
from lib.utils.tools.configer import Configer
from lib.metrics.running_score import RunningScore... | [
"os.path.join",
"os.listdir",
"argparse.ArgumentParser",
"lib.utils.tools.configer.Configer",
"lib.utils.helpers.image_helper.ImageHelper.read_image",
"lib.metrics.running_score.RunningScore"
] | [((1428, 1453), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1451, 1453), False, 'import argparse\n'), ((454, 476), 'lib.metrics.running_score.RunningScore', 'RunningScore', (['configer'], {}), '(configer)\n', (466, 476), False, 'from lib.metrics.running_score import RunningScore\n'), ((646,... |
import setuptools
setuptools.setup(
name="mcsim",
version="0.0.1",
author="<NAME>, <NAME>",
author_email="<EMAIL>",
description="A package for running a Monte Carlo simulation",
long_description="A Python package which performs MC simulation",
long_description_content_type="text/markdown",
... | [
"setuptools.find_packages"
] | [((577, 612), 'setuptools.find_packages', 'setuptools.find_packages', ([], {'where': '"""."""'}), "(where='.')\n", (601, 612), False, 'import setuptools\n')] |
from board.models import Cost, Ticket
from django import forms
class CostForm(forms.ModelForm):
class Meta:
model = Cost
class SearchTimeBookingForm(forms.Form):
developer = forms.ChoiceField(required=False)
type = forms.ChoiceField(required=False)
start = forms.DateField()
end = forms.Dat... | [
"django.forms.ChoiceField",
"django.forms.DateField"
] | [((192, 225), 'django.forms.ChoiceField', 'forms.ChoiceField', ([], {'required': '(False)'}), '(required=False)\n', (209, 225), False, 'from django import forms\n'), ((237, 270), 'django.forms.ChoiceField', 'forms.ChoiceField', ([], {'required': '(False)'}), '(required=False)\n', (254, 270), False, 'from django import ... |
import sys
from pathlib import Path
import shutil
import timeit
import pickle
from copy import deepcopy
import math
from datetime import datetime
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import tensorflow as tf
from tensorflow.keras.optimizers import Adam
util_dir = Path.cwd().pare... | [
"pathlib.Path.cwd",
"datetime.datetime.now",
"DataGenerator.DataGeneratorV2",
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.keras.optimizers.Adam",
"Architectures.Img2VecV4",
"tensorflow.keras.callbacks.EarlyStopping",
"tensorflow.keras.optimizers.schedules.ExponentialDecay"
] | [((626, 702), 'DataGenerator.DataGeneratorV2', 'DataGeneratorV2', (['C.X_train_dir', 'C.Y1_train_dir', 'C.Y2_train_dir'], {'batch_size': '(1)'}), '(C.X_train_dir, C.Y1_train_dir, C.Y2_train_dir, batch_size=1)\n', (641, 702), False, 'from DataGenerator import DataGeneratorV2\n'), ((723, 793), 'DataGenerator.DataGenerato... |
__author__ = 'amguerrero'
from main.LambdaHandler import LambdaHandler
def handler(event, context):
hdl = LambdaHandler()
return hdl.handle(event, context) | [
"main.LambdaHandler.LambdaHandler"
] | [((111, 126), 'main.LambdaHandler.LambdaHandler', 'LambdaHandler', ([], {}), '()\n', (124, 126), False, 'from main.LambdaHandler import LambdaHandler\n')] |
from pathlib import Path
import locale
DATAHOME: str = (Path.home() / ".local" / "share" / "driversdict").as_posix()
DICTIONARY: str = (Path(DATAHOME) / "dictionary.txt").as_posix()
DATABASE: str = (Path(DATAHOME) / "driversdict.sqlite").as_posix()
SHELL_ENCODING = None
def shell_encoding():
global SHELL_ENCODING... | [
"pathlib.Path.home",
"locale.getdefaultlocale",
"pathlib.Path"
] | [((137, 151), 'pathlib.Path', 'Path', (['DATAHOME'], {}), '(DATAHOME)\n', (141, 151), False, 'from pathlib import Path\n'), ((200, 214), 'pathlib.Path', 'Path', (['DATAHOME'], {}), '(DATAHOME)\n', (204, 214), False, 'from pathlib import Path\n'), ((377, 402), 'locale.getdefaultlocale', 'locale.getdefaultlocale', ([], {... |
# Generated by Django 2.2.13 on 2020-09-08 14:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pipeline', '0079_auto_20200908_0345'),
]
operations = [
migrations.CreateModel(
name='Airport'... | [
"django.db.models.CharField",
"django.db.models.OneToOneField"
] | [((376, 547), 'django.db.models.OneToOneField', 'models.OneToOneField', ([], {'auto_created': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'parent_link': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'to': '"""pipeline.Location"""'}), "(auto_created=True, on_delete=django.db.models.deletion\... |
from photons_app.mimic.operator import register, IO
from photons_app.errors import PhotonsAppError
from photons_app.mimic.event import Events
from photons_app.mimic.attrs import Attrs
from photons_app import helpers as hp
import logging
import asyncio
class ExpectedMessages(PhotonsAppError):
desc = "Expected the... | [
"photons_app.mimic.attrs.Attrs",
"photons_app.helpers.TaskHolder"
] | [((751, 848), 'photons_app.helpers.TaskHolder', 'hp.TaskHolder', (['self.final_future'], {'name': 'f"""DeviceSession({self.device.serial})::start[parent]"""'}), "(self.final_future, name=\n f'DeviceSession({self.device.serial})::start[parent]')\n", (764, 848), True, 'from photons_app import helpers as hp\n'), ((3308... |
import os
import pytest
from unittest import mock
from constellation.config import *
sample_data = {"a": "value1", "b": {"x": "value2"}, "c": 1, "d": True,
"e": None, "f": "$EXAMPLE_ENV_VAR"}
def test_config_string_reads_simple_values():
assert config_string(sample_data, "a") == "value1"
ass... | [
"pytest.raises",
"unittest.mock.patch.dict"
] | [((540, 563), 'pytest.raises', 'pytest.raises', (['KeyError'], {}), '(KeyError)\n', (553, 563), False, 'import pytest\n'), ((614, 637), 'pytest.raises', 'pytest.raises', (['KeyError'], {}), '(KeyError)\n', (627, 637), False, 'import pytest\n'), ((732, 755), 'pytest.raises', 'pytest.raises', (['KeyError'], {}), '(KeyErr... |
import matplotlib.pyplot as plt
import numpy as np
def linear_function(x, coeff, displ):
return coeff * x + displ
def power_function(x, exp, coeff, displ):
return coeff * x ** exp + displ
def gamma_precipitation(temperature):
params = [129811, -145706, 53297, -6270.4]
polynomial: float = 0
ord... | [
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.subplots",
"numpy.linspace",
"matplotlib.pyplot.show"
] | [((1156, 1194), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 14}"], {}), "({'font.size': 14})\n", (1175, 1194), True, 'import matplotlib.pyplot as plt\n'), ((1218, 1232), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1230, 1232), True, 'import matplotlib.pyplot as plt\... |
import random
from discord.ext import commands
from discord.ext.commands import Cog
class Dice(Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='roll_dice')
async def roll(self, ctx, number_of_dice: int, number_of_sides: int):
"""Simulates rolling a dice."""
... | [
"discord.ext.commands.command"
] | [((163, 197), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""roll_dice"""'}), "(name='roll_dice')\n", (179, 197), False, 'from discord.ext import commands\n')] |
import logging
import time
from abc import ABC
from abc import abstractmethod
from pathlib import Path
import gpxpy
from gpxpy.geo import distance
import gpxpy.gpx
from gpx_split.distance import GeoCalc
from gpx_split.log_factory import LogFactory
class Splitter(ABC):
# for Meter in Kilometer.
KILO = 1000
... | [
"pathlib.Path",
"gpxpy.gpx.GPXTrackSegment",
"gpx_split.distance.GeoCalc.points",
"gpx_split.distance.GeoCalc.track_length",
"time.time",
"gpxpy.parse",
"gpx_split.log_factory.LogFactory.create"
] | [((482, 509), 'gpx_split.log_factory.LogFactory.create', 'LogFactory.create', (['__name__'], {}), '(__name__)\n', (499, 509), False, 'from gpx_split.log_factory import LogFactory\n'), ((1297, 1324), 'gpxpy.gpx.GPXTrackSegment', 'gpxpy.gpx.GPXTrackSegment', ([], {}), '()\n', (1322, 1324), False, 'import gpxpy\n'), ((905... |
import os
import sys
import numpy as np
import tensorflow as tf
import tensors_saver
WEIGHTS_PATH = sys.argv[1]
tensors_saver.set_out_path(sys.argv[2])
BATCH = 64
x = np.random.randn(BATCH, 64, 64, 3).astype(np.float32)
w = np.random.randn(5, 5, 3, 64).astype(np.float32)
y = np.random.randn(BATCH, 32, 32, 64).astyp... | [
"tensorflow.Variable",
"tensorflow.global_variables_initializer",
"tensors_saver.add",
"tensorflow.gradients",
"tensorflow.Session",
"tensorflow.losses.mean_squared_error",
"tensors_saver.Saver",
"numpy.random.randn",
"tensorflow.nn.conv2d",
"tensors_saver.set_out_path"
] | [((114, 153), 'tensors_saver.set_out_path', 'tensors_saver.set_out_path', (['sys.argv[2]'], {}), '(sys.argv[2])\n', (140, 153), False, 'import tensors_saver\n'), ((344, 358), 'tensorflow.Variable', 'tf.Variable', (['x'], {}), '(x)\n', (355, 358), True, 'import tensorflow as tf\n'), ((368, 382), 'tensorflow.Variable', '... |
import numpy as np, copy, json, os
from numpy import sqrt, dot, cross
from numpy.linalg import norm
from itertools import combinations
from modules import functions as f
np.set_printoptions(suppress=True)
BQi = lambda x: [[x, 0, 0], [0, x, 0], [0, 0, x], [-x, 0, 0], [0, -x, 0], [0, 0, -x]]
sst_dict = {0: 'H', 1: 'E',... | [
"copy.deepcopy",
"numpy.set_printoptions",
"modules.functions.distance",
"os.getcwd",
"modules.functions.rotate_dihedral",
"modules.functions.kabsch",
"numpy.cross",
"numpy.flipud",
"numpy.argsort",
"numpy.linalg.norm",
"modules.functions.dist_matrix2coords",
"numpy.vstack",
"modules.functio... | [((171, 205), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (190, 205), True, 'import numpy as np, copy, json, os\n'), ((453, 474), 'numpy.cross', 'np.cross', (['bq[1]', 'norm'], {}), '(bq[1], norm)\n', (461, 474), True, 'import numpy as np, copy, json, os\n'), ((14... |
import numpy as np
import pdb
from ..blockmarker import trunc_bm
from .btensor import BTensor
from .tensor import _same_diff_labels, Tensor
__all__ = ['is_zero_flux', 'clip_nonzero_flux', 'zero_flux_blocks', 'nonzero_flux_blocks', 'btdot']
def is_zero_flux(ts, signs, bmg):
'''
a tensor is zero flux or not.
... | [
"numpy.meshgrid",
"numpy.all",
"numpy.find_common_type"
] | [((835, 855), 'numpy.all', 'np.all', (['(cbm.qns == 0)'], {}), '(cbm.qns == 0)\n', (841, 855), True, 'import numpy as np\n'), ((2022, 2082), 'numpy.meshgrid', 'np.meshgrid', (['*[qns[:, k] for qns in qns_list]'], {'indexing': '"""ij"""'}), "(*[qns[:, k] for qns in qns_list], indexing='ij')\n", (2033, 2082), True, 'impo... |
from __future__ import division
import numpy as np
import glob, os, json, pickle
import matplotlib.pyplot as plt
import scipy.linalg as sl
import libstempo as libs
import libstempo.plot as libsplt
import enterprise
from enterprise.pulsar import Pulsar
from enterprise.signals import parameter
from enterprise.signals i... | [
"os.mkdir",
"enterprise.signals.gp_signals.TimingModel",
"os.path.exists",
"numpy.ones",
"enterprise.pulsar.Pulsar",
"enterprise.signals.white_signals.EquadNoise",
"enterprise.signals.white_signals.MeasurementNoise",
"glob.glob",
"os.getcwd",
"numpy.min",
"enterprise.signals.gp_signals.FourierBa... | [((692, 703), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (701, 703), False, 'import glob, os, json, pickle\n'), ((3510, 3537), 'enterprise.signals.parameter.Uniform', 'parameter.Uniform', (['(0.5)', '(4.0)'], {}), '(0.5, 4.0)\n', (3527, 3537), False, 'from enterprise.signals import parameter\n'), ((3551, 3577), 'enter... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Melisa,Morgane
"""
#%% Importation and parameters
from Steps.run_steps import run_steps
import psutil
import caiman as cm
print('Choose the mouse, session, how many trial you want to analyse')
mouse_number = int(input("mouse number : "))
sessions = input("... | [
"psutil.cpu_count",
"Steps.run_steps.run_steps",
"caiman.cluster.setup_cluster"
] | [((922, 940), 'psutil.cpu_count', 'psutil.cpu_count', ([], {}), '()\n', (938, 940), False, 'import psutil\n'), ((965, 1056), 'caiman.cluster.setup_cluster', 'cm.cluster.setup_cluster', ([], {'backend': '"""local"""', 'n_processes': 'n_processes', 'single_thread': '(False)'}), "(backend='local', n_processes=n_processes,... |
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get("https://www.soccerstand.com/team/amiens-sc/lKkBAsxF/results/")
element=driver.find_element_by_class_name('padr')
location=element.location
size=element.location
#print(location)
time.sleep(3)
action = webdriver.common.action_chains.Actio... | [
"selenium.webdriver.common.action_chains.ActionChains",
"time.sleep",
"selenium.webdriver.Chrome"
] | [((52, 70), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {}), '()\n', (68, 70), False, 'from selenium import webdriver\n'), ((261, 274), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (271, 274), False, 'import time\n'), ((284, 335), 'selenium.webdriver.common.action_chains.ActionChains', 'webdriver.commo... |
# coding=utf-8
#
# ROSREPO
# Manage ROS workspaces with multiple Gitlab repositories
#
# Author: <NAME>
#
# Copyright 2016 <NAME>
#
# 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:... | [
"os.path.join",
"sys.stdout.write",
"fnmatch.fnmatch",
"os.path.split"
] | [((5864, 5886), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('\\n')\n", (5880, 5886), False, 'import sys\n'), ((1993, 2039), 'os.path.join', 'os.path.join', (['wsdir', '"""build"""', 'name', '"""Makefile"""'], {}), "(wsdir, 'build', name, 'Makefile')\n", (2005, 2039), False, 'import os\n'), ((2419, 244... |
'''
@author: xusheng
'''
import xlrd
import xlwt
from six.moves import xrange
class Service(object):
@ property
def partner_id(self):
return self._partner_id
@ partner_id.setter
def partner_id(self, value):
self._partner_id = value
@ property
def par... | [
"six.moves.xrange",
"xlrd.open_workbook",
"xlwt.Workbook"
] | [((2398, 2411), 'six.moves.xrange', 'xrange', (['nrows'], {}), '(nrows)\n', (2404, 2411), False, 'from six.moves import xrange\n'), ((4176, 4207), 'xlrd.open_workbook', 'xlrd.open_workbook', (['"""ETCP.xlsx"""'], {}), "('ETCP.xlsx')\n", (4194, 4207), False, 'import xlrd\n'), ((4448, 4479), 'xlwt.Workbook', 'xlwt.Workbo... |
import sys
from pathlib import Path
from typing import Optional
import autograde
from autograde.backend.base import Backend
from autograde.backend.local.audit import cmd_audit
from autograde.backend.local.patch import cmd_patch
from autograde.backend.local.report import cmd_report
from autograde.backend.local.summary ... | [
"autograde.backend.local.report.cmd_report",
"autograde.backend.local.summary.cmd_summary",
"sys.getdefaultencoding",
"autograde.backend.local.test.cmd_tset",
"autograde.backend.local.patch.cmd_patch",
"sys.version.split",
"autograde.backend.local.audit.cmd_audit"
] | [((565, 594), 'autograde.backend.local.audit.cmd_audit', 'cmd_audit', (['result', 'bind', 'port'], {}), '(result, bind, port)\n', (574, 594), False, 'from autograde.backend.local.audit import cmd_audit\n'), ((828, 852), 'autograde.backend.local.patch.cmd_patch', 'cmd_patch', (['result', 'patch'], {}), '(result, patch)\... |
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from app.core import config
engine = create_engine(
config.SQLALCHEMY_DATABASE_URI,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative... | [
"sqlalchemy.create_engine",
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.orm.sessionmaker"
] | [((172, 217), 'sqlalchemy.create_engine', 'create_engine', (['config.SQLALCHEMY_DATABASE_URI'], {}), '(config.SQLALCHEMY_DATABASE_URI)\n', (185, 217), False, 'from sqlalchemy import create_engine\n'), ((240, 300), 'sqlalchemy.orm.sessionmaker', 'sessionmaker', ([], {'autocommit': '(False)', 'autoflush': '(False)', 'bin... |
#
# 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 us... | [
"apache_beam.testing.pipeline_verifiers.PipelineStateMatcher",
"logging.getLogger",
"nose.plugins.attrib.attr",
"unittest.main",
"hamcrest.core.core.allof.all_of",
"apache_beam.testing.pipeline_verifiers.FileChecksumMatcher",
"time.time",
"apache_beam.testing.test_pipeline.TestPipeline"
] | [((1668, 1678), 'nose.plugins.attrib.attr', 'attr', (['"""IT"""'], {}), "('IT')\n", (1672, 1678), False, 'from nose.plugins.attrib import attr\n'), ((1756, 1788), 'nose.plugins.attrib.attr', 'attr', (['"""IT"""', '"""ValidatesContainer"""'], {}), "('IT', 'ValidatesContainer')\n", (1760, 1788), False, 'from nose.plugins... |
import os
import gc
import sys
import pickle
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold, cross_val_predict
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import OrthogonalMatchingPursuit, BayesianRidge, ElasticNet, OrthogonalMatchingPursuitCV, HuberRegr... | [
"numpy.load",
"sklearn.svm.NuSVR",
"os.path.exists",
"sklearn.neural_network.MLPRegressor",
"pandas.read_csv",
"sklearn.linear_model.OrthogonalMatchingPursuitCV",
"pandas.DataFrame",
"os.makedirs",
"utils.scale_select_data",
"rgf.sklearn.RGFRegressor",
"gc.collect",
"utils.read_pickle",
"tre... | [((990, 1035), 'utils.read_pickle', 'read_pickle', (['"""./data/biases/ic_biases.pickle"""'], {}), "('./data/biases/ic_biases.pickle')\n", (1001, 1035), False, 'from utils import scale_select_data, save_pickle, read_pickle\n'), ((1055, 1105), 'utils.read_pickle', 'read_pickle', (['"""./data/biases/ic_biases_site.pickle... |
"""Constants for the MYPV piko integration."""
from datetime import timedelta
from homeassistant.const import (
POWER_WATT,
VOLT,
ELECTRICAL_CURRENT_AMPERE,
FREQUENCY_HERTZ,
TEMP_CELSIUS,
)
DOMAIN = "mypv"
DATA_COORDINATOR = "corrdinator"
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=10)
SENSOR_... | [
"datetime.timedelta"
] | [((290, 311), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(10)'}), '(seconds=10)\n', (299, 311), False, 'from datetime import timedelta\n')] |
import utils
from nagisa.tagger import Tagger
version = '0.1.0'
# Initialize instance
tagger = Tagger()
# Functions
wakati = tagger.wakati
tagging = tagger.tagging
filter = tagger.filter
extract = tagger.extract
| [
"nagisa.tagger.Tagger"
] | [((97, 105), 'nagisa.tagger.Tagger', 'Tagger', ([], {}), '()\n', (103, 105), False, 'from nagisa.tagger import Tagger\n')] |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | [
"datetime.datetime.now"
] | [((7567, 7611), 'datetime.datetime.now', 'datetime.datetime.now', (['datetime.timezone.utc'], {}), '(datetime.timezone.utc)\n', (7588, 7611), False, 'import datetime\n')] |
import time
import sys
import os
from collections import OrderedDict
from functools import wraps
from ..utils.common import get_current_user, list_intersect, is_sub_list, user_input, list_difference, parse_ports_from_profiles
from ..utils import parsing_opts, text_tables
from ..utils.text_opts import format_text, form... | [
"sys.stdout.write",
"os.path.getsize",
"collections.OrderedDict",
"os.path.exists",
"time.time",
"time.sleep"
] | [((47278, 47308), 'os.path.getsize', 'os.path.getsize', (['pcap_filename'], {}), '(pcap_filename)\n', (47293, 47308), False, 'import os\n'), ((65781, 65794), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (65792, 65794), False, 'from collections import OrderedDict\n'), ((66100, 66113), 'collections.Ordered... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.EnterpriseOpenRuleRecordInfo import EnterpriseOpenRuleRecordInfo
from alipay.aop.api.domain.EnterpriseOpenRuleRelationInfo import EnterpriseOpenRuleRelationInfo
class EnterpriseOp... | [
"alipay.aop.api.domain.EnterpriseOpenRuleRecordInfo.EnterpriseOpenRuleRecordInfo.from_alipay_dict",
"alipay.aop.api.domain.EnterpriseOpenRuleRelationInfo.EnterpriseOpenRuleRelationInfo.from_alipay_dict"
] | [((1288, 1336), 'alipay.aop.api.domain.EnterpriseOpenRuleRecordInfo.EnterpriseOpenRuleRecordInfo.from_alipay_dict', 'EnterpriseOpenRuleRecordInfo.from_alipay_dict', (['i'], {}), '(i)\n', (1333, 1336), False, 'from alipay.aop.api.domain.EnterpriseOpenRuleRecordInfo import EnterpriseOpenRuleRecordInfo\n'), ((1951, 2001),... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import collections
import uuid
import time
import random
import json
from typing import List, Tuple, Dict, Optional, Any, Union
from booltest import common, misc
job_tpl_hdr = '''#!/bin/bash
export BOOLDIR="/storage/brno3-cerit/home/${LOGNAME}/booltest/assets"
... | [
"os.path.join",
"random.shuffle",
"collections.OrderedDict",
"uuid.uuid4",
"time.time",
"booltest.common.json_dump"
] | [((2988, 2999), 'time.time', 'time.time', ([], {}), '()\n', (2997, 2999), False, 'import time\n'), ((5035, 5093), 'os.path.join', 'os.path.join', (['self.job_dir', "('job-' + unit.res_file + '.sh')"], {}), "(self.job_dir, 'job-' + unit.res_file + '.sh')\n", (5047, 5093), False, 'import os\n'), ((8737, 8837), 'os.path.j... |
#! /usr/bin/env python
# Copyright 2019 <NAME>
# Licensed under the MIT License
"""Postprocess the GeoJSON files emitted by `ligo-skymap-contour` to tidy them
up for use on the web.
NOTE: when we start getting LIGO events this code might need to be folded into
the running web app.
"""
# note: Python 2.x compat not ... | [
"json.dump",
"numpy.linspace",
"scipy.interpolate.splrep",
"numpy.array",
"json.load",
"numpy.maximum",
"numpy.median",
"scipy.interpolate.splev",
"numpy.hypot",
"numpy.empty",
"numpy.hamming"
] | [((2758, 2798), 'numpy.hypot', 'np.hypot', (['(x[1:] - x[:-1])', '(y[1:] - y[:-1])'], {}), '(x[1:] - x[:-1], y[1:] - y[:-1])\n', (2766, 2798), True, 'import numpy as np\n'), ((2813, 2826), 'numpy.median', 'np.median', (['dr'], {}), '(dr)\n', (2822, 2826), True, 'import numpy as np\n'), ((3134, 3157), 'numpy.maximum', '... |
import inspect
import os
import numpy as np
import pandas as pd
from scipy.spatial import ConvexHull
from src.analysis.similarity_acc_matrix import compute_acc_between_years
from src.analysis.track_trends_sim import compute_similarity_matrix_years
from src.utils.misc import get_sub, get_tail_from_data_path
from src.u... | [
"inspect.signature",
"os.path.join",
"src.utils.misc.get_tail_from_data_path",
"os.listdir",
"src.utils.statistics.find_productivity",
"src.analysis.similarity_acc_matrix.compute_acc_between_years",
"src.analysis.track_trends_sim.compute_similarity_matrix_years",
"src.utils.statistics.find_norm_freq",... | [((434, 457), 'inspect.signature', 'inspect.signature', (['func'], {}), '(func)\n', (451, 457), False, 'import inspect\n'), ((1580, 1659), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (["{'Year': yearss, 'Word': words, 'Productivity': prodss}"], {}), "({'Year': yearss, 'Word': words, 'Productivity': prodss})... |
# -*- coding: utf-8 -*-
'''
raet.lane unit test package
'''
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import os
from ioflo import test
from ioflo.base.consoling import getConsole
console = getConsole()
console.reinit(verbosity=console.Wordage.concise)
top = os... | [
"sys.modules.get",
"ioflo.test.run",
"ioflo.base.consoling.getConsole"
] | [((248, 260), 'ioflo.base.consoling.getConsole', 'getConsole', ([], {}), '()\n', (258, 260), False, 'from ioflo.base.consoling import getConsole\n'), ((419, 432), 'ioflo.test.run', 'test.run', (['top'], {}), '(top)\n', (427, 432), False, 'from ioflo import test\n'), ((350, 375), 'sys.modules.get', 'sys.modules.get', ([... |
import os
import subprocess
from includes import *
from common import waitForIndex, skipOnExistingEnv
from RLTest import Env
REDISEARCH_CACHE_DIR = '/tmp/'
BASE_RDBS_URL = 'https://s3.amazonaws.com/redismodules/redisearch-enterprise/rdbs/'
RDBS = [
'redisearch_1.2.0.rdb',
'redisearch_1.4.0.rdb',
'redisea... | [
"os.path.join",
"subprocess.call",
"common.waitForIndex",
"os.symlink",
"common.skipOnExistingEnv",
"os.path.exists",
"os.unlink",
"os.environ.get",
"os.makedirs",
"RLTest.Env"
] | [((942, 1117), 'RLTest.Env', 'Env', ([], {'moduleArgs': '"""UPGRADE_INDEX idx; PREFIX 1 tt; LANGUAGE french; LANGUAGE_FIELD MyLang; SCORE 0.5; SCORE_FIELD MyScore; PAYLOAD_FIELD MyPayload; UPGRADE_INDEX idx1"""'}), "(moduleArgs=\n 'UPGRADE_INDEX idx; PREFIX 1 tt; LANGUAGE french; LANGUAGE_FIELD MyLang; SCORE 0.5; SC... |
import codecs
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
README = f.read()
with codecs.open(os.path.join(here, 'CHANGELOG.rst'), encoding='utf-8') as f:
CHANGELOG = f.read()... | [
"os.path.join",
"os.path.dirname",
"setuptools.find_packages"
] | [((92, 117), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (107, 117), False, 'import os\n'), ((137, 169), 'os.path.join', 'os.path.join', (['here', '"""README.rst"""'], {}), "(here, 'README.rst')\n", (149, 169), False, 'import os\n'), ((235, 270), 'os.path.join', 'os.path.join', (['here', '... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Example 4: TTS - getText2VoiceStream"""
from __future__ import print_function
import grpc
import gigagenieRPC_pb2
import gigagenieRPC_pb2_grpc
import MicrophoneStream as MS
import user_auth as UA
import os
from ctypes import *
import time
HOST = 'gate.gigagenie.ai'
P... | [
"gigagenieRPC_pb2_grpc.GigagenieStub",
"MicrophoneStream.play_file",
"user_auth.getCredentials",
"gigagenieRPC_pb2.reqText",
"time.sleep"
] | [((797, 841), 'gigagenieRPC_pb2_grpc.GigagenieStub', 'gigagenieRPC_pb2_grpc.GigagenieStub', (['channel'], {}), '(channel)\n', (832, 841), False, 'import gigagenieRPC_pb2_grpc\n'), ((854, 880), 'gigagenieRPC_pb2.reqText', 'gigagenieRPC_pb2.reqText', ([], {}), '()\n', (878, 880), False, 'import gigagenieRPC_pb2\n'), ((13... |
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
module_name = "backuprunner"
project_slug = "backup-runner"
setup(
name=project_slug,
use_scm_version=True,
url="https://github.com/Senth/backup-runner",
license="MIT",
author="<NAME>",
author_ema... | [
"setuptools.setup"
] | [((160, 1021), 'setuptools.setup', 'setup', ([], {'name': 'project_slug', 'use_scm_version': '(True)', 'url': '"""https://github.com/Senth/backup-runner"""', 'license': '"""MIT"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""Run a backup script on your local server"""', 'long_descript... |
import datetime as dt
import pytest
import spacy
from timexy.timexy import Timexy
def test_supported_lang() -> None:
nlp = spacy.blank("en")
t = Timexy(nlp, "timexy", "timex3", "label")
assert t
def test_unsupported_lang() -> None:
nlp = spacy.blank("xx")
with pytest.raises(NameError):
... | [
"datetime.datetime.strptime",
"pytest.raises",
"spacy.blank",
"pytest.mark.parametrize",
"timexy.timexy.Timexy"
] | [((365, 587), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""datestring, date_format, datestring_expected, date_format_expected"""', "[('3 February 2010', '%d %B %Y', '3 2 2010', '%d %m %Y'), ('3. Mar 2020',\n '%d. %b %Y', '3. 3 2020', '%d. %m %Y')]"], {}), "(\n 'datestring, date_format, datestring_e... |
import pytest
@pytest.fixture
def heatmap_data_single_track():
from numpy import array
data = {
"track1": array([
[0, 0, 0, 0, 0, 10, 10, 10, 10, 10],
[0, 0, 0, 0, 0, 10, 10, 10, 10, 10],
[0, 0, 0, 0, 0, 10, 10, 10, 10, 10],
[0, 0, 0, 0, 0, 10, 10, 10, 1... | [
"numpy.array",
"fluff.util.mirror_clusters"
] | [((733, 776), 'numpy.array', 'array', (['[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]'], {}), '([0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2])\n', (738, 776), False, 'from numpy import array\n'), ((2156, 2199), 'numpy.array', 'array', (['[0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3]'], {}), '([0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3])\n', (2161, 219... |
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2014, 2015 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany th... | [
"io.StringIO",
"io.BytesIO",
"requests.post",
"collections.namedtuple"
] | [((898, 950), 'collections.namedtuple', 'namedtuple', (['"""Response"""', "['status', 'reason', 'text']"], {}), "('Response', ['status', 'reason', 'text'])\n", (908, 950), False, 'from collections import namedtuple\n'), ((2557, 2660), 'requests.post', 'requests.post', (['u'], {'data': 'd', 'files': 'f', 'timeout': '(4 ... |
# -*- coding: utf-8 -*-
# $Id: wuimain.py $
"""
Test Manager Core - WUI - The Main page.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and... | [
"testmanager.core.build.BuildDataEx",
"testmanager.webui.wuibase.WuiDispatcherBase.__init__",
"testmanager.webui.wuibase.WuiDispatcherBase._generatePage",
"testmanager.core.testresults.TestResultFileDataEx",
"testmanager.webui.wuilogviewer.WuiLogViewer",
"testmanager.core.testbox.TestBoxData",
"testmana... | [((7588, 7649), 'testmanager.webui.wuibase.WuiDispatcherBase.__init__', 'WuiDispatcherBase.__init__', (['self', 'oSrvGlue', 'self.ksScriptName'], {}), '(self, oSrvGlue, self.ksScriptName)\n', (7614, 7649), False, 'from testmanager.webui.wuibase import WuiDispatcherBase, WuiException\n'), ((33215, 33241), 'testmanager.c... |
import anndata
import os
import numpy as np
import scipy.sparse
from sfaira.data import DatasetBase
class Dataset(DatasetBase):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.download_url_data = "https://covid19.cog.sanger.ac.uk/lukowski19.processed.h5ad"
self.download_ur... | [
"os.path.join",
"anndata.read",
"numpy.expm1"
] | [((911, 962), 'os.path.join', 'os.path.join', (['data_dir', '"""lukowski19.processed.h5ad"""'], {}), "(data_dir, 'lukowski19.processed.h5ad')\n", (923, 962), False, 'import os\n'), ((975, 991), 'anndata.read', 'anndata.read', (['fn'], {}), '(fn)\n', (987, 991), False, 'import anndata\n'), ((1006, 1023), 'numpy.expm1', ... |
#! /usr/bin/python2.7
from collections import deque
from string import ascii_lowercase
import sys
alphabetindex = {'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7,'i':8,'j':9,'k':10,'l':11,'m':12,'n':13,'o':14,'p':15,'q':16,'r':17,'s':18,'t':19,'u':20,'v':21,'w':22,'x':23,'y':24,'z':25}
numberindex = {0:'a',1:'b',2:'... | [
"sys.argv.index",
"sys.stdin.read"
] | [((5276, 5299), 'sys.argv.index', 'sys.argv.index', (['"""--key"""'], {}), "('--key')\n", (5290, 5299), False, 'import sys\n'), ((5357, 5373), 'sys.stdin.read', 'sys.stdin.read', ([], {}), '()\n', (5371, 5373), False, 'import sys\n'), ((5491, 5507), 'sys.stdin.read', 'sys.stdin.read', ([], {}), '()\n', (5505, 5507), Fa... |
import os
from maskrcnn_benchmark.data.datasets.coco import COCODataset
dataset = COCODataset(
"./my_dataset/train/instances_post_train2018.json",
"./my_dataset/train/images",
True,
)
# boxlist = dataset[0]
# print(boxlist.bbox)
# boxlist = dataset[1][1]
# print(boxlist.bbox)
aaa = 2 | [
"maskrcnn_benchmark.data.datasets.coco.COCODataset"
] | [((83, 185), 'maskrcnn_benchmark.data.datasets.coco.COCODataset', 'COCODataset', (['"""./my_dataset/train/instances_post_train2018.json"""', '"""./my_dataset/train/images"""', '(True)'], {}), "('./my_dataset/train/instances_post_train2018.json',\n './my_dataset/train/images', True)\n", (94, 185), False, 'from maskrc... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import o... | [
"json.loads",
"pants_test.subsystem.subsystem_util.global_subsystem_instance"
] | [((1739, 1764), 'json.loads', 'json.loads', (['versions_json'], {}), '(versions_json)\n', (1749, 1764), False, 'import json\n'), ((602, 653), 'pants_test.subsystem.subsystem_util.global_subsystem_instance', 'global_subsystem_instance', (['NodeDistribution.Factory'], {}), '(NodeDistribution.Factory)\n', (627, 653), Fals... |
import tkinter as tk
# From i_chaoren
# https://blog.csdn.net/i_chaoren/article/details/56296713
class ToolTip(object):
def __init__(self, widget):
self.widget = widget
self.tipwindow = None
self.id = None
self.x = self.y = 0
self.text = None
def showtip(self, text):
... | [
"tkinter.Label",
"tkinter.Toplevel"
] | [((628, 652), 'tkinter.Toplevel', 'tk.Toplevel', (['self.widget'], {}), '(self.widget)\n', (639, 652), True, 'import tkinter as tk\n'), ((746, 882), 'tkinter.Label', 'tk.Label', (['tw'], {'text': 'self.text', 'justify': 'tk.LEFT', 'background': '"""#ffffe0"""', 'relief': 'tk.SOLID', 'borderwidth': '(1)', 'font': "('tah... |
"""
An F# Fable (python) kernel for Jupyter based on IPythonKernel.
"""
import json
import os
import os.path
import pkgutil
import queue
import re
import subprocess
import sys
import threading
import time
import traceback
from tempfile import TemporaryDirectory
from typing import IO, Any, Dict, List, Optional
from queu... | [
"re.match",
"os.path.getmtime",
"os.mkdir",
"os.path.exists",
"black.FileMode",
"tempfile.TemporaryDirectory",
"os.getcwd",
"jupyter_core.paths.jupyter_config_dir",
"traceback.format_exc",
"sys.path.append",
"sys.exit",
"pkgutil.get_data",
"time.sleep",
"os.path.join",
"subprocess.Popen"... | [((3525, 3545), 'tempfile.TemporaryDirectory', 'TemporaryDirectory', ([], {}), '()\n', (3543, 3545), False, 'from tempfile import TemporaryDirectory\n'), ((3568, 3611), 'os.path.join', 'os.path.join', (['self.tmp_dir.name', '"""fable.py"""'], {}), "(self.tmp_dir.name, 'fable.py')\n", (3580, 3611), False, 'import os\n')... |
# Copyright (C) 2017-2020 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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 3 of the License, or
# (at your option) any later version.
#
#... | [
"ycmd.tests.java.IsolatedYcmd",
"hamcrest.has_entry",
"json.dumps",
"ycmd.tests.test_utils.PollForMessages",
"hamcrest.has_entries",
"ycmd.utils.ReadFile",
"hamcrest.assert_that",
"ycmd.tests.test_utils.BuildRequest",
"hamcrest.matches_regexp",
"ycmd.tests.test_utils.RangeMatcher",
"ycmd.tests.t... | [((2323, 2402), 'ycmd.tests.java.PathToTestFile', 'PathToTestFile', (['DEFAULT_PROJECT_DIR', '"""src"""', '"""com"""', '"""youcompleteme"""', '"""Test.java"""'], {}), "(DEFAULT_PROJECT_DIR, 'src', 'com', 'youcompleteme', 'Test.java')\n", (2337, 2402), False, 'from ycmd.tests.java import DEFAULT_PROJECT_DIR, IsolatedYcm... |
"""
Module to define the reader class and functionality
for the csv files provided by SKIRON.
"""
import numpy as np
import csv
import os
from dateutil.parser import parse
from task_reader import Task, VEC, SCAL, FILE, HISTO, SCATT, ROSE, HEAT, STATS, SERIES, SAVE, FTYPE, METEO
from support_data import DIR, MAG, MEAN,... | [
"dateutil.parser.parse",
"numpy.arctan2",
"csv.DictReader",
"numpy.zeros",
"skiron_fig_lib.plot_roses",
"numpy.sqrt",
"skiron_fig_lib.get_fig_decorations_from_header",
"numpy.min",
"numpy.cov",
"os.path.join",
"numpy.linspace",
"numpy.percentile",
"numpy.max",
"skiron_fig_lib.plot_timeseri... | [((662, 686), 'numpy.sqrt', 'np.sqrt', (['(x ** 2 + y ** 2)'], {}), '(x ** 2 + y ** 2)\n', (669, 686), True, 'import numpy as np\n'), ((10925, 10981), 'os.path.join', 'os.path.join', (['self.task.opt_dict[SAVE]', '"""statistics.csv"""'], {}), "(self.task.opt_dict[SAVE], 'statistics.csv')\n", (10937, 10981), False, 'imp... |
from django.conf.urls import include, url
urlpatterns = [
url(r"^", include("pinax.cohorts.urls", namespace="pinax_cohorts")),
]
| [
"django.conf.urls.include"
] | [((73, 129), 'django.conf.urls.include', 'include', (['"""pinax.cohorts.urls"""'], {'namespace': '"""pinax_cohorts"""'}), "('pinax.cohorts.urls', namespace='pinax_cohorts')\n", (80, 129), False, 'from django.conf.urls import include, url\n')] |
'''
使用 DNSPod 的 API 来实现 DDNS 功能
It works in both WinX and Linux
'''
import os
import json
import requests
from GetIP import GetIP
from ddnslogger import ddns_logger
API_VERSION = '4.6'
dlog = ddns_logger()
def dnspod_conf_read():
'''
read information from json files
'''
dlog.info_msg('try to Read d... | [
"ddnslogger.ddns_logger",
"json.loads",
"os.path.realpath",
"GetIP.GetIP",
"requests.session"
] | [((195, 208), 'ddnslogger.ddns_logger', 'ddns_logger', ([], {}), '()\n', (206, 208), False, 'from ddnslogger import ddns_logger\n'), ((449, 465), 'json.loads', 'json.loads', (['text'], {}), '(text)\n', (459, 465), False, 'import json\n'), ((1560, 1567), 'GetIP.GetIP', 'GetIP', ([], {}), '()\n', (1565, 1567), False, 'fr... |
# Simple example of how to estimate MI between X and Y, where Y = f(X) + Noise(0, noise_variance)
from __future__ import print_function
import kde
import keras.backend as K
import numpy as np
Y_samples = K.placeholder(ndim=2)
noise_variance = 0.05
entropy_func_upper = K.function([Y_samples,], [kde.entropy_estima... | [
"kde.entropy_estimator_kl",
"keras.backend.variable",
"keras.backend.placeholder",
"numpy.random.random",
"keras.backend.log",
"keras.backend.logsumexp",
"kde.kde_condentropy",
"kde.entropy_estimator_bd"
] | [((205, 226), 'keras.backend.placeholder', 'K.placeholder', ([], {'ndim': '(2)'}), '(ndim=2)\n', (218, 226), True, 'import keras.backend as K\n'), ((467, 500), 'numpy.random.random', 'np.random.random', ([], {'size': '(1000, 20)'}), '(size=(1000, 20))\n', (483, 500), True, 'import numpy as np\n'), ((531, 572), 'kde.kde... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import os
import tensorflow as tf
import math
"""
BCL + OMEGA = 180 / 256.
{'0.85': {'bridge': 0.0303030303030303, 'mAP': 0.11042327853710288, 'ground-track-field': 0.11363636363636365, 'soccer-ball-field': 0.1567070480844277, 's... | [
"os.path.join",
"tensorflow.constant_initializer",
"os.path.abspath",
"tensorflow.random_normal_initializer",
"math.log"
] | [((6064, 6086), 'os.path.abspath', 'os.path.abspath', (['"""../"""'], {}), "('../')\n", (6079, 6086), False, 'import os\n'), ((6698, 6747), 'os.path.join', 'os.path.join', (['ROOT_PATH', '"""output/trained_weights"""'], {}), "(ROOT_PATH, 'output/trained_weights')\n", (6710, 6747), False, 'import os\n'), ((8097, 8159), ... |
# Copyright 2010-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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file ac... | [
"awscrt.io.EventLoopGroup",
"awscrt.io.TlsContextOptions.create_client_with_mtls_from_path",
"urlparse.urlparse",
"awscrt.io.ClientTlsContext",
"argparse.ArgumentParser",
"awscrt.io.SocketOptions",
"os.stat",
"awscrt.io.init_logging",
"awscrt.http.HttpClientConnection.new_connection",
"awscrt.io.C... | [((855, 880), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (878, 880), False, 'import argparse\n'), ((4011, 4031), 'awscrt.io.EventLoopGroup', 'io.EventLoopGroup', (['(1)'], {}), '(1)\n', (4028, 4031), False, 'from awscrt import io, http\n'), ((4170, 4206), 'awscrt.io.ClientBootstrap', 'io.Cl... |
from copy import copy
from enum import Enum
import numpy as np
import pyqtgraph as pg
from acconeer.exptool import clients, configs, utils
from acconeer.exptool.pg_process import PGProccessDiedException, PGProcess
from acconeer.exptool.structs import configbase
PEAK_MERGE_LIMIT_M = 0.005
def main():
args = ut... | [
"acconeer.exptool.structs.configbase.FloatParameter",
"acconeer.exptool.utils.config_logging",
"numpy.round",
"numpy.isnan",
"numpy.zeros",
"numpy.square",
"acconeer.exptool.structs.configbase.BoolParameter",
"numpy.ones",
"acconeer.exptool.utils.ExampleInterruptHandler",
"numpy.concatenate",
"n... | [((375, 401), 'acconeer.exptool.utils.config_logging', 'utils.config_logging', (['args'], {}), '(args)\n', (395, 401), False, 'from acconeer.exptool import clients, configs, utils\n'), ((936, 957), 'acconeer.exptool.pg_process.PGProcess', 'PGProcess', (['pg_updater'], {}), '(pg_updater)\n', (945, 957), False, 'from acc... |
from server import app
app.testing = True
client = app.test_client()
def connect():
return client.get("http://127.0.0.1:5000/")
def test_answer():
assert connect()
| [
"server.app.test_client"
] | [((52, 69), 'server.app.test_client', 'app.test_client', ([], {}), '()\n', (67, 69), False, 'from server import app\n')] |
#!/usr/bin/env python
"""
Copyright (c) 2019 <NAME>
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, publi... | [
"eth_ep.EthFrame",
"uart_ep.UARTSink",
"os.system",
"mii_ep.MIISource",
"uart_ep.UARTSource",
"mii_ep.MIISink",
"struct.pack",
"xfcp.XFCPFrame",
"udp_ep.UDPFrame",
"arp_ep.ARPFrame"
] | [((4451, 4469), 'mii_ep.MIISource', 'mii_ep.MIISource', ([], {}), '()\n', (4467, 4469), False, 'import mii_ep\n'), ((4671, 4687), 'mii_ep.MIISink', 'mii_ep.MIISink', ([], {}), '()\n', (4685, 4687), False, 'import mii_ep\n'), ((4882, 4902), 'uart_ep.UARTSource', 'uart_ep.UARTSource', ([], {}), '()\n', (4900, 4902), Fals... |
import asyncio
from PIL import Image
from mpf.tests.MpfTestCase import MpfTestCase, MagicMock, patch
class TestRpiDmd(MpfTestCase):
def get_config_file(self):
return 'config.yaml'
def get_machine_path(self):
return 'tests/machine_files/rpi_dmd/'
def get_platform(self):
# no fo... | [
"mpf.tests.MpfTestCase.patch",
"PIL.Image.frombytes",
"mpf.tests.MpfTestCase.MagicMock"
] | [((397, 437), 'mpf.tests.MpfTestCase.patch', 'patch', (['"""mpf.platforms.rpi_dmd.RGBMatrix"""'], {}), "('mpf.platforms.rpi_dmd.RGBMatrix')\n", (402, 437), False, 'from mpf.tests.MpfTestCase import MpfTestCase, MagicMock, patch\n'), ((465, 512), 'mpf.tests.MpfTestCase.patch', 'patch', (['"""mpf.platforms.rpi_dmd.RGBMat... |
from PyQt5 import QtCore, QtGui, QtWidgets
class TitleScreen(object):
def setup_ui(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1280, 720)
MainWindow.setAutoFillBackground(False)
MainWindow.setStyleSheet("background-color: rgb(0, 8, 20);")
sel... | [
"PyQt5.QtWidgets.QStatusBar",
"PyQt5.QtWidgets.QMenuBar",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtGui.QFont",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QWidget"
] | [((339, 368), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (356, 368), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((455, 492), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (['self.central_widget'], {}), '(self.central_widget)\n', (471, 492), False, 'from PyQt5 im... |
from unittest.mock import patch
import pytest
import time
from functools import partial
from wait_for import wait_for, wait_for_decorator, TimedOutError
class Incrementor():
value = 0
def i_sleep_a_lot(self):
time.sleep(.1)
self.value += 1
return self.value
def test_simple_wait():
... | [
"wait_for.wait_for_decorator",
"pytest.raises",
"wait_for.wait_for",
"unittest.mock.patch",
"pytest.fail",
"time.sleep"
] | [((1669, 1714), 'unittest.mock.patch', 'patch', (['"""wait_for.default_hidden_logger.error"""'], {}), "('wait_for.default_hidden_logger.error')\n", (1674, 1714), False, 'from unittest.mock import patch\n'), ((359, 419), 'wait_for.wait_for', 'wait_for', (['incman.i_sleep_a_lot'], {'fail_condition': '(0)', 'delay': '(0.0... |
from lovpy.graphs.timed_property_graph import NoPositiveAndNegativePredicatesSimultaneously
from lovpy.exceptions import PropertyNotHoldsException
from .next_theorem_selectors import get_default_theorem_selector
from .properties import split_into_theorems_and_properties_to_prove, \
negate_conclusion_part_of_propert... | [
"lovpy.graphs.timed_property_graph.NoPositiveAndNegativePredicatesSimultaneously"
] | [((7644, 7701), 'lovpy.graphs.timed_property_graph.NoPositiveAndNegativePredicatesSimultaneously', 'NoPositiveAndNegativePredicatesSimultaneously', (['temp_graph'], {}), '(temp_graph)\n', (7689, 7701), False, 'from lovpy.graphs.timed_property_graph import NoPositiveAndNegativePredicatesSimultaneously\n')] |
from multiprocessing import Pool
def loop(a):
while True:
pass
Pool().map(loop, range(100))
| [
"multiprocessing.Pool"
] | [((77, 83), 'multiprocessing.Pool', 'Pool', ([], {}), '()\n', (81, 83), False, 'from multiprocessing import Pool\n')] |
import argparse
from pathlib import Path
import numpy as np
from scipy.stats import gaussian_kde
from sklearn.metrics import r2_score
import matplotlib.pyplot as plt
from osgeo import gdal_array
import seaborn as sns
sns.set_context("paper", rc={'font.sans-serif': 'Arial',
'font.size': 12})... | [
"matplotlib.pyplot.gca",
"seaborn.set_context",
"argparse.ArgumentParser",
"numpy.vstack",
"matplotlib.pyplot.figure",
"scipy.stats.gaussian_kde",
"matplotlib.pyplot.close",
"sklearn.metrics.r2_score"
] | [((217, 291), 'seaborn.set_context', 'sns.set_context', (['"""paper"""'], {'rc': "{'font.sans-serif': 'Arial', 'font.size': 12}"}), "('paper', rc={'font.sans-serif': 'Arial', 'font.size': 12})\n", (232, 291), True, 'import seaborn as sns\n'), ((331, 356), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), ... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 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 indico.core.db.sqlalchemy.util.session import no_autoflush
from indico.modules.events.contributions.m... | [
"indico.web.forms.widgets.JinjaWidget",
"indico.util.i18n._",
"indico.modules.events.contributions.util.serialize_contribution_person_link",
"indico.modules.events.contributions.models.persons.AuthorType.serialize"
] | [((925, 1031), 'indico.web.forms.widgets.JinjaWidget', 'JinjaWidget', (['"""events/contributions/forms/contribution_person_link_widget.html"""'], {'allow_empty_email': '(True)'}), "('events/contributions/forms/contribution_person_link_widget.html',\n allow_empty_email=True)\n", (936, 1031), False, 'from indico.web.f... |
# coding=utf-8
# author: Lan_zhijiang
# description: tts class
# date: 2020/10/1
import requests
import urllib.request
import urllib.parse
import threading
import time
from player import Player
class BaiduTts():
def __init__(self, log, setting):
self.log = log
self.setting = setting
... | [
"threading.Thread",
"time.sleep",
"requests.get",
"player.Player"
] | [((405, 425), 'player.Player', 'Player', (['log', 'setting'], {}), '(log, setting)\n', (411, 425), False, 'from player import Player\n'), ((908, 979), 'requests.get', 'requests.get', (['"""http://openapi.baidu.com/oauth/2.0/token"""'], {'params': 'params'}), "('http://openapi.baidu.com/oauth/2.0/token', params=params)\... |
#!/usr/bin/env python
import os
import sys
from decouple import config
if __name__ == "__main__":
settings_module = config('DJANGO_SETTINGS_MODULE', default=None)
if sys.argv[1] == 'test':
if settings_module:
print("Ignoring config('DJANGO_SETTINGS_MODULE') because it's test. "
... | [
"os.environ.setdefault",
"decouple.config",
"django.core.management.execute_from_command_line"
] | [((124, 170), 'decouple.config', 'config', (['"""DJANGO_SETTINGS_MODULE"""'], {'default': 'None'}), "('DJANGO_SETTINGS_MODULE', default=None)\n", (130, 170), False, 'from decouple import config\n'), ((627, 662), 'django.core.management.execute_from_command_line', 'execute_from_command_line', (['sys.argv'], {}), '(sys.a... |
import json
from collections import OrderedDict
import matplotlib.cm as cm
scalar_range = [0., 1.0e-2]
cmap = cm.get_cmap('jet')
color_transfer = []
for i in range(255):
r, g, b, _ = cmap(float(i)/255.)
x = (scalar_range[1] - scalar_range[0]) / 255. * float(i) + scalar_range[0]
color_transfer.append([x, r... | [
"json.dump",
"collections.OrderedDict",
"json.load",
"matplotlib.cm.get_cmap"
] | [((111, 129), 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['"""jet"""'], {}), "('jet')\n", (122, 129), True, 'import matplotlib.cm as cm\n'), ((767, 780), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (778, 780), False, 'from collections import OrderedDict\n'), ((1104, 1135), 'json.dump', 'json.dump', (['pr... |
from bzt.modules.aggregator import DataPoint, KPISet, ConsolidatingAggregator
from bzt.modules.external import ExternalResultsLoader
from bzt.modules.jmeter import FuncJTLReader, JTLReader
from bzt.modules.ab import TSVDataReader
from bzt.modules.pbench import PBenchKPIReader
from bzt.modules.gatling import DataLogRead... | [
"tests.close_reader_file",
"tests.mocks.MockReader",
"bzt.modules.aggregator.ConsolidatingAggregator"
] | [((1137, 1149), 'tests.mocks.MockReader', 'MockReader', ([], {}), '()\n', (1147, 1149), False, 'from tests.mocks import MockReader\n'), ((1187, 1212), 'bzt.modules.aggregator.ConsolidatingAggregator', 'ConsolidatingAggregator', ([], {}), '()\n', (1210, 1212), False, 'from bzt.modules.aggregator import DataPoint, KPISet... |
# -*- coding: utf-8 -*-
"""Functions for FIR filter design."""
from __future__ import division, print_function, absolute_import
from math import ceil, log
import operator
import warnings
import numpy as np
from numpy.fft import irfft, fft, ifft
from scipy.special import sinc
from scipy.linalg import (toeplitz, hankel... | [
"warnings.simplefilter",
"numpy.asarray",
"numpy.sum",
"math.ceil",
"numpy.zeros",
"numpy.sinc",
"numpy.log",
"numpy.arange",
"numpy.fft.ifft",
"scipy.linalg.toeplitz",
"numpy.interp",
"numpy.iscomplexobj",
"numpy.finfo",
"operator.index",
"numpy.sqrt",
"numpy.fft.irfft",
"scipy.lina... | [((16009, 16069), 'numpy.hstack', 'np.hstack', (['([0.0] * pass_zero, cutoff, [1.0] * pass_nyquist)'], {}), '(([0.0] * pass_zero, cutoff, [1.0] * pass_nyquist))\n', (16018, 16069), True, 'import numpy as np\n'), ((21744, 21757), 'numpy.diff', 'np.diff', (['freq'], {}), '(freq)\n', (21751, 21757), True, 'import numpy as... |
import logging
from urllib.parse import urlencode
from django.conf import settings
from django.contrib import auth, messages
from django.http import HttpResponseBadRequest, HttpResponseRedirect
from django.shortcuts import resolve_url
from django.urls import reverse
from django.utils.translation import gettext_lazy as... | [
"django.utils.translation.gettext_lazy",
"django.conf.settings.DIGID.get",
"logging.getLogger",
"digid_eherkenning.mock.conf.get_success_url",
"digid_eherkenning.mock.conf.get_cancel_url",
"django.shortcuts.resolve_url",
"django.http.HttpResponseRedirect",
"digid_eherkenning.mock.conf.get_idp_login_ur... | [((508, 535), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (525, 535), False, 'import logging\n'), ((2503, 2534), 'django.shortcuts.resolve_url', 'resolve_url', (['settings.LOGIN_URL'], {}), '(settings.LOGIN_URL)\n', (2514, 2534), False, 'from django.shortcuts import resolve_url\n'), ((... |
from __future__ import division
from __future__ import print_function
import panoramasdk
import cv2
import numpy as np
import boto3
# Global Variables
HEIGHT = 512
WIDTH = 512
MODEL = 'pikachu'
class PikachuDetection(panoramasdk.base):
def interface(self):
return {
"parameters":
... | [
"numpy.float",
"numpy.asarray",
"panoramasdk.model",
"cv2.resize"
] | [((2244, 2276), 'cv2.resize', 'cv2.resize', (['img', '(HEIGHT, WIDTH)'], {}), '(img, (HEIGHT, WIDTH))\n', (2254, 2276), False, 'import cv2\n'), ((3096, 3110), 'numpy.asarray', 'np.asarray', (['x1'], {}), '(x1)\n', (3106, 3110), True, 'import numpy as np\n'), ((1486, 1505), 'panoramasdk.model', 'panoramasdk.model', ([],... |
import copy
import unittest
from django.utils.tree import Node
class NodeTests(unittest.TestCase):
def setUp(self):
self.node1_children = [('a', 1), ('b', 2)]
self.node1 = Node(self.node1_children)
self.node2 = Node()
def test_str(self):
self.assertEqual(str(self.node1), "(DE... | [
"copy.deepcopy",
"django.utils.tree.Node",
"copy.copy"
] | [((195, 220), 'django.utils.tree.Node', 'Node', (['self.node1_children'], {}), '(self.node1_children)\n', (199, 220), False, 'from django.utils.tree import Node\n'), ((242, 248), 'django.utils.tree.Node', 'Node', ([], {}), '()\n', (246, 248), False, 'from django.utils.tree import Node\n'), ((1048, 1073), 'django.utils.... |
import pytest
from .. import BleuEvaluator
@pytest.mark.parametrize('actual, desired, score',
[
('All cats are so super beautiful', 'All cats are so super beautiful', 1.0),
('All cats are so super beautiful', '', 0.0),
... | [
"pytest.approx",
"pytest.mark.parametrize"
] | [((47, 613), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""actual, desired, score"""', "[('All cats are so super beautiful', 'All cats are so super beautiful', 1.0\n ), ('All cats are so super beautiful', '', 0.0), ('',\n 'All cats are so super beautiful', 0.0), (\n 'All cats are so super beautif... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.