code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
"""
chemdataextractor.parse.battery_energy.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Parser for energy.
"""
import re
import logging
from lxml import etree
import traceback
from . import R, I, W, Optional, merge, join
from .base import BaseSentenceParser
from ..utils import first
from .cem import cem, ... | [
"lxml.etree.tostring",
"logging.getLogger"
] | [((508, 535), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (525, 535), False, 'import logging\n'), ((9043, 9064), 'lxml.etree.tostring', 'etree.tostring', (['trees'], {}), '(trees)\n', (9057, 9064), False, 'from lxml import etree\n'), ((10461, 10483), 'lxml.etree.tostring', 'etree.tostr... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from . import ResourceConfigTestCase
from .. import BaseModel
Base = declarative_base(cls=BaseModel)
class SomeModel(Base):
id = Column(Integer,... | [
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.Column"
] | [((239, 270), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {'cls': 'BaseModel'}), '(cls=BaseModel)\n', (255, 270), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((305, 338), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=... |
import random
import copy
class Jeu:
def __init__(self, lignes):
self.allumettes = []
self.lignes = lignes
nombreAllumettes = 1
for i in range(lignes):
self.allumettes.append(nombreAllumettes)
nombreAllumettes += 2
def __str__(self):
lstGraphiqu... | [
"copy.deepcopy",
"random.choice",
"random.randint"
] | [((2202, 2222), 'random.randint', 'random.randint', (['(3)', '(6)'], {}), '(3, 6)\n', (2216, 2222), False, 'import random\n'), ((2399, 2433), 'random.choice', 'random.choice', (["['joueur', 'robot']"], {}), "(['joueur', 'robot'])\n", (2412, 2433), False, 'import random\n'), ((4062, 4098), 'random.choice', 'random.choic... |
import ctypes
# *************************************************
#* sql.py
#*
#* These should be consistent with the MS version.
#*
#*************************************************#
#ifndef __SQL_H
#_SQL_H
# ***************************
#* default to 3.51 declare something else before here and you get a whole new b... | [
"ctypes.c_ulong"
] | [((14583, 14600), 'ctypes.c_ulong', 'ctypes.c_ulong', (['(0)'], {}), '(0)\n', (14597, 14600), False, 'import ctypes\n'), ((14621, 14638), 'ctypes.c_ulong', 'ctypes.c_ulong', (['(1)'], {}), '(1)\n', (14635, 14638), False, 'import ctypes\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import numpy as np
from einops.layers.torch import Rearrange, Reduce
from einops import rearrange
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel... | [
"torch.flatten",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Dropout",
"torch.nn.ReLU",
"torch.nn.init.kaiming_normal_",
"torchvision.models.mobilenet.mobilenet_v3_small",
"torch.nn.Conv2d",
"torch.nn.Hardswish",
"torch.cat",
"torch.nn.init.zeros_",
"torch.nn.BatchNorm2d",
"torch.nn.init.normal_",... | [((281, 370), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_planes', 'out_planes'], {'kernel_size': '(3)', 'stride': 'stride', 'padding': '(1)', 'bias': '(False)'}), '(in_planes, out_planes, kernel_size=3, stride=stride, padding=1,\n bias=False)\n', (290, 370), True, 'import torch.nn as nn\n'), ((473, 547), 'torch.nn.Conv2d... |
from ogs6py import ogs
model = ogs.OGS(PROJECT_FILE="test.prj")
model.geo.add_geom(filename="square_1x1.gml")
model.mesh.add_mesh(filename="square_1x1_quad_1e2.vtu")
model.processes.set_process(name="SD",
type="SMALL_DEFORMATION",
integration_order="2",
... | [
"ogs6py.ogs.OGS"
] | [((32, 64), 'ogs6py.ogs.OGS', 'ogs.OGS', ([], {'PROJECT_FILE': '"""test.prj"""'}), "(PROJECT_FILE='test.prj')\n", (39, 64), False, 'from ogs6py import ogs\n')] |
from rpython.rlib import rwin32
from rpython.rlib.rarithmetic import r_uint
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rtyper.tool import rffi_platform
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from pypy.interpreter.error import oefmt, wrap_windowserror
from pypy.interpr... | [
"rpython.rtyper.tool.rffi_platform.configure",
"pypy.interpreter.gateway.interp2app",
"_multiprocess.interp_connection.w_handle",
"rpython.rtyper.lltypesystem.rffi.ptradd",
"rpython.translator.tool.cbuild.ExternalCompilationInfo",
"pypy.interpreter.gateway.unwrap_spec",
"rpython.rlib.rwin32.lastSavedWin... | [((1098, 1130), 'rpython.rtyper.tool.rffi_platform.configure', 'rffi_platform.configure', (['CConfig'], {}), '(CConfig)\n', (1121, 1130), False, 'from rpython.rtyper.tool import rffi_platform\n'), ((1267, 1478), 'rpython.rlib.rwin32.winexternal', 'rwin32.winexternal', (['"""CreateNamedPipeA"""', '[rwin32.LPCSTR, rwin32... |
import socket
import threading
import platform
import os
import sys
from queue import Queue
from user import User
import pickle
from datetime import datetime
import time
import math
class Client(object):
def __init__(self):
self.host = ''
self.command_port = 9999
self.data_port = 9998
self.command_sock = Non... | [
"pickle.loads",
"threading.Thread",
"os.getpid",
"pickle.dumps",
"datetime.datetime.today",
"os.path.getsize",
"socket.socket",
"os.system",
"time.sleep",
"platform.system",
"queue.Queue",
"user.User"
] | [((390, 396), 'user.User', 'User', ([], {}), '()\n', (394, 396), False, 'from user import User\n'), ((419, 426), 'queue.Queue', 'Queue', ([], {}), '()\n', (424, 426), False, 'from queue import Queue\n'), ((620, 635), 'socket.socket', 'socket.socket', ([], {}), '()\n', (633, 635), False, 'import socket\n'), ((1041, 1056... |
import bpy
import sys
from mathutils import Vector
import numpy as np
from abc import ABC, ABCMeta, abstractmethod
# Scene parameters
SCALE_FACTOR = 0.05 # factor used to scale an object when close enough to target
ROTATION_VEC = (3.0, 0., 0.) # rotation vector applied to an object when close enough to target
ORIGIN... | [
"numpy.random.rand",
"bpy.ops.mesh.primitive_ico_sphere_add",
"numpy.array",
"bpy.data.objects.new",
"numpy.linspace",
"bpy.app.handlers.frame_change_pre.clear"
] | [((10220, 10311), 'bpy.ops.mesh.primitive_ico_sphere_add', 'bpy.ops.mesh.primitive_ico_sphere_add', ([], {'subdivisions': '(4)', 'radius': '(0.3)', 'location': '(0, 0, 30)'}), '(subdivisions=4, radius=0.3, location=\n (0, 0, 30))\n', (10257, 10311), False, 'import bpy\n'), ((10648, 10689), 'bpy.app.handlers.frame_ch... |
from typing import Callable, List, Optional, TypeVar
from reactivex import Observable, abc, compose
from reactivex import operators as ops
from reactivex import typing
_T = TypeVar("_T")
def buffer_with_time_(
timespan: typing.RelativeTime,
timeshift: Optional[typing.RelativeTime] = None,
scheduler: Opt... | [
"typing.TypeVar",
"reactivex.operators.window_with_time",
"reactivex.operators.to_list"
] | [((175, 188), 'typing.TypeVar', 'TypeVar', (['"""_T"""'], {}), "('_T')\n", (182, 188), False, 'from typing import Callable, List, Optional, TypeVar\n'), ((488, 540), 'reactivex.operators.window_with_time', 'ops.window_with_time', (['timespan', 'timeshift', 'scheduler'], {}), '(timespan, timeshift, scheduler)\n', (508, ... |
"""
WIDGETMARK is a Performance Analysis Framework for GUI components
based on user defined use cases. Use Cases can be defined in classes
contained in separate files and are derived from widgetmark.UseCase.
These files will be searched recursively starting from the directory
widgetmark was started in. The default nami... | [
"snakeviz.cli.main",
"argparse.ArgumentParser",
"logging.basicConfig",
"typing.cast",
"logging.getLogger",
"signal.signal",
"sys.exit"
] | [((1181, 1208), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1198, 1208), False, 'import logging\n'), ((6929, 6962), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'new'], {}), '(signal.SIGINT, new)\n', (6942, 6962), False, 'import signal\n'), ((7204, 7215), 'sys.exit', 'sys.exit... |
# Generated by Django 3.0.6 on 2020-11-14 06:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('security', '0007_sudotasks_effective_days'),
]
operations = [
migrations.CreateModel(
name='Gro... | [
"django.db.models.CharField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.AutoField"
] | [((370, 463), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (386, 463), False, 'from django.db import migrations, models\... |
# Author: <NAME>
# Imperial College London
# August, 2015
#
# see license file in project root directory
import os
import time
import shutil
from reportlab.pdfgen import canvas
import malpem.mytools
def take_screenshot(output_file, parameters):
# DEFINITIONS
binary_display = os.path.join... | [
"time.strftime",
"reportlab.pdfgen.canvas.Canvas",
"os.path.isfile",
"shutil.copyfile",
"os.path.join"
] | [((308, 378), 'os.path.join', 'os.path.join', (['malpem.mytools.__malpem_path__', '"""lib"""', '"""irtk"""', '"""display"""'], {}), "(malpem.mytools.__malpem_path__, 'lib', 'irtk', 'display')\n", (320, 378), False, 'import os\n'), ((392, 463), 'os.path.join', 'os.path.join', (['malpem.mytools.__malpem_path__', '"""etc"... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-17 Ericsson AB
#
# 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 applicab... | [
"calvin.actor.actor.calvinsys.write",
"calvin.actor.actor.calvinsys.can_write",
"calvin.actor.actor.calvinsys.open",
"calvin.actor.actor.manage",
"calvin.utilities.calvinlogger.get_actor_logger",
"calvin.actor.actor.calvinsys.read",
"calvin.actor.actor.calvinsys.close",
"calvin.actor.actor.calvinsys.c... | [((755, 781), 'calvin.utilities.calvinlogger.get_actor_logger', 'get_actor_logger', (['__name__'], {}), '(__name__)\n', (771, 781), False, 'from calvin.utilities.calvinlogger import get_actor_logger\n'), ((953, 977), 'calvin.actor.actor.manage', 'manage', ([], {'exclude': "['_cam']"}), "(exclude=['_cam'])\n", (959, 977... |
from conans import ConanFile, CMake, tools, AutoToolsBuildEnvironment
from conans.errors import ConanInvalidConfiguration
import glob
import os
import textwrap
required_conan_version = ">=1.43.0"
class CapnprotoConan(ConanFile):
name = "capnproto"
description = "Cap'n Proto serialization/RPC system."
lic... | [
"conans.tools.get",
"textwrap.dedent",
"os.remove",
"conans.tools.replace_in_file",
"os.path.basename",
"conans.tools.Version",
"conans.tools.patch",
"conans.CMake",
"conans.tools.check_min_cppstd",
"conans.errors.ConanInvalidConfiguration",
"conans.tools.get_env",
"conans.AutoToolsBuildEnviro... | [((3166, 3277), 'conans.tools.get', 'tools.get', ([], {'destination': 'self._source_subfolder', 'strip_root': '(True)'}), "(**self.conan_data['sources'][self.version], destination=self.\n _source_subfolder, strip_root=True)\n", (3175, 3277), False, 'from conans import ConanFile, CMake, tools, AutoToolsBuildEnvironme... |
import dataclasses
from enum import Enum
from random import randint, shuffle
from typing import List
class NotGoatDoorException(BaseException):
pass
@dataclasses.dataclass
class Statistics:
wins: int
loses: int
overall: int
win_ratio: float
lose_ratio: float
class MontyHallChoices(Enum):
... | [
"random.shuffle",
"random.randint"
] | [((2332, 2353), 'random.shuffle', 'shuffle', (['self.choices'], {}), '(self.choices)\n', (2339, 2353), False, 'from random import randint, shuffle\n'), ((872, 900), 'random.randint', 'randint', (['(1)', 'self.door_amount'], {}), '(1, self.door_amount)\n', (879, 900), False, 'from random import randint, shuffle\n'), ((1... |
# !/usr/bin/env python
# -*- coding:utf-8 -*-
import functools
from inspect import signature
def expected_type(*type_args, **type_kwargs):
def decorator(fn):
@functools.wraps(fn)
def checker(*args, **kwargs):
fn_signature = signature(fn)
input_value = fn_signature.bind(*ar... | [
"inspect.signature",
"functools.wraps"
] | [((174, 193), 'functools.wraps', 'functools.wraps', (['fn'], {}), '(fn)\n', (189, 193), False, 'import functools\n'), ((259, 272), 'inspect.signature', 'signature', (['fn'], {}), '(fn)\n', (268, 272), False, 'from inspect import signature\n')] |
"""Flask plugin. Includes a path helper that allows you to pass a view
function to `path`. Inspects URL rules and view docstrings.
Passing a view function::
from flask import Flask
app = Flask(__name__)
@app.route('/gists/<gist_id>')
def gist_detail(gist_id):
'''Gist detail view.
---... | [
"apispec.exceptions.APISpecError",
"apispec.yaml_utils.load_yaml_from_docstring",
"apispec.yaml_utils.load_operations_from_docstring",
"re.compile"
] | [((1976, 2013), 're.compile', 're.compile', (['"""<(?:[^:<>]+:)?([^<>]+)>"""'], {}), "('<(?:[^:<>]+:)?([^<>]+)>')\n", (1986, 2013), False, 'import re\n'), ((2637, 2693), 'apispec.exceptions.APISpecError', 'APISpecError', (['f"""Could not find endpoint for view {view}"""'], {}), "(f'Could not find endpoint for view {vie... |
# stdlib imports
import os
from collections import OrderedDict
from datetime import datetime, timedelta
import logging
# third party imports
import numpy as np
from obspy.core.trace import Stats
# local imports
from gmprocess.io.seedname import get_channel_name, get_units_type
from gmprocess.core.stationtrace import ... | [
"logging.debug",
"gmprocess.core.stationtrace.StationTrace",
"obspy.core.trace.Stats",
"os.path.basename",
"logging.warning",
"gmprocess.core.stationstream.StationStream",
"gmprocess.io.seedname.get_channel_name",
"numpy.genfromtxt",
"datetime.datetime.strptime",
"gmprocess.io.utils.is_binary",
... | [((924, 967), 'logging.debug', 'logging.debug', (['"""Checking if format is cwb."""'], {}), "('Checking if format is cwb.')\n", (937, 967), False, 'import logging\n'), ((975, 994), 'gmprocess.io.utils.is_binary', 'is_binary', (['filename'], {}), '(filename)\n', (984, 994), False, 'from gmprocess.io.utils import is_bina... |
#!/usr/bin/env python
import sys
import inspect
import re
import optparse
import vtk
from pydoc import classname
'''
This is a translation from the TCL code of the same name.
'''
vtk.vtkObject.GlobalWarningDisplayOff()
def RedirectVTKMessages():
'''
Can be used to redirect VTK related error messages to a... | [
"optparse.OptionParser",
"re.compile",
"re.match",
"vtk.vtkFileOutputWindow",
"vtk.vtkObject.GlobalWarningDisplayOff",
"inspect.getmembers"
] | [((185, 224), 'vtk.vtkObject.GlobalWarningDisplayOff', 'vtk.vtkObject.GlobalWarningDisplayOff', ([], {}), '()\n', (222, 224), False, 'import vtk\n'), ((349, 374), 'vtk.vtkFileOutputWindow', 'vtk.vtkFileOutputWindow', ([], {}), '()\n', (372, 374), False, 'import vtk\n'), ((2847, 2866), 're.compile', 're.compile', (['pat... |
from web_scraping_utils import *
from postgresql_login import postgresql_login
from sqlalchemy import create_engine
year = '2021'
month ='Abril'
table_name = 'usd_values'
def load_data_into_postgresql_table(df):
# Prepare login info
postgresql_str = 'postgresql://{user}:{password}@{host}:{port}/{dbname}'\
... | [
"sqlalchemy.create_engine"
] | [((414, 443), 'sqlalchemy.create_engine', 'create_engine', (['postgresql_str'], {}), '(postgresql_str)\n', (427, 443), False, 'from sqlalchemy import create_engine\n')] |
import numpy as np
import gym
from gym import spaces
import math
MAX_MARCH = 20
EPSILON = 0.1
DEG_TO_RAD = 0.0174533
WINDOW_SIZE = [300, 300]
#
# Objects
#
def generate_box(pos=None, size=[10, 25], inside_window=True, color=(255, 255, 255), is_goal=False,
is_visible=True, is_obstacle=True):
'''
... | [
"pygame.draw.line",
"numpy.abs",
"numpy.arctan2",
"pygame.Rect",
"gym.spaces.Discrete",
"numpy.argmin",
"numpy.clip",
"pygame.display.update",
"numpy.sin",
"numpy.linalg.norm",
"pygame.display.set_mode",
"numpy.append",
"math.cos",
"numpy.random.choice",
"pygame.draw.polygon",
"pygame.... | [((505, 562), 'numpy.random.uniform', 'np.random.uniform', (['[size[0], size[0]]', '[size[1], size[1]]'], {}), '([size[0], size[0]], [size[1], size[1]])\n', (522, 562), True, 'import numpy as np\n'), ((1185, 1224), 'numpy.random.uniform', 'np.random.uniform', (['radius[0]', 'radius[1]'], {}), '(radius[0], radius[1])\n'... |
# Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"tensorflow_federated.python.learning.templates.client_works.ClientWorkProcess",
"tensorflow.keras.optimizers.SGD",
"tensorflow_federated.python.learning.templates.distributors.build_broadcast_process",
"tensorflow.nest.map_structure",
"tensorflow_federated.python.common_libs.py_typecheck.check_callable",
... | [((3621, 3693), 'tensorflow_federated.python.learning.framework.dataset_reduce.build_dataset_reduce_fn', 'dataset_reduce.build_dataset_reduce_fn', (['use_experimental_simulation_loop'], {}), '(use_experimental_simulation_loop)\n', (3659, 3693), False, 'from tensorflow_federated.python.learning.framework import dataset_... |
from shapely import geometry
from shapely.geometry import shape, Point
import geohash as gh
import numpy as np
import pandas as pd
import numpy as np
import sys
import pandas as pd
import datetime
import random
from random import choices
# get train acc and test acc
# Train acc from 2017 to 2019 May
#Test acc from 2... | [
"pandas.DataFrame",
"numpy.random.uniform",
"pandas.read_csv",
"random.choices",
"random.random",
"datetime.datetime.strptime",
"geohash.bbox",
"pandas.concat"
] | [((692, 709), 'pandas.concat', 'pd.concat', (['frames'], {}), '(frames)\n', (701, 709), True, 'import pandas as pd\n'), ((1090, 1106), 'geohash.bbox', 'gh.bbox', (['geohash'], {}), '(geohash)\n', (1097, 1106), True, 'import geohash as gh\n'), ((1312, 1347), 'numpy.random.uniform', 'np.random.uniform', (['min_lng', 'max... |
"""
The trainer class.
Library: Tensowflow 2.2.0, pyTorch 1.5.1
Author: <NAME>
Email: <EMAIL>
"""
from __future__ import absolute_import, division, print_function
from util.validation import *
from util.logger import *
try:
from tqdm import tqdm
from tqdm import trange
except ImportError:
print("tqdm a... | [
"tqdm.trange"
] | [((2478, 2557), 'tqdm.trange', 'trange', (['self.epoch', 'self.num_epoches'], {'position': '(0)', 'desc': '"""Train"""', 'ncols': 'TQDM_COLS'}), "(self.epoch, self.num_epoches, position=0, desc='Train', ncols=TQDM_COLS)\n", (2484, 2557), False, 'from tqdm import trange\n')] |
"""Data type class for the variables containing all the methods related to data types."""
from enum import Enum, auto
from typing import Any
class DataType(Enum):
"""Data type of a variable in the driver."""
String = auto()
RawString = auto()
Integer = auto()
IntegerExt = auto()
Boolean = auto()
Float = auto(... | [
"enum.auto"
] | [((222, 228), 'enum.auto', 'auto', ([], {}), '()\n', (226, 228), False, 'from enum import Enum, auto\n'), ((242, 248), 'enum.auto', 'auto', ([], {}), '()\n', (246, 248), False, 'from enum import Enum, auto\n'), ((260, 266), 'enum.auto', 'auto', ([], {}), '()\n', (264, 266), False, 'from enum import Enum, auto\n'), ((28... |
#!/usr/bin/env python
from __future__ import unicode_literals
import traceback
import pwd
import os
from os.path import join, isfile
import subprocess
import importlib
# Local imports
from .base_evaluator import BaseEvaluator
from .file_utils import copy_files, delete_files
class JavaCodeEvaluator(BaseEvaluator):
... | [
"os.getcwd",
"os.remove",
"os.path.isfile",
"os.path.exists"
] | [((1049, 1086), 'os.path.exists', 'os.path.exists', (['self.submit_code_path'], {}), '(self.submit_code_path)\n', (1063, 1086), False, 'import os\n'), ((1144, 1181), 'os.path.exists', 'os.path.exists', (['self.user_output_path'], {}), '(self.user_output_path)\n', (1158, 1181), False, 'import os\n'), ((1239, 1275), 'os.... |
# Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 <NAME>.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
import os
import warnings
import unittest
from . import parser_test_case
from pygccxml import utils
class Test(parser_test_case.pa... | [
"warnings.simplefilter",
"pygccxml.utils.utils.DeprecationWrapper",
"unittest.TestSuite",
"pygccxml.utils.utils.contains_parent_dir",
"unittest.TextTestRunner",
"unittest.makeSuite",
"warnings.catch_warnings",
"os.path.normpath"
] | [((1594, 1614), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (1612, 1614), False, 'import unittest\n'), ((375, 426), 'os.path.normpath', 'os.path.normpath', (['"""/mypath/folder1/folder2/folder3"""'], {}), "('/mypath/folder1/folder2/folder3')\n", (391, 426), False, 'import os\n'), ((1052, 1143), 'pygcc... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
import argparse
import logging
import os
import subprocess
import random
import cv2
import numpy as np
import sys
python_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(0, python_dir)
from cuberite_process import CuberitePr... | [
"numpy.load",
"argparse.ArgumentParser",
"numpy.argmax",
"os.path.isfile",
"numpy.mean",
"numpy.sin",
"os.path.join",
"random.randint",
"cuberite_process.CuberiteProcess",
"cv2.imwrite",
"os.path.dirname",
"subprocess.Popen",
"cv2.circle",
"os.path.realpath",
"numpy.cos",
"logging.basi... | [((249, 279), 'sys.path.insert', 'sys.path.insert', (['(0)', 'python_dir'], {}), '(0, python_dir)\n', (264, 279), False, 'import sys\n'), ((354, 424), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s [%(levelname)s]: %(message)s"""'}), "(format='%(asctime)s [%(levelname)s]: %(message)s')\n"... |
from .util import *
from .srs import *
from .geom import *
from .raster import *
from .vector import *
from .extent import Extent
from io import BytesIO
MaskAndExtent = namedtuple("MaskAndExtent", "mask extent id")
class RegionMask(object):
"""The RegionMask object represents a given region and exposes methods al... | [
"matplotlib.pyplot.subplot",
"io.BytesIO",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig"
] | [((19065, 19074), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (19072, 19074), False, 'from io import BytesIO\n'), ((19132, 19158), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(4, 4)'}), '(figsize=(4, 4))\n', (19142, 19158), True, 'import matplotlib.pyplot as plt\n'), ((19175, 19191), 'matplotlib.pyplot.s... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 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 u... | [
"re.findall"
] | [((8639, 8680), 're.findall', 're.findall', (['"""<@!?([0-9]+)>"""', 'self.content'], {}), "('<@!?([0-9]+)>', self.content)\n", (8649, 8680), False, 'import re\n'), ((8935, 8974), 're.findall', 're.findall', (['"""<#([0-9]+)>"""', 'self.content'], {}), "('<#([0-9]+)>', self.content)\n", (8945, 8974), False, 'import re\... |
import os
from typing import Any, Dict, Optional
from airflow.hooks.filesystem import FSHook
from airflow.sensors.filesystem import FileSensor
from airflow.utils.context import Context
from astronomer.providers.core.triggers.filesystem import FileTrigger
class FileSensorAsync(FileSensor):
"""
Waits for a fi... | [
"airflow.hooks.filesystem.FSHook",
"astronomer.providers.core.triggers.filesystem.FileTrigger",
"os.path.join"
] | [((1058, 1081), 'airflow.hooks.filesystem.FSHook', 'FSHook', (['self.fs_conn_id'], {}), '(self.fs_conn_id)\n', (1064, 1081), False, 'from airflow.hooks.filesystem import FSHook\n'), ((1145, 1182), 'os.path.join', 'os.path.join', (['basepath', 'self.filepath'], {}), '(basepath, self.filepath)\n', (1157, 1182), False, 'i... |
from os import chdir, getcwd
from pytest import fixture
from detox_bridge import node
@fixture
def node_environment(tmpdir):
old = getcwd()
chdir(str(tmpdir))
open(".nvmrc", "w").write("v15.2.1")
yield node
chdir(old)
@fixture
def node_server(node_environment):
with node.start() as connect... | [
"os.getcwd",
"os.chdir",
"detox_bridge.node.start"
] | [((139, 147), 'os.getcwd', 'getcwd', ([], {}), '()\n', (145, 147), False, 'from os import chdir, getcwd\n'), ((231, 241), 'os.chdir', 'chdir', (['old'], {}), '(old)\n', (236, 241), False, 'from os import chdir, getcwd\n'), ((297, 309), 'detox_bridge.node.start', 'node.start', ([], {}), '()\n', (307, 309), False, 'from ... |
import memtkinter as tk
from memtkinter.megawidgets import SettingsViewer
if __name__ == '__main__':
root = tk.Tk(keytype=tk.HKCU, filepath='./test.xml', name='test')
sv = SettingsViewer(root)
root.mainloop() | [
"memtkinter.megawidgets.SettingsViewer",
"memtkinter.Tk"
] | [((114, 172), 'memtkinter.Tk', 'tk.Tk', ([], {'keytype': 'tk.HKCU', 'filepath': '"""./test.xml"""', 'name': '"""test"""'}), "(keytype=tk.HKCU, filepath='./test.xml', name='test')\n", (119, 172), True, 'import memtkinter as tk\n'), ((183, 203), 'memtkinter.megawidgets.SettingsViewer', 'SettingsViewer', (['root'], {}), '... |
import urllib2
class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
def http_error_301(self, req, fp, code, msg, headers):
result = urllib2.HTTPRedirectHandler.http_error_301(self, req, fp, code, msg, headers)
result.status = code
return result
def http_error_302(self, req, fp, cod... | [
"urllib2.HTTPRedirectHandler.http_error_302",
"urllib2.HTTPRedirectHandler.http_error_301"
] | [((150, 227), 'urllib2.HTTPRedirectHandler.http_error_301', 'urllib2.HTTPRedirectHandler.http_error_301', (['self', 'req', 'fp', 'code', 'msg', 'headers'], {}), '(self, req, fp, code, msg, headers)\n', (192, 227), False, 'import urllib2\n'), ((355, 432), 'urllib2.HTTPRedirectHandler.http_error_302', 'urllib2.HTTPRedire... |
import pytest
skip = False
if not skip:
@pytest.fixture(scope="module", params=["primary_assembly", "toplevel"])
def assembly(request):
return request.param
@pytest.fixture(scope="module", params=["98", None])
def release_version(request):
return request.param
@pytest.fixture(sco... | [
"pytest.fixture"
] | [((47, 118), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'params': "['primary_assembly', 'toplevel']"}), "(scope='module', params=['primary_assembly', 'toplevel'])\n", (61, 118), False, 'import pytest\n'), ((181, 232), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'params': "... |
import unittest
import numpy as np
from numpy import pi
from flow.core.experiment import SumoExperiment
from flow.core.params import SumoParams, EnvParams, InitialConfig, NetParams
from flow.core.vehicles import Vehicles
from flow.controllers.car_following_models import *
from flow.controllers.lane_change_controllers ... | [
"unittest.main",
"flow.core.params.EnvParams",
"flow.core.params.SumoParams",
"flow.core.vehicles.Vehicles",
"flow.envs.loop_merges.SimpleLoopMergesEnvironment",
"flow.core.experiment.SumoExperiment",
"flow.core.params.InitialConfig",
"flow.core.params.NetParams",
"flow.scenarios.loop_merges.loop_me... | [((610, 686), 'flow.core.params.SumoParams', 'SumoParams', ([], {'time_step': '(0.1)', 'human_speed_mode': '"""no_collide"""', 'sumo_binary': '"""sumo"""'}), "(time_step=0.1, human_speed_mode='no_collide', sumo_binary='sumo')\n", (620, 686), False, 'from flow.core.params import SumoParams, EnvParams, InitialConfig, Net... |
from typing import Optional, Union
import itertools as it
from collections import OrderedDict
import numpy as np
import pandas as pd
from ConfigSpace import ConfigurationSpace
class fANOVA:
def __init__(
self,
X: Union[pd.DataFrame, np.ndarray],
Y,
configspace: ConfigurationSpace... | [
"numpy.full",
"ConfigSpace.ConfigurationSpace",
"numpy.random.randn",
"numpy.std",
"sys.path.insert",
"numpy.isfinite",
"deepcave.evaluators.epm.fanova_forest.fANOVAForest",
"itertools.combinations",
"numpy.mean",
"numpy.array",
"ConfigSpace.hyperparameters.UniformFloatHyperparameter",
"collec... | [((10094, 10122), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../"""'], {}), "(0, '../../')\n", (10109, 10122), False, 'import sys\n'), ((10434, 10466), 'ConfigSpace.ConfigurationSpace', 'CS.ConfigurationSpace', ([], {'seed': '(1234)'}), '(seed=1234)\n', (10455, 10466), True, 'import ConfigSpace as CS\n'), ((... |
import os
import sys
sys.path.append(os.getcwd())
import pickle
import json
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import restools
from papers.none2021_predicting_transition_using_reservoir_computing.extensions import relaminarisation_time, \
survival_function, laminarization_probabi... | [
"json.load",
"matplotlib.pyplot.show",
"os.path.join",
"os.getcwd",
"comsdk.comaux.find_all_files_by_named_regexp",
"reducedmodels.transition_to_turbulence.MoehlisFaisstEckhardtModel",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.style.use",
"comsdk.research.Research.open",
"papers.none2021_pr... | [((37, 48), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (46, 48), False, 'import os\n'), ((2927, 2970), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""resources/default.mplstyle"""'], {}), "('resources/default.mplstyle')\n", (2940, 2970), True, 'import matplotlib.pyplot as plt\n'), ((3008, 3029), 'comsdk.researc... |
from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.forms import forms
from django.forms.models import modelformset_factory, formset_factory
from django.http import Http404, HttpResponseRedirect, HttpResponse
from django.shortcuts import get_object_or_404, render_to_r... | [
"models.Deck.objects.order_by",
"django.core.urlresolvers.reverse"
] | [((1698, 1734), 'models.Deck.objects.order_by', 'models.Deck.objects.order_by', (['"""name"""'], {}), "('name')\n", (1726, 1734), False, 'import models\n'), ((1389, 1413), 'django.core.urlresolvers.reverse', 'reverse', (['"""api-deck_list"""'], {}), "('api-deck_list')\n", (1396, 1413), False, 'from django.core.urlresol... |
#!/usr/bin/env python
import functools
import os.path
import random
import sys
import xml.etree.ElementTree
import numpy as np
import matplotlib.pyplot as plt
import skimage.data
import cv2
import PIL.Image
import pickle
def load_pascal_occluder(pascal_voc_root_path):
occluders = []
structuring_element = c... | [
"numpy.clip",
"numpy.random.randint",
"pickle.load",
"cv2.erode",
"numpy.round",
"timer.Timer",
"matplotlib.pyplot.subplots",
"cv2.resize",
"matplotlib.pyplot.show",
"cv2.countNonZero",
"numpy.asarray",
"numpy.concatenate",
"numpy.random.uniform",
"densepose.data.structures.DensePoseResult... | [((319, 371), 'cv2.getStructuringElement', 'cv2.getStructuringElement', (['cv2.MORPH_ELLIPSE', '(8, 8)'], {}), '(cv2.MORPH_ELLIPSE, (8, 8))\n', (344, 371), False, 'import cv2\n'), ((2989, 2996), 'timer.Timer', 'Timer', ([], {}), '()\n', (2994, 2996), False, 'from timer import Timer\n'), ((3043, 3095), 'cv2.getStructuri... |
#!/usr/bin/python
import csv
import sys
from lib.config import get_or_create as get_or_create_config
from lib.rest import REST_CONFIG_FIELDS, api_get, api_get_paged
config = get_or_create_config('config.ini', 'bamboo', REST_CONFIG_FIELDS)
auth = (config['username'], config['password'])
base_path = config['url']
writ... | [
"lib.rest.api_get_paged",
"lib.config.get_or_create",
"csv.writer",
"lib.rest.api_get"
] | [((177, 241), 'lib.config.get_or_create', 'get_or_create_config', (['"""config.ini"""', '"""bamboo"""', 'REST_CONFIG_FIELDS'], {}), "('config.ini', 'bamboo', REST_CONFIG_FIELDS)\n", (197, 241), True, 'from lib.config import get_or_create as get_or_create_config\n'), ((325, 347), 'csv.writer', 'csv.writer', (['sys.stdou... |
from starfish.core.experiment.builder import build_image, TileFetcher
from starfish.core.experiment.builder.defaultproviders import OnesTile, tile_fetcher_factory
from starfish.core.imagestack.imagestack import ImageStack
from starfish.core.types import Axes
def synthetic_stack(
num_round: int = 4,
nu... | [
"starfish.core.imagestack.imagestack.ImageStack.from_tileset",
"starfish.core.experiment.builder.defaultproviders.tile_fetcher_factory"
] | [((1086, 1118), 'starfish.core.imagestack.imagestack.ImageStack.from_tileset', 'ImageStack.from_tileset', (['tileset'], {}), '(tileset)\n', (1109, 1118), False, 'from starfish.core.imagestack.imagestack import ImageStack\n'), ((746, 831), 'starfish.core.experiment.builder.defaultproviders.tile_fetcher_factory', 'tile_f... |
# Generated by Django 4.0.2 on 2022-02-06 08:08
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL... | [
"django.db.models.BigAutoField",
"django.db.migrations.swappable_dependency",
"django.db.models.ForeignKey"
] | [((264, 321), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (295, 321), False, 'from django.db import migrations, models\n'), ((502, 598), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '... |
from __future__ import print_function
import numpy as np
import pandas as pd
import numpy.testing as npt
import pytest
import os
from collections import OrderedDict
import lifetimes.estimation as estimation
import lifetimes.utils as utils
from lifetimes.datasets import load_cdnow_summary, load_cdnow_summary_data_wit... | [
"lifetimes.datasets.load_cdnow_summary",
"os.remove",
"numpy.random.seed",
"numpy.arange",
"numpy.testing.assert_array_almost_equal",
"lifetimes.datasets.load_cdnow_summary_data_with_monetary_value",
"pandas.DataFrame",
"numpy.testing.assert_almost_equal",
"lifetimes.estimation.ModifiedBetaGeoFitter... | [((433, 453), 'lifetimes.datasets.load_cdnow_summary', 'load_cdnow_summary', ([], {}), '()\n', (451, 453), False, 'from lifetimes.datasets import load_cdnow_summary, load_cdnow_summary_data_with_monetary_value, load_donations, load_transaction_data\n'), ((1745, 1761), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n... |
# coding=utf-8
# Copyright (C) ATHENA 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 ... | [
"tensorflow.cast",
"tensorflow.math.minimum",
"tensorflow.math.rsqrt"
] | [((1604, 1634), 'tensorflow.cast', 'tf.cast', (['model_dim', 'tf.float32'], {}), '(model_dim, tf.float32)\n', (1611, 1634), True, 'import tensorflow as tf\n'), ((1722, 1754), 'tensorflow.cast', 'tf.cast', (['decay_steps', 'tf.float32'], {}), '(decay_steps, tf.float32)\n', (1729, 1754), True, 'import tensorflow as tf\n'... |
import setuptools
import versioneer
short_description = "A distributed compute and database platform for quantum chemistry."
try:
with open("README.md", "r") as handle:
long_description = handle.read()
except FileNotFoundError:
long_description = short_description
if __name__ == "__main__":
setu... | [
"versioneer.get_version",
"setuptools.find_packages",
"versioneer.get_cmdclass"
] | [((608, 632), 'versioneer.get_version', 'versioneer.get_version', ([], {}), '()\n', (630, 632), False, 'import versioneer\n'), ((651, 676), 'versioneer.get_cmdclass', 'versioneer.get_cmdclass', ([], {}), '()\n', (674, 676), False, 'import versioneer\n'), ((695, 721), 'setuptools.find_packages', 'setuptools.find_package... |
import json
import logging
import urllib3
from uuid import uuid4
import nexus
logger = logging.getLogger()
logger.setLevel(logging.INFO)
http = urllib3.PoolManager()
CFN_SUCCESS = "SUCCESS"
CFN_FAILED = "FAILED"
def handler(event, context):
def cfn_error(message=None):
logger.error("| cfn_error: %s" % m... | [
"uuid.uuid4",
"nexus.Nexus",
"json.dumps",
"urllib3.PoolManager",
"logging.getLogger"
] | [((88, 107), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (105, 107), False, 'import logging\n'), ((145, 166), 'urllib3.PoolManager', 'urllib3.PoolManager', ([], {}), '()\n', (164, 166), False, 'import urllib3\n'), ((2595, 2619), 'json.dumps', 'json.dumps', (['responseBody'], {}), '(responseBody)\n', (26... |
# Copyright (c) 2019, CNRS-LAAS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the... | [
"numpy.isfinite",
"matplotlib.pyplot.figure",
"numpy.where",
"datetime.timedelta",
"datetime.datetime.now"
] | [((5389, 5412), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (5410, 5412), False, 'import datetime\n'), ((6491, 6503), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (6501, 6503), True, 'import matplotlib.pyplot as plt\n'), ((3361, 3454), 'numpy.where', 'np.where', (["((old_fire_map.... |
import os
from datetime import date
from typing import List
import requests
from bs4 import BeautifulSoup
from context_types import (
HttpRequestParameters,
SearchContext,
SearchRequest,
SearchResult,
SearchResultPage,
)
from document_utilities import DocUtil
from utilities import F... | [
"utilities.Folders.responses",
"context_types.HttpRequestParameters",
"document_utilities.DocUtil.get_year",
"datetime.date.today",
"os.path.isfile",
"context_types.SearchResult",
"requests.get",
"context_types.SearchResultPage"
] | [((2015, 2047), 'context_types.HttpRequestParameters', 'HttpRequestParameters', (['page', 'url'], {}), '(page, url)\n', (2036, 2047), False, 'from context_types import HttpRequestParameters, SearchContext, SearchRequest, SearchResult, SearchResultPage\n'), ((2402, 2489), 'requests.get', 'requests.get', (['http_request_... |
# encoding: utf-8
"""
trace.py
Created by <NAME> on 2009-09-06.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
import StringIO
import traceback
def trace ():
buff = StringIO.StringIO()
traceback.print_exc(file=buff)
r = buff.getvalue()
buff.close()
return r
| [
"traceback.print_exc",
"StringIO.StringIO"
] | [((186, 205), 'StringIO.StringIO', 'StringIO.StringIO', ([], {}), '()\n', (203, 205), False, 'import StringIO\n'), ((207, 237), 'traceback.print_exc', 'traceback.print_exc', ([], {'file': 'buff'}), '(file=buff)\n', (226, 237), False, 'import traceback\n')] |
#runas import numpy as np; n = 20; a = np.arange(n*n*n).reshape((n,n,n)).astype(np.uint8); b = 2. ; goodExpoMeasure(a, b)
#pythran export goodExpoMeasure(uint8[][][], float)
import numpy
def goodExpoMeasure(inRGB, sigma):
'''
Compute the good exposition image quality measure on 1 input image.
'''
R = in... | [
"numpy.round",
"numpy.exp"
] | [((455, 489), 'numpy.exp', 'numpy.exp', (['(-(R - 128) ** 2 / sigma)'], {}), '(-(R - 128) ** 2 / sigma)\n', (464, 489), False, 'import numpy\n'), ((507, 541), 'numpy.exp', 'numpy.exp', (['(-(G - 128) ** 2 / sigma)'], {}), '(-(G - 128) ** 2 / sigma)\n', (516, 541), False, 'import numpy\n'), ((559, 593), 'numpy.exp', 'nu... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 30 12:27:27 2020
@author: panton01
"""
### ----------------- IMPORTS ----------------- ###
import json
import matplotlib.pyplot as plt
from matplotlib.widgets import Button, SpanSelector, TextBox
from user_gui.user_verify import UserVerify
### ----------------------------... | [
"matplotlib.pyplot.show",
"json.loads",
"matplotlib.pyplot.axes",
"matplotlib.widgets.TextBox",
"user_gui.verify_gui.fig.suptitle",
"matplotlib.widgets.Button",
"user_gui.verify_gui.matplotGui",
"user_gui.user_verify.UserVerify",
"user_gui.verify_gui.fig.canvas.mpl_connect"
] | [((713, 735), 'user_gui.user_verify.UserVerify', 'UserVerify', (['input_path'], {}), '(input_path)\n', (723, 735), False, 'from user_gui.user_verify import UserVerify\n'), ((472, 490), 'json.loads', 'json.loads', (['config'], {}), '(config)\n', (482, 490), False, 'import json\n'), ((1184, 1281), 'user_gui.verify_gui.fi... |
from .models import User
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
password = serializers.CharField(max_length=20, min_length=8, trim_whitespace=False, write_only=True)
class Meta:
model = User
fields = ('id', 'nickname', 'username', 'email', 'pa... | [
"rest_framework.serializers.CharField"
] | [((131, 225), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'max_length': '(20)', 'min_length': '(8)', 'trim_whitespace': '(False)', 'write_only': '(True)'}), '(max_length=20, min_length=8, trim_whitespace=False,\n write_only=True)\n', (152, 225), False, 'from rest_framework import serialize... |
from __future__ import division, print_function
import numpy as np
from dipy.denoise.nlmeans_block import nlmeans_block
def non_local_means(arr, sigma, mask=None, patch_radius=1, block_radius=5,
rician=True):
r""" Non-local means for denoising 3D and 4D images, using
blockwise averagi... | [
"numpy.zeros_like",
"numpy.double",
"numpy.isscalar",
"numpy.ones",
"numpy.int",
"numpy.ascontiguousarray"
] | [((1669, 1732), 'numpy.ones', 'np.ones', (['(arr.shape[0], arr.shape[1], arr.shape[2])'], {'dtype': '"""f8"""'}), "((arr.shape[0], arr.shape[1], arr.shape[2]), dtype='f8')\n", (1676, 1732), True, 'import numpy as np\n'), ((1758, 1796), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['mask'], {'dtype': '"""f8"""'})... |
from setuptools import setup, find_packages
setup(
name='pyRandomWalk',
version='0.0.1',
packages=find_packages(where='src'),
install_requires=['numpy', 'pandas', 'little_helpers']
)
| [
"setuptools.find_packages"
] | [((111, 137), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (124, 137), False, 'from setuptools import setup, find_packages\n')] |
#!/usr/bin/env python
"""
Python package for the fuzzware emulator.
"""
import os
import subprocess
import sys
from distutils.command.build import build
from setuptools import setup
class Build(build):
"""Customized setuptools build command - builds native unicorn bindings on build."""
def run(self):
... | [
"distutils.command.build.build.run",
"os.walk",
"subprocess.call",
"os.path.split",
"sys.exit"
] | [((564, 580), 'os.walk', 'os.walk', (['rel_dir'], {}), '(rel_dir)\n', (571, 580), False, 'import os\n'), ((482, 497), 'distutils.command.build.build.run', 'build.run', (['self'], {}), '(self)\n', (491, 497), False, 'from distutils.command.build import build\n'), ((411, 442), 'subprocess.call', 'subprocess.call', (['pro... |
'''
Created on 2 Dec 2017
@author: julianporter
'''
from .findSource import findFiles
from setuptools import Command
import shutil
import os
class Cleaner(Command) :
description='Perform a true deep clean, removing distributions, builds and egg-info'
user_options=[]
def __init__(self,d... | [
"shutil.rmtree",
"os.remove"
] | [((1543, 1555), 'os.remove', 'os.remove', (['o'], {}), '(o)\n', (1552, 1555), False, 'import os\n'), ((700, 724), 'shutil.rmtree', 'shutil.rmtree', (['directory'], {}), '(directory)\n', (713, 724), False, 'import shutil\n'), ((1036, 1051), 'os.remove', 'os.remove', (['file'], {}), '(file)\n', (1045, 1051), False, 'impo... |
from aoc import AOC
aoc = AOC(year=__year__, day=__day__)
data = aoc.load()
| [
"aoc.AOC"
] | [((27, 58), 'aoc.AOC', 'AOC', ([], {'year': '__year__', 'day': '__day__'}), '(year=__year__, day=__day__)\n', (30, 58), False, 'from aoc import AOC\n')] |
# Copyright (c) 2018, The Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, thi... | [
"smach.State.__init__",
"time.sleep"
] | [((1771, 1816), 'smach.State.__init__', 'smach.State.__init__', (['self'], {'outcomes': "['next']"}), "(self, outcomes=['next'])\n", (1791, 1816), False, 'import smach\n'), ((1911, 1942), 'time.sleep', 'time.sleep', (['self._wait_time_sec'], {}), '(self._wait_time_sec)\n', (1921, 1942), False, 'import time\n'), ((2236,... |
from django.shortcuts import render
from models import *
from forms import *
# Create your views here.
def homepage(request):
# get top five blogs here
latest_article = Article.objects.order_by('-article_published_time')[:5]
page_name = 'ME_KUN_HAN'
context = {'latest_article': latest_article, 'page_na... | [
"django.shortcuts.render"
] | [((346, 389), 'django.shortcuts.render', 'render', (['request', '"""blog/index.html"""', 'context'], {}), "(request, 'blog/index.html', context)\n", (352, 389), False, 'from django.shortcuts import render\n'), ((1180, 1226), 'django.shortcuts.render', 'render', (['request', '"""blog/pagelist.html"""', 'context'], {}), ... |
import os
import re
from pdb import set_trace
from os.path import join
def main():
data_root = os.path.expanduser("~/dataset/pets/train")
name2dir = {}
for dir in os.listdir(data_root):
catergory_name = re.match(r'([a-zA-Z_]*)_[0-9]*.jpg', os.listdir(join(data_root, dir))[0])
... | [
"re.match",
"os.path.expanduser",
"os.listdir",
"os.path.join"
] | [((108, 150), 'os.path.expanduser', 'os.path.expanduser', (['"""~/dataset/pets/train"""'], {}), "('~/dataset/pets/train')\n", (126, 150), False, 'import os\n'), ((190, 211), 'os.listdir', 'os.listdir', (['data_root'], {}), '(data_root)\n', (200, 211), False, 'import os\n'), ((518, 566), 're.match', 're.match', (['"""([... |
# $Id: Box.py,v 1.1.2.1 2007/01/06 10:44:59 marcusva Exp $
#
# Copyright (c) 2007, <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above ... | [
"Container.Container.__init__",
"Container.Container.draw",
"base.GlobalStyle.engine.draw_box"
] | [((2084, 2108), 'Container.Container.__init__', 'Container.__init__', (['self'], {}), '(self)\n', (2102, 2108), False, 'from Container import Container\n'), ((2754, 2792), 'base.GlobalStyle.engine.draw_box', 'base.GlobalStyle.engine.draw_box', (['self'], {}), '(self)\n', (2786, 2792), False, 'import base\n'), ((2927, 2... |
# api: python
# title: faulthandler
# description: capture fatal errors / memory fauls / Gtk and threading bugs
# version: -1
# type: io
# category: debug
# priority: development
#
# Debug Gtk/glibs/python/threading crashes.
#
# * Gdk:ERROR:/build/buildd/gtk+2.0-2.24.23/gdk/gdkregion-generic.c:1110:miUnionNonO:
# ass... | [
"faulthandler.enable"
] | [((422, 443), 'faulthandler.enable', 'faulthandler.enable', ([], {}), '()\n', (441, 443), False, 'import faulthandler\n')] |
def set(username):
import requests
from bs4 import BeautifulSoup
global user
global url
global response
global soup
user = username
url = "https://github.com/"+user
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
user_tg = soup.find('span', cla... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((212, 229), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (224, 229), False, 'import requests\n'), ((241, 284), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.text', '"""html.parser"""'], {}), "(response.text, 'html.parser')\n", (254, 284), False, 'from bs4 import BeautifulSoup\n'), ((2519, 2536), 'req... |
"""
Class for the products produced by Acme Corportation.
"""
from random import randint
class Product:
"""Product class parameters:
name(=None)
price(=10)
weight(=20)
flammability(=0.5)
Methods:
stealability (Determines likelihood of product theft.)
explode (Likelihood the product wil... | [
"random.randint"
] | [((441, 467), 'random.randint', 'randint', (['(1000000)', '(10000000)'], {}), '(1000000, 10000000)\n', (448, 467), False, 'from random import randint\n'), ((1564, 1590), 'random.randint', 'randint', (['(1000000)', '(10000000)'], {}), '(1000000, 10000000)\n', (1571, 1590), False, 'from random import randint\n')] |
import random
from locust import User, task, between
from locust_task import MilvusTask
from client import MilvusClient
from milvus import DataType
connection_type = "single"
host = "192.168.1.6"
port = 19530
collection_name = "create_collection_hello"
dim = 128
nb = 50000
m = MilvusClient(host=host, port=port, collec... | [
"locust_task.MilvusTask",
"client.MilvusClient",
"random.random",
"locust.between",
"locust.task"
] | [((279, 346), 'client.MilvusClient', 'MilvusClient', ([], {'host': 'host', 'port': 'port', 'collection_name': 'collection_name'}), '(host=host, port=port, collection_name=collection_name)\n', (291, 346), False, 'from client import MilvusClient\n'), ((603, 624), 'locust.between', 'between', (['(0.001)', '(0.002)'], {}),... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.reduce_sum",
"tensorflow.distribute.get_strategy",
"official.utils.misc.keras_utils.set_session_config",
"tensorflow.keras.metrics.Mean",
"tensorflow.keras.mixed_precision.experimental.LossScaleOptimizer",
"tensorflow.train.experimental.enable_mixed_precision_graph_rewrite",
"official.vision... | [((1407, 1529), 'absl.flags.DEFINE_boolean', 'flags.DEFINE_boolean', ([], {'name': '"""use_tf_function"""', 'default': '(True)', 'help': '"""Wrap the train and test step inside a tf.function."""'}), "(name='use_tf_function', default=True, help=\n 'Wrap the train and test step inside a tf.function.')\n", (1427, 1529)... |
# Copyright 2017 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 acc... | [
"mxnet.init.Uniform",
"numpy.random.uniform",
"mxnet.initializer.Orthogonal",
"numpy.linalg.svd",
"mxnet.init.Xavier",
"numpy.random.normal",
"numpy.eye",
"mxnet.init.Normal",
"logging.getLogger"
] | [((689, 716), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (706, 716), False, 'import logging\n'), ((1780, 1914), 'mxnet.init.Xavier', 'mx.init.Xavier', ([], {'rnd_type': 'default_init_xavier_rand_type', 'factor_type': 'default_init_xavier_factor_type', 'magnitude': 'default_init_scale'... |
from PIL import Image
image = Image.open('monro.jpg')
if image.mode != "RGB":
image = image.convert("RGB")
red, green, blue = image.split()
offset_pix = 50
coordinates_left_offset = (offset_pix, 0, image.width, image.height)
coordinates_bothsides_offset = (offset_pix*0.5, 0, image.width-offset_pix*0.5, image.hei... | [
"PIL.Image.blend",
"PIL.Image.merge",
"PIL.Image.open"
] | [((31, 54), 'PIL.Image.open', 'Image.open', (['"""monro.jpg"""'], {}), "('monro.jpg')\n", (41, 54), False, 'from PIL import Image\n'), ((577, 631), 'PIL.Image.blend', 'Image.blend', (['cropped_right_red', 'cropped_both_red', '(0.28)'], {}), '(cropped_right_red, cropped_both_red, 0.28)\n', (588, 631), False, 'from PIL i... |
from colorama import Fore, Back
from data_storing.assets.common import Timespan, MeasureUnit
import fundamentals.miscellaneous as fund_utils
from utilities.exchange_rates import Exchange
from utilities.common_methods import Methods as methods
from utilities import log
from utilities.common_methods import getDebugInfo
f... | [
"website_scraping.investing_dot_com.scraping_prices.ScrapingPrices",
"utilities.common_methods.getDebugInfo",
"datetime.date",
"data_storing.assets.database_manager.DatabaseManager.query_equity_by_id",
"utilities.common_methods.Methods.validate",
"utilities.exchange_rates.Exchange.country.get",
"datetim... | [((4965, 5015), 'utilities.common_methods.Methods.backward_days', 'methods.backward_days', (["dates['end_date']", 'num_days'], {}), "(dates['end_date'], num_days)\n", (4986, 5015), True, 'from utilities.common_methods import Methods as methods\n'), ((8010, 8026), 'website_scraping.investing_dot_com.scraping_prices.Scra... |
import uuid
import cherrypy
from sqlalchemy.orm import Query
from deli_counter.http.mounts.root.routes.v1.auth.z.validation_models.roles import ResponseRole, RequestCreateRole, \
ParamsRole, ParamsListRole, RoleType
from ingredients_db.models.authz import AuthZRole
from ingredients_http.request_methods import Req... | [
"cherrypy.tools.model_params",
"deli_counter.http.mounts.root.routes.v1.auth.z.validation_models.roles.ResponseRole.from_database",
"cherrypy.tools.model_out",
"cherrypy.tools.resource_object",
"ingredients_http.route.Route",
"cherrypy.tools.enforce_policy",
"cherrypy.request.db_session",
"ingredients... | [((754, 790), 'ingredients_http.route.Route', 'Route', ([], {'methods': '[RequestMethods.POST]'}), '(methods=[RequestMethods.POST])\n', (759, 790), False, 'from ingredients_http.route import Route\n'), ((796, 842), 'cherrypy.tools.model_in', 'cherrypy.tools.model_in', ([], {'cls': 'RequestCreateRole'}), '(cls=RequestCr... |
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.mail import Mail
app = Flask(__name__)
app.config.from_object('notejam.config.Config')
db = SQLAlchemy(app)
from models import *
db.init_app(app)
db.create_all()
db.session.commit()
... | [
"flask.ext.sqlalchemy.SQLAlchemy",
"flask.Flask",
"flask.ext.mail.Mail",
"flask.ext.login.LoginManager"
] | [((158, 173), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (163, 173), False, 'from flask import Flask\n'), ((227, 242), 'flask.ext.sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (237, 242), False, 'from flask.ext.sqlalchemy import SQLAlchemy\n'), ((336, 350), 'flask.ext.login.LoginManag... |
#!/usr/bin/env python3
from __future__ import print_function
import os,argparse,logging,pdb,io,copy
import numpy as np
import time
import shutil
import molecules as rxmol
import chemfiles as rxccfile
def matchdihd(dihd,func):
a=(dihd[1].atomtype==func.a or func.a=='*')
b=(dihd[2].atomtype==func.b or func.b=='... | [
"os.mkdir",
"io.StringIO",
"chemfiles.File",
"copy.deepcopy",
"argparse.ArgumentParser",
"logging.basicConfig",
"molecules.Molecule",
"logging.error",
"logging.StreamHandler",
"time.perf_counter",
"os.system",
"logging.Formatter",
"logging.info",
"logging.critical",
"shutil.rmtree",
"o... | [((1800, 1820), 'os.mkdir', 'os.mkdir', (['foldername'], {}), '(foldername)\n', (1808, 1820), False, 'import os, argparse, logging, pdb, io, copy\n'), ((1825, 1845), 'os.chdir', 'os.chdir', (['foldername'], {}), '(foldername)\n', (1833, 1845), False, 'import os, argparse, logging, pdb, io, copy\n'), ((1913, 1936), 'che... |
"uxml2dict setup module."
def main():
from setuptools import setup
from uxml2dict import Xml2Dict as x2d
install_requires = ["microapp>=0.2.3", "xmltodict"]
setup(
name=x2d._name_,
version=x2d._version_,
description=x2d._description_,
long_description=x2d._long_descri... | [
"multiprocessing.freeze_support",
"setuptools.setup"
] | [((177, 1087), 'setuptools.setup', 'setup', ([], {'name': 'x2d._name_', 'version': 'x2d._version_', 'description': 'x2d._description_', 'long_description': 'x2d._long_description_', 'author': 'x2d._author_', 'author_email': 'x2d._author_email_', 'classifiers': "['Development Status :: 3 - Alpha', 'Intended Audience :: ... |
import sqlite3
conn = sqlite3.connect('NewDB.db')
cursor = conn.cursor()
table ="""CREATE TABLE STUDENT(NAME VARCHAR(255), CLASS VARCHAR(255), SECTION VARCHAR(255));"""
cursor.execute(table)
cursor.execute('''INSERT INTO STUDENT VALUES ('John', '8', 'A')''')
cursor.execute('''INSERT INTO STUDENT VALUES ('Ad... | [
"sqlite3.connect"
] | [((26, 53), 'sqlite3.connect', 'sqlite3.connect', (['"""NewDB.db"""'], {}), "('NewDB.db')\n", (41, 53), False, 'import sqlite3\n')] |
#!/usr/bin/env python
import io
import os
import re
from setuptools import setup
classifiers =[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Visualization",
"Programming Language :: Python",
... | [
"os.path.dirname",
"io.open"
] | [((649, 674), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (664, 674), False, 'import os\n'), ((740, 776), 'io.open', 'io.open', (['filepath'], {'encoding': 'encoding'}), '(filepath, encoding=encoding)\n', (747, 776), False, 'import io\n')] |
"""
Algorithm entry poing.
Methods of the APPO class initiate all other components (rollout & policy workers and learners) in the main thread,
and then fork their separate processes.
All data structures that are shared between processes are also created during the construction of APPO.
This class contains the algorith... | [
"multi_sample_factory.utils.utils.log.error",
"multi_sample_factory.utils.utils.cfg_file",
"multiprocessing.Lock",
"numpy.mean",
"multi_sample_factory.utils.utils.list_child_processes",
"collections.deque",
"multiprocessing.cpu_count",
"multi_sample_factory.algorithms.appo.population_based_training.Po... | [((2328, 2385), 'torch.multiprocessing.set_sharing_strategy', 'torch.multiprocessing.set_sharing_strategy', (['"""file_system"""'], {}), "('file_system')\n", (2370, 2385), False, 'import torch\n'), ((19399, 19427), 'multi_sample_factory.algorithms.appo.appo_utils.set_global_cuda_envvars', 'set_global_cuda_envvars', (['... |
"""
Module description:
"""
__version__ = '0.3.1'
__author__ = '<NAME>, <NAME>'
__email__ = '<EMAIL>, <EMAIL>'
from types import SimpleNamespace
import typing as t
import numpy as np
import logging as pylog
from elliot.utils import logging
from hyperopt import STATUS_OK
class ModelCoordinator(object):
"""
... | [
"numpy.average",
"types.SimpleNamespace",
"elliot.utils.logging.get_logger"
] | [((916, 1017), 'elliot.utils.logging.get_logger', 'logging.get_logger', (['self.__class__.__name__', '(pylog.CRITICAL if base.config_test else pylog.DEBUG)'], {}), '(self.__class__.__name__, pylog.CRITICAL if base.\n config_test else pylog.DEBUG)\n', (934, 1017), False, 'from elliot.utils import logging\n'), ((1681,... |
import tkinter as tk
from scanner import scanner
from multiprocessing import Process
import os
window = tk.Tk()
window.title("Scanner")
window.rowconfigure([0,1,2,3,4],minsize=50)
window.columnconfigure([0,1,3],minsize=50)
global plist
plist = []
def Scan(sig):
if sig == 1:
target = str(targetEntry.get()... | [
"tkinter.Entry",
"os.system",
"multiprocessing.Process",
"tkinter.Label",
"tkinter.Tk"
] | [((105, 112), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (110, 112), True, 'import tkinter as tk\n'), ((714, 753), 'tkinter.Label', 'tk.Label', ([], {'text': '"""Enter Target Name/IP: """'}), "(text='Enter Target Name/IP: ')\n", (722, 753), True, 'import tkinter as tk\n'), ((768, 778), 'tkinter.Entry', 'tk.Entry', ([], {... |
import os, sys
import torch
from torch.utils.data import Dataset
import imageio as io
import cv2
from sklearn.model_selection import StratifiedKFold
import numpy as np
from numpy.lib.stride_tricks import as_strided
mean = [0.485, 0.456, 0.406]
std = [0.229, 0.224, 0.225]
def imread(p):
img = io.imread(p)
# o... | [
"numpy.load",
"torch.LongTensor",
"imageio.imread",
"numpy.ascontiguousarray",
"numpy.transpose",
"numpy.random.RandomState",
"numpy.random.randint",
"numpy.array",
"sklearn.model_selection.StratifiedKFold",
"numpy.lib.stride_tricks.as_strided",
"os.path.splitext",
"os.path.join",
"os.listdi... | [((300, 312), 'imageio.imread', 'io.imread', (['p'], {}), '(p)\n', (309, 312), True, 'import imageio as io\n'), ((343, 401), 'cv2.resize', 'cv2.resize', (['img', '(224, 224)'], {'interpolation': 'cv2.INTER_CUBIC'}), '(img, (224, 224), interpolation=cv2.INTER_CUBIC)\n', (353, 401), False, 'import cv2\n'), ((534, 562), '... |
import time
from pytest import fixture
class MockHttpRequest:
_encoding = None
_upload_handlers = []
def __init__(self):
self.GET = {}
self.POST = {}
self.COOKIES = {}
self.META = {}
self.FILES = {}
self.path = ''
self.path_info = ''
self.me... | [
"cloudwatch_metrics.metric_middleware.CloudWatchMiddleware"
] | [((3191, 3231), 'cloudwatch_metrics.metric_middleware.CloudWatchMiddleware', 'CloudWatchMiddleware', (['(lambda x: response)'], {}), '(lambda x: response)\n', (3211, 3231), False, 'from cloudwatch_metrics.metric_middleware import CloudWatchMiddleware\n'), ((3902, 3942), 'cloudwatch_metrics.metric_middleware.CloudWatchM... |
import os
import numpy as np
import scipy.sparse
import psutil
def getMemUsageOfCurProcess_MiB(field='rss'):
# return the memory usage in MB
process = psutil.Process(os.getpid())
mem = getattr(process.memory_info(), field)
mem_MiB = mem / float(2 ** 20)
return mem_MiB
def calcObjSize_MiB(arr):
... | [
"os.getpid"
] | [((175, 186), 'os.getpid', 'os.getpid', ([], {}), '()\n', (184, 186), False, 'import os\n')] |
#
# 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... | [
"warnings.warn",
"pyspark.ml.util._jvm",
"ai.h2o.sparkling.Initializer.Initializer.load_sparkling_jar"
] | [((1475, 1507), 'ai.h2o.sparkling.Initializer.Initializer.load_sparkling_jar', 'Initializer.load_sparkling_jar', ([], {}), '()\n', (1505, 1507), False, 'from ai.h2o.sparkling.Initializer import Initializer\n'), ((1267, 1428), 'warnings.warn', 'warnings.warn', (['"""Constructor H2OConf(spark) with spark argument is depr... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"tink.jwt._jwt_error.JwtInvalidError",
"tink.proto.tink_pb2.KeyData.FromString",
"tink.cc.pybind.tink_bindings.register_jwt",
"tink.cc.pybind.tink_bindings.MacKeyManager.from_cc_registry",
"tink.jwt._jwt_format.split_signed_compact",
"tink.jwt._raw_jwt.RawJwt.from_json_payload",
"tink.proto.jwt_hmac_pb2... | [((3973, 4001), 'tink.cc.pybind.tink_bindings.register_jwt', 'tink_bindings.register_jwt', ([], {}), '()\n', (3999, 4001), False, 'from tink.cc.pybind import tink_bindings\n'), ((2400, 2441), 'tink.jwt._jwt_format.split_signed_compact', '_jwt_format.split_signed_compact', (['compact'], {}), '(compact)\n', (2432, 2441),... |
import json
#reading
stringOfJsonData = '{"name": "Bob", "isCat": true, "miceCaught": 0, "felineIQ": null}'
jsonDataAsPythonValue = json.loads(stringOfJsonData)
print(jsonDataAsPythonValue)
#alt print
print("\n")
print("Again with Dumps() \n")
print(json.dumps(jsonDataAsPythonValue))
#writing
#forma... | [
"json.loads",
"json.dumps"
] | [((137, 165), 'json.loads', 'json.loads', (['stringOfJsonData'], {}), '(stringOfJsonData)\n', (147, 165), False, 'import json\n'), ((262, 295), 'json.dumps', 'json.dumps', (['jsonDataAsPythonValue'], {}), '(jsonDataAsPythonValue)\n', (272, 295), False, 'import json\n')] |
import asyncio
import aiohttp
import discord
from async_rediscache import RedisSession
from botcore import StartupError
from botcore.site_api import APIClient
from discord.ext import commands
import bot
from bot import constants
from bot.bot import Bot
from bot.log import get_logger, setup_sentry
setup_sentry()
LOCA... | [
"async_rediscache.RedisSession",
"discord.AllowedMentions",
"discord.ext.commands.when_mentioned_or",
"bot.log.setup_sentry",
"discord.Object",
"aiohttp.ClientSession",
"bot.log.get_logger",
"botcore.site_api.APIClient",
"discord.Game",
"botcore.StartupError",
"discord.Intents.all"
] | [((301, 315), 'bot.log.setup_sentry', 'setup_sentry', ([], {}), '()\n', (313, 315), False, 'from bot.log import get_logger, setup_sentry\n'), ((462, 665), 'async_rediscache.RedisSession', 'RedisSession', ([], {'address': '(constants.Redis.host, constants.Redis.port)', 'password': 'constants.Redis.password', 'minsize': ... |
import tkinter as tk
class GUI:
def __init__(self, master):
self.table = [ ]
self.number_table = [ ]
for i in range(0, 9):
cols = [ ]
for j in range(0, 9):
e = tk.Entry(master, width=5, font=60)
e.grid(row=i, column=j)
... | [
"tkinter.StringVar",
"tkinter.mainloop",
"tkinter.Button",
"tkinter.Entry",
"tkinter.Label",
"tkinter.Tk"
] | [((4737, 4744), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (4742, 4744), True, 'import tkinter as tk\n'), ((4834, 4847), 'tkinter.mainloop', 'tk.mainloop', ([], {}), '()\n', (4845, 4847), True, 'import tkinter as tk\n'), ((391, 405), 'tkinter.StringVar', 'tk.StringVar', ([], {}), '()\n', (403, 405), True, 'import tkinter... |
from factory import fuzzy
from factory.django import DjangoModelFactory
from tidings.models import Watch
class WatchFactory(DjangoModelFactory):
class Meta:
model = Watch
event_type = "fooevent"
is_active = True
secret = fuzzy.FuzzyText(length=10)
| [
"factory.fuzzy.FuzzyText"
] | [((248, 274), 'factory.fuzzy.FuzzyText', 'fuzzy.FuzzyText', ([], {'length': '(10)'}), '(length=10)\n', (263, 274), False, 'from factory import fuzzy\n')] |
#
# This file is part of GreatFET
#
from __future__ import print_function
import sys
from warnings import warn
from ..interface import GreatFETInterface
from ..support.bits import bits
from ..protocol.jtag_svf import SVFParser, SVFEventHandler
class JTAGPatternError(IOError):
""" Class for errors that come fro... | [
"warnings.warn"
] | [((23663, 23774), 'warnings.warn', 'warn', (['"""SVF provided TRST command; but this implementation does not yet support driving the TRST line"""'], {}), "(\n 'SVF provided TRST command; but this implementation does not yet support driving the TRST line'\n )\n", (23667, 23774), False, 'from warnings import warn\n... |
import matplotlib
matplotlib.use('Agg')
from Swing.util.BoxPlot import BoxPlot
from matplotlib.backends.backend_pdf import PdfPages
from scipy import stats
import pdb
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import sys
import os
import time
from Swing.util.mplstyle import style1
import s... | [
"pandas.DataFrame",
"pandas.read_csv",
"scipy.stats.ttest_ind",
"time.time",
"seaborn.boxplot",
"matplotlib.use",
"numpy.mean",
"matplotlib.pyplot.subplots",
"os.listdir"
] | [((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((1417, 1428), 'time.time', 'time.time', ([], {}), '()\n', (1426, 1428), False, 'import time\n'), ((1603, 1614), 'time.time', 'time.time', ([], {}), '()\n', (1612, 1614), False, 'import time\n'), (... |
"""
it runs some tests on the source code ranging from formatting
to type checking with mypy
"""
from pathlib import Path
import subprocess
import shlex
import black # type: ignore[import]
import sys
import os
here = Path(os.path.abspath(__file__)).parent
all_scripts = [here / "corpe.py", here / "tests.py"]
all_sc... | [
"black.FileMode",
"os.path.abspath",
"sys.argv.append",
"shlex.join",
"subprocess.call",
"os.listdir"
] | [((557, 577), 'subprocess.call', 'subprocess.call', (['cmd'], {}), '(cmd)\n', (572, 577), False, 'import subprocess\n'), ((227, 252), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (242, 252), False, 'import os\n'), ((642, 666), 'sys.argv.append', 'sys.argv.append', (['"""-full"""'], {}), "('... |
# -*- coding: utf-8 -*-
from conans import CMake, ConanFile, tools
import os
class VulkanHppConan(ConanFile):
name = "vulkan_hpp"
version = "1.1.107"
license = "Apache-2.0"
author = "bincrafters <<EMAIL>>"
url = "https://github.com/bincrafters-conan-vulkan_hpp"
homepage = "https://github.com/... | [
"os.path.join",
"conans.tools.replace_in_file",
"conans.CMake",
"conans.tools.save_append",
"conans.tools.replace_path_in_file"
] | [((1095, 1149), 'os.path.join', 'os.path.join', (['self._source_subfolder', '"""CMakeLists.txt"""'], {}), "(self._source_subfolder, 'CMakeLists.txt')\n", (1107, 1149), False, 'import os\n'), ((1158, 1343), 'conans.tools.replace_in_file', 'tools.replace_in_file', (['cmakelists', '"""project(VulkanHppGenerator)"""', '"""... |
# coding: utf-8
"""
Decision Lens API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import... | [
"six.iteritems",
"dlxapi.configuration.Configuration"
] | [((7649, 7682), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (7662, 7682), False, 'import six\n'), ((1772, 1787), 'dlxapi.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1785, 1787), False, 'from dlxapi.configuration import Configuration\n')] |
''' This is the main entry point for the probe
It will:
1. Read configuration from its database (probably a text file to start with)
2. Execute measurements as required (ping first, we'll add module support later, maybe)
3. Make those measurements available using prometheus style metrics on :9091/metrics (by default)
... | [
"random.random",
"time.sleep",
"prometheus_client.start_http_server",
"prometheus_client.Summary"
] | [((683, 753), 'prometheus_client.Summary', 'Summary', (['"""request_processing_seconds"""', '"""Time spent processing request"""'], {}), "('request_processing_seconds', 'Time spent processing request')\n", (690, 753), False, 'from prometheus_client import start_http_server, Summary\n'), ((886, 899), 'time.sleep', 'time... |
from enum import Enum
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
class ChoiceEnum(Enum):
@classmethod
def choices(cls):
return tuple((item.name, item.value) for item in cls)
class Category(ChoiceEnum):
company = 'Company satisfaction'
... | [
"django.db.models.CharField",
"django.db.models.NullBooleanField",
"django.core.validators.MinValueValidator",
"django.core.validators.MaxValueValidator"
] | [((484, 529), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1000)', 'null': '(False)'}), '(max_length=1000, null=False)\n', (500, 529), False, 'from django.db import models\n'), ((878, 912), 'django.db.models.NullBooleanField', 'models.NullBooleanField', ([], {'null': '(True)'}), '(null=True)\... |
# Copyright 2020 The T5 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
"absl.testing.absltest.main",
"tensorflow.compat.v1.enable_eager_execution",
"tensorflow.compat.v1.data.Dataset.range",
"t5.models.mesh_transformer.maybe_shuffle_and_subsample_dataset",
"tensorflow_datasets.as_numpy",
"tensorflow.compat.v1.data.get_output_shapes",
"tensorflow.compat.v1.disable_v2_behavi... | [((814, 838), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (836, 838), True, 'import tensorflow.compat.v1 as tf\n'), ((839, 866), 'tensorflow.compat.v1.enable_eager_execution', 'tf.enable_eager_execution', ([], {}), '()\n', (864, 866), True, 'import tensorflow.compat.v1 as tf\... |
# coding=utf-8
from django import forms
from modules.employee_management.employee_info.models import Employee
from modules.payroll_manage.payroll_detail.models import *
from modules.project_manage.models import Project
from modules.social_security.social_security_detail.models import *
SOCIAL_SECURITY_BALANCE = (
('... | [
"django.forms.ChoiceField"
] | [((1616, 1648), 'django.forms.ChoiceField', 'forms.ChoiceField', ([], {'label': 'u"""身份证号"""'}), "(label=u'身份证号')\n", (1633, 1648), False, 'from django import forms\n')] |
# Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | [
"os.path.dirname",
"os.path.exists"
] | [((751, 776), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (766, 776), False, 'import os\n'), ((831, 854), 'os.path.exists', 'os.path.exists', (['thepath'], {}), '(thepath)\n', (845, 854), False, 'import os\n')] |
#!/usr/bin/env python3
# zulip-send -- Sends a message to the specified recipients.
import argparse
import logging
import sys
from typing import Any, Dict
import zulip
logging.basicConfig()
log = logging.getLogger("zulip-send")
def do_send_message(client: zulip.Client, message_data: Dict[str, Any]) -> bool:
"... | [
"zulip.init_from_options",
"argparse.ArgumentParser",
"logging.basicConfig",
"sys.stdin.read",
"logging.getLogger"
] | [((171, 192), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (190, 192), False, 'import logging\n'), ((200, 231), 'logging.getLogger', 'logging.getLogger', (['"""zulip-send"""'], {}), "('zulip-send')\n", (217, 231), False, 'import logging\n'), ((2668, 2700), 'zulip.init_from_options', 'zulip.init_from_... |