code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
import cv2
import numpy as np
from scipy.sparse.linalg import spsolve
def fix_source(source, mask, shape, offset):
mydict = {}
counter = 0
for i in range(mask.shape[0]):
for j in range(mask.shape[1]):
if mask[i][j]>127:
mydict[(i+offset[0], j+off... | [
"numpy.uint8",
"scipy.sparse.linalg.spsolve",
"numpy.zeros"
] | [((387, 413), 'numpy.zeros', 'np.zeros', (['shape'], {'dtype': 'int'}), '(shape, dtype=int)\n', (395, 413), True, 'import numpy as np\n'), ((2100, 2113), 'scipy.sparse.linalg.spsolve', 'spsolve', (['A', 'b'], {}), '(A, b)\n', (2107, 2113), False, 'from scipy.sparse.linalg import spsolve\n'), ((2202, 2215), 'numpy.uint8... |
# Copyright (C) 2013 Ion Torrent Systems, Inc. All Rights Reserved
'''
Created on May 21, 2013
@author: ionadmin
'''
import logging
logger = logging.getLogger(__name__)
class AbstractStepData(object):
'''
Superclass for stepdata classes. SavedFields are fields that users set values for,
PrepopulatedFiel... | [
"logging.getLogger"
] | [((142, 169), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (159, 169), False, 'import logging\n')] |
"""
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
There can be duplicate points in the input.
Example 1:
Input: [[1,1],[2,2],[3,3]]
Output: 3
Explanation:
^
|
| o
| o
| o
+------------->
0 1 2 3 4
Example 2:
Input: [[1,1],[3,2],[5,3],[4,1],[2,3],... | [
"math.gcd"
] | [((1143, 1152), 'math.gcd', 'gcd', (['a', 'b'], {}), '(a, b)\n', (1146, 1152), False, 'from math import gcd\n')] |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | [
"django.db.models.Max",
"dataflow.shared.send_message.send_message",
"dataflow.stream.job.adaptors.FlinkAdaptor",
"json.dumps",
"dataflow.shared.log.stream_logger.exception",
"json.loads",
"dataflow.stream.handlers.processing_stream_job.get",
"dataflow.stream.utils.checkpoint_manager.CheckpointManager... | [((5499, 5519), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (5517, 5519), False, 'from django.db import transaction\n'), ((3760, 3821), 'dataflow.stream.handlers.processing_stream_job.get', 'processing_stream_job.get', (['self.job_id'], {'raise_exception': '(False)'}), '(self.job_id, raise_e... |
import sys
import time
import imageio
import tensorflow as tf
import numpy as np
image_path = sys.argv[1]
image = imageio.imread(image_path)
input_data = np.array([image])
print(input_data.shape)
saver = tf.train.import_meta_graph('./model.meta', clear_devices=True)
gpu_options = tf.GPUOptions(per_process_gpu_memo... | [
"numpy.array",
"tensorflow.train.import_meta_graph",
"imageio.imread",
"tensorflow.ConfigProto",
"tensorflow.GPUOptions",
"tensorflow.get_collection"
] | [((116, 142), 'imageio.imread', 'imageio.imread', (['image_path'], {}), '(image_path)\n', (130, 142), False, 'import imageio\n'), ((156, 173), 'numpy.array', 'np.array', (['[image]'], {}), '([image])\n', (164, 173), True, 'import numpy as np\n'), ((208, 270), 'tensorflow.train.import_meta_graph', 'tf.train.import_meta_... |
# Generated by Django 3.1.7 on 2021-10-28 15:53
from django.db import migrations
def extract_organization(apps, schema_editor):
Organization = apps.get_model("donations", "Organization")
Donation = apps.get_model("donations", "Donation")
for donation in Donation.objects.exclude(organization_name__exact=""... | [
"django.db.migrations.RunPython"
] | [((924, 966), 'django.db.migrations.RunPython', 'migrations.RunPython', (['extract_organization'], {}), '(extract_organization)\n', (944, 966), False, 'from django.db import migrations\n')] |
'''
## Replay Memory ##
# Adapted from: https://github.com/tambetm/simple_dqn/blob/master/src/replay_memory.py
# Creates replay memory buffer to add experiences to and sample batches of experiences from
'''
import numpy as np
import random
class ReplayMemory:
def __init__(self, args):
self.buffer_size = a... | [
"argparse.ArgumentParser",
"numpy.random.choice",
"numpy.random.randint",
"numpy.empty",
"random.randint"
] | [((4041, 4066), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4064, 4066), False, 'import argparse\n'), ((452, 494), 'numpy.empty', 'np.empty', (['self.buffer_size'], {'dtype': 'np.uint8'}), '(self.buffer_size, dtype=np.uint8)\n', (460, 494), True, 'import numpy as np\n'), ((520, 564), 'numpy... |
from setuptools import setup, find_packages
def parse_requirements(requirement_file):
with open(requirement_file) as f:
return f.readlines()
version = dict()
with open("./tweetscraper/utils/version.py") as fp:
exec(fp.read(), version)
setup(
name='tweet-scraper',
version=version['__version__... | [
"setuptools.find_packages"
] | [((337, 370), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests*']"}), "(exclude=['tests*'])\n", (350, 370), False, 'from setuptools import setup, find_packages\n')] |
#!/usr/bin/env python
# Author: Saya
# License: MIT
import rospy
from collision_warning import CollisionWarning
from min_dist_detection import MinDistDetection
from sound_min_dist_feedback import SoundMinDistFeedback
class CollisionPrevention:
def __init__(self):
rospy.init_node('collision_prevention', anonymous=... | [
"collision_warning.CollisionWarning",
"rospy.init_node",
"min_dist_detection.MinDistDetection",
"rospy.spin",
"sound_min_dist_feedback.SoundMinDistFeedback",
"rospy.loginfo"
] | [((550, 562), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (560, 562), False, 'import rospy\n'), ((270, 325), 'rospy.init_node', 'rospy.init_node', (['"""collision_prevention"""'], {'anonymous': '(True)'}), "('collision_prevention', anonymous=True)\n", (285, 325), False, 'import rospy\n'), ((328, 363), 'rospy.loginfo'... |
# from preprocess import *
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D
from keras.utils import to_categorical
from keras.models import load_model
from preprocess_spectrogram import *
import os
os.environ["PATH"] += os.pathsep + 'C:/Program Fi... | [
"keras.layers.Conv2D",
"keras.layers.Flatten",
"keras.layers.MaxPooling2D",
"keras.models.Sequential",
"keras.utils.to_categorical",
"keras.layers.Dense",
"keras.layers.Dropout",
"keras.optimizers.Adadelta"
] | [((885, 908), 'keras.utils.to_categorical', 'to_categorical', (['y_train'], {}), '(y_train)\n', (899, 908), False, 'from keras.utils import to_categorical\n'), ((922, 944), 'keras.utils.to_categorical', 'to_categorical', (['y_test'], {}), '(y_test)\n', (936, 944), False, 'from keras.utils import to_categorical\n'), ((9... |
#coding:utf-8
#
# id: bugs.core_3874
# title: Computed column appears in non-existant rows of left join
# decription:
# tracker_id: CORE-3874
# min_versions: ['2.5.3']
# versions: 2.5.3
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5.3
#... | [
"pytest.mark.version",
"firebird.qa.db_factory",
"firebird.qa.isql_act"
] | [((483, 544), 'firebird.qa.db_factory', 'db_factory', ([], {'page_size': '(4096)', 'sql_dialect': '(3)', 'init': 'init_script_1'}), '(page_size=4096, sql_dialect=3, init=init_script_1)\n', (493, 544), False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((672, 734), 'firebird.qa.isql_act', 'isql_act', (['"... |
# -*- coding: utf-8 -*-
import re
import pandas as pd
import math
def singleDari(s1):
s2 = re.sub(r'\n+', '।',s1)
s3 = re.sub(r'।+\s*।*', '।',s2)
return s3
def singleSpace(ss):
return re.sub(r'\s+\s*',' ',ss)
def sentenceSplit(str1):
return re.split(r'।|\?|!',str1)
def replaceMultiple(mainString... | [
"re.sub",
"math.ceil",
"re.split"
] | [((96, 119), 're.sub', 're.sub', (['"""\\\\n+"""', '"""।"""', 's1'], {}), "('\\\\n+', '।', s1)\n", (102, 119), False, 'import re\n'), ((128, 155), 're.sub', 're.sub', (['"""।+\\\\s*।*"""', '"""।"""', 's2'], {}), "('।+\\\\s*।*', '।', s2)\n", (134, 155), False, 'import re\n'), ((200, 227), 're.sub', 're.sub', (['"""\\\\s... |
import os
import smtplib
import mimetypes
import logging as log
from email.message import EmailMessage
from enum import Enum
from pyautomailer.importer import Importer
from pyautomailer.body import *
from pyautomailer.subject import Subject
from pyautomailer.attachment import Attachment
class PyAutoMailerMode(Enum):
... | [
"logging.getLogger",
"logging.StreamHandler",
"smtplib.SMTP",
"pyautomailer.subject.Subject",
"logging.Formatter",
"pyautomailer.attachment.Attachment",
"pyautomailer.importer.Importer",
"logging.FileHandler",
"os.path.basename",
"mimetypes.guess_type",
"email.message.EmailMessage"
] | [((915, 938), 'logging.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (928, 938), True, 'import logging as log\n'), ((1043, 1062), 'logging.StreamHandler', 'log.StreamHandler', ([], {}), '()\n', (1060, 1062), True, 'import logging as log\n'), ((1167, 1211), 'logging.Formatter', 'log.Formatter', (['"""... |
import numpy as np
import matplotlib.pyplot as plt
from pywrat import pywrat
import pandas as pd
#testing bufferflows
for year in range(1922,2003):
for month in range(1,13):
# print('Now Running %d-%d' % (year,month)) # now in pywrat.py
pywrat(month,year)
# pywrat(1, 1977) | [
"pywrat.pywrat"
] | [((251, 270), 'pywrat.pywrat', 'pywrat', (['month', 'year'], {}), '(month, year)\n', (257, 270), False, 'from pywrat import pywrat\n')] |
# ------------------------------------------------------------
# Copyright (c) 2017-present, SeetaTech, Co.,Ltd.
#
# Licensed under the BSD 2-Clause License.
# You should have received a copy of the BSD 2-Clause License
# along with the software. If not, See,
#
# <https://opensource.org/licenses/BSD-2-Clause>
#
# ... | [
"dragon.core.tensor_utils.GetStorage",
"importlib.import_module",
"copy.deepcopy"
] | [((1882, 1931), 'importlib.import_module', 'importlib.import_module', (['"""dragon.vm.torch.tensor"""'], {}), "('dragon.vm.torch.tensor')\n", (1905, 1931), False, 'import importlib\n'), ((2473, 2504), 'dragon.core.tensor_utils.GetStorage', 'tensor_utils.GetStorage', (['tensor'], {}), '(tensor)\n', (2496, 2504), False, ... |
import numpy as np
# Local Modules
from object import *
import utils
rng = np.random.default_rng()
def reflect_ray(n, eye, ph, roughness, diffuse=False):
if diffuse:
phi = rng.random() * 2 * np.pi
z = rng.random()
theta = np.arccos(z)
x = np.sin(theta) * np.cos(phi)
y = n... | [
"numpy.arccos",
"numpy.random.default_rng",
"utils.normalize",
"numpy.sqrt",
"numpy.random.random_sample",
"numpy.array",
"numpy.dot",
"numpy.cos",
"numpy.sin"
] | [((77, 100), 'numpy.random.default_rng', 'np.random.default_rng', ([], {}), '()\n', (98, 100), True, 'import numpy as np\n'), ((254, 266), 'numpy.arccos', 'np.arccos', (['z'], {}), '(z)\n', (263, 266), True, 'import numpy as np\n'), ((359, 372), 'numpy.cos', 'np.cos', (['theta'], {}), '(theta)\n', (365, 372), True, 'im... |
from django.contrib import admin, messages
from django.contrib.sites.admin import Site, SiteAdmin
from djvidscraper.forms import CreateVideoForm, CreateFeedForm
from djvidscraper.models import Feed, Video, VideoFile, FeaturedVideo
class AddAdmin(admin.ModelAdmin):
add_fieldsets = None
add_form = None
de... | [
"django.contrib.admin.site.unregister",
"django.contrib.admin.site.register",
"django.contrib.admin.util.flatten_fieldsets"
] | [((5728, 5764), 'django.contrib.admin.site.register', 'admin.site.register', (['Feed', 'FeedAdmin'], {}), '(Feed, FeedAdmin)\n', (5747, 5764), False, 'from django.contrib import admin, messages\n'), ((5765, 5803), 'django.contrib.admin.site.register', 'admin.site.register', (['Video', 'VideoAdmin'], {}), '(Video, Video... |
# coding=utf-8
# Copyright 2019 The Google Research 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 applicab... | [
"numpy.abs",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"numpy.power",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.argmax",
"sklearn.metrics.mean_squared_error",
"sklearn.metrics.roc_auc_score",
"numpy.sum",
"numpy.zeros",
"matplotlib.pyplot.figure",
"sklearn.metr... | [((5113, 5133), 'numpy.zeros', 'np.zeros', (['[division]'], {}), '([division])\n', (5121, 5133), True, 'import numpy as np\n'), ((5747, 5773), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 4)'}), '(figsize=(6, 4))\n', (5757, 5773), True, 'import matplotlib.pyplot as plt\n'), ((5776, 5801), 'matplotlib... |
import json
import unittest
from unittest.mock import MagicMock, Mock, PropertyMock, patch
import pandas as pd
from DateHistogram import DateHistogram
class DateHistogramUnit(unittest.TestCase):
def test_constructor__given_simple_csv__then_json_is_correct(self):
# Arrange
df = pd.read_csv("tests... | [
"unittest.main",
"DateHistogram.DateHistogram",
"json.dumps",
"pandas.read_csv"
] | [((1576, 1591), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1589, 1591), False, 'import unittest\n'), ((302, 346), 'pandas.read_csv', 'pd.read_csv', (['"""tests/data/stacked_simple.csv"""'], {}), "('tests/data/stacked_simple.csv')\n", (313, 346), True, 'import pandas as pd\n'), ((365, 402), 'DateHistogram.Date... |
from controllers.to_do_controller import get_all
def get_all_to_do_list():
print('*' * 30, '-' * 4, ' Lista de tarefas ', '-' * 4, '*' * 30)
print(get_all())
input('Digite qualquer tacla para voltar ao menu')
| [
"controllers.to_do_controller.get_all"
] | [((157, 166), 'controllers.to_do_controller.get_all', 'get_all', ([], {}), '()\n', (164, 166), False, 'from controllers.to_do_controller import get_all\n')] |
# Generated by Django 2.1.2 on 2019-04-30 12:16
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
... | [
"django.db.models.EmailField",
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.BooleanField",
"django.db.models.ImageField",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.mode... | [((7516, 7625), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""comments"""', 'to': '"""posts.Post"""'}), "(on_delete=django.db.models.deletion.CASCADE, related_name\n ='comments', to='posts.Post')\n", (7533, 7625), False, 'from django.d... |
import json
from functools import partial
from aiohttp import web
from aiohttp.web_exceptions import HTTPConflict
from server.core.common import LoggingMixin
from server.core.json_encoders import CustomJSONEncoder
from server.core.models import RecordNotFound
from server.core.models.jenkins_jobs import JenkinsJob
fro... | [
"aiohttp.web_exceptions.HTTPConflict",
"server.core.security.policy.require_permission",
"functools.partial",
"aiohttp.web.json_response",
"server.core.models.jenkins_jobs.JenkinsJob"
] | [((760, 799), 'server.core.security.policy.require_permission', 'require_permission', (['Permission.ADMIN_UI'], {}), '(Permission.ADMIN_UI)\n', (778, 799), False, 'from server.core.security.policy import require_permission, Permission\n'), ((1240, 1279), 'server.core.security.policy.require_permission', 'require_permis... |
'''
Python module for Mopidy Pummeluff registry.
'''
__all__ = (
'RegistryDict',
'REGISTRY',
)
import os
import json
from logging import getLogger
from mopidy_pummeluff import tags
LOGGER = getLogger(__name__)
class RegistryDict(dict):
'''
Class which can be used to retreive and write RFID tags t... | [
"logging.getLogger",
"os.path.exists",
"os.makedirs",
"os.path.dirname",
"json.load"
] | [((203, 222), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (212, 222), False, 'from logging import getLogger\n'), ((568, 602), 'os.path.exists', 'os.path.exists', (['self.registry_path'], {}), '(self.registry_path)\n', (582, 602), False, 'import os\n'), ((2128, 2151), 'os.path.dirname', 'os.pat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding 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-... | [
"numpy.prod",
"numpy.random.rand",
"numpy.testing.assert_equal",
"mars.tensor.indexing.compress",
"numpy.array",
"mars.tensor.indexing.nonzero",
"mars.tensor.indexing.unravel_index",
"numpy.arange",
"numpy.mod",
"mars.tensor.indexing.take",
"numpy.random.random",
"numpy.sort",
"numpy.take",
... | [((1053, 1070), 'mars.executor.Executor', 'Executor', (['"""numpy"""'], {}), "('numpy')\n", (1061, 1070), False, 'from mars.executor import Executor\n'), ((1293, 1326), 'numpy.random.random', 'np.random.random', (['(11, 8, 12, 14)'], {}), '((11, 8, 12, 14))\n', (1309, 1326), True, 'import numpy as np\n'), ((1341, 1366)... |
from django import template
from django.urls import reverse
from tickets.core.middlewares import get_current_request
register = template.Library()
@register.simple_tag
def is_active(url):
request = get_current_request()
# Main idea is to check if the url and the current path is a match
if request.path =... | [
"tickets.core.middlewares.get_current_request",
"django.template.Library",
"django.urls.reverse"
] | [((130, 148), 'django.template.Library', 'template.Library', ([], {}), '()\n', (146, 148), False, 'from django import template\n'), ((206, 227), 'tickets.core.middlewares.get_current_request', 'get_current_request', ([], {}), '()\n', (225, 227), False, 'from tickets.core.middlewares import get_current_request\n'), ((32... |
from typing import Union
import spacy
regex = [r"\bsofa\b"]
method_regex = (
r"sofa.*?((?P<max>max\w*)|(?P<vqheures>24h\w*)|"
r"(?P<admission>admission\w*))(?P<after_value>(.|\n)*)"
)
value_regex = r".*?.[\n\W]*?(\d+)[^h\d]"
score_normalization_str = "score_normalization.sofa"
@spacy.registry.misc(score_... | [
"spacy.registry.misc"
] | [((294, 338), 'spacy.registry.misc', 'spacy.registry.misc', (['score_normalization_str'], {}), '(score_normalization_str)\n', (313, 338), False, 'import spacy\n')] |
import torch
import torch.nn as nn
from losses import *
from net_pwc import *
from model_base import *
from reblur_package import *
from flow_utils import *
class ModelSelfFlowNet(ModelBase):
def __init__(self, opts):
super(ModelSelfFlowNet, self).__init__()
self.opts = opts
# cr... | [
"torch.nn.AvgPool2d",
"torch.zeros",
"torch.nn.Upsample"
] | [((615, 658), 'torch.nn.Upsample', 'nn.Upsample', ([], {'scale_factor': '(4)', 'mode': '"""nearest"""'}), "(scale_factor=4, mode='nearest')\n", (626, 658), True, 'import torch.nn as nn\n'), ((687, 712), 'torch.nn.AvgPool2d', 'nn.AvgPool2d', (['(2)'], {'stride': '(2)'}), '(2, stride=2)\n', (699, 712), True, 'import torc... |
import argparse
import json
import os
from agent.modules import logger, db
from agent import source, pipeline, destination, streamsets
logger_ = logger.get_logger('scripts.migrate-to-db.run', stdout=True)
def run(data_dir):
if len(streamsets.repository.get_all()) == 0:
print(
'You haven\'t c... | [
"agent.destination.repository.save",
"os.listdir",
"agent.destination.repository.exists",
"agent.pipeline.repository.exists",
"argparse.ArgumentParser",
"agent.destination.HttpDestination",
"agent.pipeline.repository.save",
"agent.modules.logger.get_logger",
"os.path.join",
"agent.pipeline.manager... | [((147, 206), 'agent.modules.logger.get_logger', 'logger.get_logger', (['"""scripts.migrate-to-db.run"""'], {'stdout': '(True)'}), "('scripts.migrate-to-db.run', stdout=True)\n", (164, 206), False, 'from agent.modules import logger, db\n'), ((582, 624), 'os.path.join', 'os.path.join', (['data_dir', '"""destination.json... |
#!/usr/bin/env python
"""glshowenv.py: Show the current OpenGL connection strings.
Usage:
glshowenv.py [GLUT_OPTIONS]
"""
import sys
import OpenGL.GL as GL
import OpenGL.GLUT as GLUT
def main():
"""Show the current OpenGL connection strings."""
GLUT.glutInit(sys.argv)
GLUT.glutInitContextVersion(3, 3)... | [
"OpenGL.GLUT.glutInitDisplayMode",
"OpenGL.GLUT.glutInitContextVersion",
"OpenGL.GL.glGetString",
"OpenGL.GLUT.glutInitContextProfile",
"OpenGL.GLUT.glutInit",
"OpenGL.GLUT.glutCreateWindow",
"OpenGL.GLUT.glutDestroyWindow"
] | [((259, 282), 'OpenGL.GLUT.glutInit', 'GLUT.glutInit', (['sys.argv'], {}), '(sys.argv)\n', (272, 282), True, 'import OpenGL.GLUT as GLUT\n'), ((287, 320), 'OpenGL.GLUT.glutInitContextVersion', 'GLUT.glutInitContextVersion', (['(3)', '(3)'], {}), '(3, 3)\n', (314, 320), True, 'import OpenGL.GLUT as GLUT\n'), ((325, 376)... |
from urllib.parse import urljoin
import pytest
import requests
from selenium.webdriver.common.keys import Keys
from tests.selenium_tests.conftest import skip_selenium_tests, first_panel_on_excerpts_export_overview_xpath
from tests.selenium_tests.new_excerpt import new_excerpt
@skip_selenium_tests
@pytest.mark.param... | [
"requests.head",
"pytest.mark.parametrize",
"tests.selenium_tests.new_excerpt.new_excerpt"
] | [((303, 499), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""file_name, file_format"""', "[('gdb', 'id_formats_1'), ('shp', 'id_formats_2'), ('gpkg', 'id_formats_3'),\n ('spatialite', 'id_formats_4'), ('img_tdb', 'id_formats_5')]"], {}), "('file_name, file_format', [('gdb', 'id_formats_1'),\n ('shp',... |
"""Shortest-Path graph kernel.
Python implementation based on: "Shortest-path kernels on graphs", by
<NAME>.; <NAME>., in Data Mining, Fifth IEEE
International Conference on , vol., no., pp.8 pp.-, 27-30 Nov. 2005
doi: 10.1109/ICDM.2005.132
Author : <NAME>, <NAME>
"""
import numpy as np
import networkx as nx
class... | [
"numpy.sqrt",
"numpy.where",
"networkx.floyd_warshall_numpy",
"numpy.sum",
"numpy.zeros",
"numpy.triu"
] | [((889, 922), 'numpy.where', 'np.where', (['(fwm1 == np.inf)', '(0)', 'fwm1'], {}), '(fwm1 == np.inf, 0, fwm1)\n', (897, 922), True, 'import numpy as np\n'), ((938, 971), 'numpy.where', 'np.where', (['(fwm1 == np.nan)', '(0)', 'fwm1'], {}), '(fwm1 == np.nan, 0, fwm1)\n', (946, 971), True, 'import numpy as np\n'), ((987... |
from tkinter import PhotoImage
from os import name
class Aspecto:
def __init__(self, master=None):
master.geometry('600x400')
master.grid_columnconfigure(1, weight=1)
master.grid_rowconfigure(1, weight=1)
if name == 'nt':
master.iconbitmap('arquivos/icone.ico')
... | [
"tkinter.PhotoImage"
] | [((344, 381), 'tkinter.PhotoImage', 'PhotoImage', ([], {'file': '"""arquivos/icone.gif"""'}), "(file='arquivos/icone.gif')\n", (354, 381), False, 'from tkinter import PhotoImage\n')] |
import pandas as pd
import os
import time
from processing_tool.data_preprocessing import prepare_feature_for_csv
from util.args import Args
def get_data_from_file(file_path: str) -> list:
with open(file_path) as file:
lines = [line.strip() for line in file]
return lines
def write_to_file(output_di... | [
"os.path.exists",
"os.makedirs",
"pandas.read_csv",
"processing_tool.data_preprocessing.prepare_feature_for_csv",
"time.strftime",
"os.path.join",
"util.args.Args.raw_data_dir",
"pandas.concat"
] | [((1211, 1230), 'util.args.Args.raw_data_dir', 'Args.raw_data_dir', ([], {}), '()\n', (1228, 1230), False, 'from util.args import Args\n'), ((447, 473), 'os.path.exists', 'os.path.exists', (['output_dir'], {}), '(output_dir)\n', (461, 473), False, 'import os\n'), ((483, 506), 'os.makedirs', 'os.makedirs', (['output_dir... |
# -*- coding: utf-8 -*-
"""
CalcCohx
function: calculate the longitudinal coherence
------------------------------------------------------------------------------------
Usage
Cohx,ConfigParameters = CalcCohx(ConfigParameters)
-----------------------------------------------------------------------------------
In... | [
"numpy.sqrt",
"numpy.reshape",
"scipy.spatial.distance.cdist",
"math.sqrt",
"numpy.exp",
"numpy.concatenate"
] | [((2602, 2687), 'numpy.reshape', 'np.reshape', (["ConfigParameters['Xpos']", "(ConfigParameters['Nplanes'], 1)"], {'order': '"""F"""'}), "(ConfigParameters['Xpos'], (ConfigParameters['Nplanes'], 1),\n order='F')\n", (2612, 2687), True, 'import numpy as np\n'), ((2690, 2724), 'numpy.concatenate', 'np.concatenate', ([... |
import streamlit as st
import matplotlib.pyplot as plt
import json
import os # +Deployment
import inspect # +Deployment
@st.cache
def load_image(cdir, link):
return plt.imread(os.path.join(cdir, link))
def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n]
def app():
current... | [
"os.path.join",
"inspect.currentframe",
"streamlit.write",
"streamlit.subheader"
] | [((414, 440), 'streamlit.subheader', 'st.subheader', (['"""Conclusion"""'], {}), "('Conclusion')\n", (426, 440), True, 'import streamlit as st\n'), ((445, 708), 'streamlit.write', 'st.write', (['"""This project has been the opportunity to apply many Data Science techniques & methodologies that we learnt during the trai... |
import json
from .api import TropoBackend
from tropo import Tropo
from corehq.apps.ivr.api import incoming as incoming_call
from corehq.apps.sms.api import incoming as incoming_sms
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
from corehq.apps.sms.mixi... | [
"json.loads",
"django.http.HttpResponseBadRequest",
"datetime.datetime.utcnow",
"corehq.apps.sms.util.strip_plus",
"tropo.Tropo",
"corehq.apps.sms.mixin.VerifiedNumber.by_extensive_search"
] | [((617, 641), 'json.loads', 'json.loads', (['request.body'], {}), '(request.body)\n', (627, 641), False, 'import json\n'), ((1625, 1632), 'tropo.Tropo', 'Tropo', ([], {}), '()\n', (1630, 1632), False, 'from tropo import Tropo\n'), ((1721, 1758), 'django.http.HttpResponseBadRequest', 'HttpResponseBadRequest', (['"""Bad ... |
'''
<NAME> 10/2/2017
<EMAIL>
Switches the MMGIS environment to release or development
Switching to release sets up the default test mission
and can limit access to tools
Usage Examples:
prepare.py d # switch to Dev env
prepare.py r # switch to Release env ... | [
"os.listdir",
"argparse.ArgumentParser",
"os.rename",
"os.getcwd",
"json.load",
"json.dump"
] | [((868, 1054), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Turns MMGIS into a development environment or into a release with the exclusion of specified tools."""', 'formatter_class': 'ArgumentDefaultsHelpFormatter'}), "(description=\n 'Turns MMGIS into a development environment or into a re... |
#!/usr/bin/env python3
#
# Copyright 2022 Graviti. Licensed under MIT License.
#
"""Portex record field releated classes."""
from collections import ChainMap
from itertools import chain
from typing import Any
from typing import ChainMap as ChainMapType
from typing import (
Dict,
Iterable,
Iterator,
Li... | [
"itertools.chain",
"collections.ChainMap",
"graviti.portex.package.Imports",
"graviti.portex.base.PortexType.from_pyobj",
"typing.TypeVar"
] | [((608, 637), 'typing.TypeVar', 'TypeVar', (['"""_T"""'], {'bound': '"""Fields"""'}), "('_T', bound='Fields')\n", (615, 637), False, 'from typing import Dict, Iterable, Iterator, List, Mapping, MutableMapping, Optional, Set, Tuple, TypeVar, Union\n'), ((3678, 3687), 'graviti.portex.package.Imports', 'Imports', ([], {})... |
import os
def main(path,units):
blockNames = ["Definitions","Propositions","Examples","New"]
for blockName in blockNames:
if not os.path.exists(path+"\\"+blockName):
os.makedirs( path+"\\"+blockName )
f = open( path+"\\"+blockName + "\\main.tex" ,"w" )
f.close()
... | [
"os.path.exists",
"os.makedirs"
] | [((486, 517), 'os.path.exists', 'os.path.exists', (["(path + '\\\\Main')"], {}), "(path + '\\\\Main')\n", (500, 517), False, 'import os\n'), ((517, 545), 'os.makedirs', 'os.makedirs', (["(path + '\\\\Main')"], {}), "(path + '\\\\Main')\n", (528, 545), False, 'import os\n'), ((710, 745), 'os.path.exists', 'os.path.exist... |
from authlib.integrations.flask_oauth2 import (
AuthorizationServer, ResourceProtector)
from authlib.integrations.sqla_oauth2 import (
create_query_client_func,
create_save_token_func,
create_bearer_token_validator,
)
from authlib.oauth2.rfc6749.grants import (
AuthorizationCodeGrant as _Authorizati... | [
"authlib.integrations.sqla_oauth2.create_query_client_func",
"werkzeug.security.gen_salt",
"authlib.integrations.sqla_oauth2.create_save_token_func",
"authlib.integrations.sqla_oauth2.create_bearer_token_validator",
"authlib.integrations.flask_oauth2.ResourceProtector",
"authlib.integrations.flask_oauth2.... | [((3222, 3243), 'authlib.integrations.flask_oauth2.AuthorizationServer', 'AuthorizationServer', ([], {}), '()\n', (3241, 3243), False, 'from authlib.integrations.flask_oauth2 import AuthorizationServer, ResourceProtector\n'), ((3260, 3279), 'authlib.integrations.flask_oauth2.ResourceProtector', 'ResourceProtector', ([]... |
from datetime import datetime, timezone, timedelta
from krules_core import event_types
from krules_core.base_functions import *
from krules_core import RuleConst as Const
from krules_core.providers import proc_events_rx_factory
from krules_env import publish_proc_events_all #, publish_proc_events_filtered
import os
i... | [
"jsonpath_rw_ext.match1",
"datetime.datetime.now",
"datetime.timedelta",
"krules_core.providers.proc_events_rx_factory"
] | [((655, 679), 'krules_core.providers.proc_events_rx_factory', 'proc_events_rx_factory', ([], {}), '()\n', (677, 679), False, 'from krules_core.providers import proc_events_rx_factory\n'), ((2420, 2467), 'jsonpath_rw_ext.match1', 'jp.match1', (['"""$.processing[*].exception"""', 'payload'], {}), "('$.processing[*].excep... |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
# License: BSD 3 clause
"""
Functions to simulate background noise.
"""
import numpy as np
import bigfish.stack as stack
# TODO add illumination bias
def add_white_noise(image, noise_level, random_noise=0.05):
"""Generate and add white noise to an image.
... | [
"numpy.random.normal",
"bigfish.stack.check_array",
"numpy.reshape",
"numpy.iinfo",
"bigfish.stack.check_parameter"
] | [((855, 921), 'bigfish.stack.check_array', 'stack.check_array', (['image'], {'ndim': '[2, 3]', 'dtype': '[np.uint8, np.uint16]'}), '(image, ndim=[2, 3], dtype=[np.uint8, np.uint16])\n', (872, 921), True, 'import bigfish.stack as stack\n'), ((970, 1044), 'bigfish.stack.check_parameter', 'stack.check_parameter', ([], {'n... |
from django.contrib import admin
from accounts.models import CustomUser
# Register your models here.
admin.site.register(CustomUser)
| [
"django.contrib.admin.site.register"
] | [((102, 133), 'django.contrib.admin.site.register', 'admin.site.register', (['CustomUser'], {}), '(CustomUser)\n', (121, 133), False, 'from django.contrib import admin\n')] |
# -*- coding:utf-8 -*-
# ==========================================
# Author: ZiChen
# 📧Mail: <EMAIL>
# ⌚Time: 2021/07/18
# Version: 1.4.1
# Description: 通过图片链接下载图片——vilipix网站特制版
# ==========================================
from ssl import match_hostname
import reque... | [
"os.path.exists",
"Win10Inform.Inform",
"json.loads",
"Win10Inform.Inform_sound",
"SpiderRobots.Analyse_auto",
"urllib.request.Request",
"time.sleep",
"requests.get",
"bs4.BeautifulSoup",
"os.mkdir",
"sys.exit",
"datetime.datetime.today",
"traceback.print_exc",
"urllib.request.urlopen"
] | [((1471, 1487), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (1485, 1487), False, 'from datetime import datetime\n'), ((1545, 1622), 'os.path.exists', 'os.path.exists', (["('./Resources/logs/PhotoDownloader_vilipixLog[%s].log' % Today)"], {}), "('./Resources/logs/PhotoDownloader_vilipixLog[%s].log' % ... |
from moniter_sync import monitor_dir
from actions import handle_results
def main():
monitor_dir(handle_results)
if __name__ == "__main__":
main() | [
"moniter_sync.monitor_dir"
] | [((89, 116), 'moniter_sync.monitor_dir', 'monitor_dir', (['handle_results'], {}), '(handle_results)\n', (100, 116), False, 'from moniter_sync import monitor_dir\n')] |
# -*- coding: utf-8 -*-
from io import StringIO
from storyscript.Story import Story
def test_story_from_stream():
stream = StringIO('x = 0')
story = Story.from_stream(stream)
assert story.story == 'x = 0'
| [
"io.StringIO",
"storyscript.Story.Story.from_stream"
] | [((130, 147), 'io.StringIO', 'StringIO', (['"""x = 0"""'], {}), "('x = 0')\n", (138, 147), False, 'from io import StringIO\n'), ((160, 185), 'storyscript.Story.Story.from_stream', 'Story.from_stream', (['stream'], {}), '(stream)\n', (177, 185), False, 'from storyscript.Story import Story\n')] |
import numpy as np
def get_fft_harmonics(samples_per_window, sample_rate, one_sided=True):
"""
Works for odd and even number of points.
Does not return Nyquist, does return DC component
Could be midified with kwargs to support one_sided, two_sided, ignore_dc
ignore_nyquist, and etc. Could actally... | [
"numpy.fft.fftfreq"
] | [((585, 640), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['samples_per_window'], {'d': '(1.0 / sample_rate)'}), '(samples_per_window, d=1.0 / sample_rate)\n', (599, 640), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""QGIS Unit test utils for provider tests.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"... | [
"qgis.core.QgsApplication.instance",
"featuresourcetestbase.FeatureSourceTestCase.runOrderByTests",
"qgis.core.QgsVectorLayerFeatureSource",
"featuresourcetestbase.FeatureSourceTestCase.runGetFeatureTests",
"qgis.core.QgsRectangle",
"qgis.core.QgsGeometry.fromWkt",
"featuresourcetestbase.FeatureSourceTe... | [((2449, 2519), 'featuresourcetestbase.FeatureSourceTestCase.assert_query', 'FeatureSourceTestCase.assert_query', (['self', 'source', 'expression', 'expected'], {}), '(self, source, expression, expected)\n', (2483, 2519), False, 'from featuresourcetestbase import FeatureSourceTestCase\n'), ((3148, 3202), 'featuresource... |
from codecs import ignore_errors
from .tools import abort
import sys
import docker
import json
import importlib.util
from retrying import retry
import traceback
from threading import Thread
import subprocess
import shutil
from datetime import datetime
import inquirer
import os
import click
from pathlib import Path
from... | [
"subprocess.check_output",
"click.Choice",
"click.argument",
"tabulate",
"os.getenv",
"click.secho",
"click.option",
"subprocess.check_call",
"pathlib.Path",
"shutil.move",
"inquirer.List",
"click.echo",
"datetime.datetime.now",
"docker.from_env",
"sys.exit",
"os.system"
] | [((1251, 1305), 'click.argument', 'click.argument', (['"""filename"""'], {'required': '(False)', 'default': '""""""'}), "('filename', required=False, default='')\n", (1265, 1305), False, 'import click\n'), ((1307, 1347), 'click.option', 'click.option', (['"""--dbname"""'], {'required': '(False)'}), "('--dbname', requir... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License... | [
"datetime.datetime.utcfromtimestamp",
"collections.namedtuple",
"boto3.client",
"logging.exception",
"boto3.resource",
"time.time",
"logging.info"
] | [((1030, 1095), 'collections.namedtuple', 'namedtuple', (['"""AwsServiceObjectsTuple"""', "['dynamo_db', 'cloudwatch']"], {}), "('AwsServiceObjectsTuple', ['dynamo_db', 'cloudwatch'])\n", (1040, 1095), False, 'from collections import namedtuple\n'), ((1320, 1371), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""']... |
"""Main module of pandas-profiling.
.. include:: ../../README.md
"""
import json
from pathlib import Path
from datetime import datetime
import pandas as pd
import numpy as np
from tqdm.auto import tqdm
from pandas_profiling.model.messages import MessageType
from pandas_profiling.version import __version__
from panda... | [
"pandas_profiling.utils.paths.get_config_minimal",
"IPython.core.display.display",
"pandas_profiling.report.presentation.flavours.WidgetReport",
"PyQt5.QtCore.QCoreApplication.instance",
"PyQt5.QtWidgets.QApplication",
"pandas_profiling.model.describe.describe",
"pandas_profiling.report.get_report_struc... | [((1447, 1472), 'pandas_profiling.config.config.set_kwargs', 'config.set_kwargs', (['kwargs'], {}), '(kwargs)\n', (1464, 1472), False, 'from pandas_profiling.config import config\n'), ((1500, 1517), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (1515, 1517), False, 'from datetime import datetime\n'),... |
from typing import Any, Tuple
from amino import do, Do, IO, List, Dat, Map, Path
from amino.test import temp_dir
from amino.test.path import pkg_dir
from amino.env_vars import set_env
from ribosome import NvimApi
from ribosome.rpc.start import start_external
from ribosome.rpc.comm import Comm
from ribosome.test.confi... | [
"amino.do",
"amino.List",
"amino.test.path.pkg_dir",
"ribosome.rpc.start.start_external",
"amino.IO.delay",
"amino.test.temp_dir",
"ribosome.rpc.io.start.cons_asyncio_embed",
"ribosome.rpc.io.start.cons_asyncio_socket"
] | [((572, 604), 'amino.List', 'List', (['"""nvim"""', '"""-n"""', '"""-u"""', '"""NONE"""'], {}), "('nvim', '-n', '-u', 'NONE')\n", (576, 604), False, 'from amino import do, Do, IO, List, Dat, Map, Path\n'), ((1253, 1265), 'amino.do', 'do', (['IO[None]'], {}), '(IO[None])\n', (1255, 1265), False, 'from amino import do, D... |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 11 20:01:02 2020
@author: Isaac
"""
import timeit
import numba
import numpy as np
from numba import njit
import time
@njit
def question_1(x):
"""
Solution to question 1 goes here
"""
A = np.array([[1.0, 3.0, 4.0], [4.0, 5.0, 6.0],... | [
"numpy.array",
"numpy.linalg.matrix_power"
] | [((277, 338), 'numpy.array', 'np.array', (['[[1.0, 3.0, 4.0], [4.0, 5.0, 6.0], [1.0, 2.0, 3.0]]'], {}), '([[1.0, 3.0, 4.0], [4.0, 5.0, 6.0], [1.0, 2.0, 3.0]])\n', (285, 338), True, 'import numpy as np\n'), ((351, 379), 'numpy.linalg.matrix_power', 'np.linalg.matrix_power', (['A', 'x'], {}), '(A, x)\n', (373, 379), True... |
"""
return a new sorted merged list from K sorted lists, each with size N.
"""
from functools import reduce
flat_map = lambda f, xs: reduce(lambda a, b: a + b, map(f, xs))
# O(KN log KN)
def merge_lists(lists):
# flattend_list = []
# for l in lists:
# flattend_list.extend(l)
flattend_list = flat_m... | [
"heapq.heappush",
"heapq.heappop",
"heapq.heapify"
] | [((741, 760), 'heapq.heapify', 'heapq.heapify', (['heap'], {}), '(heap)\n', (754, 760), False, 'import heapq\n'), ((832, 851), 'heapq.heappop', 'heapq.heappop', (['heap'], {}), '(heap)\n', (845, 851), False, 'import heapq\n'), ((1294, 1326), 'heapq.heappush', 'heapq.heappush', (['heap', 'next_tuple'], {}), '(heap, next... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import inspect
import dotenv
from django.core.management import execute_from_command_line
try:
inspect_file = inspect.getfile(inspect.currentframe())
env_path = os.path.dirname(os.path.abspath(inspect_file))
env_file = "{}/.env".format(e... | [
"os.environ.setdefault",
"os.path.exists",
"django.core.management.execute_from_command_line",
"inspect.currentframe",
"dotenv.load_dotenv",
"os.path.abspath"
] | [((337, 361), 'os.path.exists', 'os.path.exists', (['env_file'], {}), '(env_file)\n', (351, 361), False, 'import os\n'), ((464, 533), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""core.settings.prod"""'], {}), "('DJANGO_SETTINGS_MODULE', 'core.settings.prod')\n", (485, 533), Fa... |
#!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import os
import os.path as osp
import numpy as np
import tqdm
import torch
import sys
import faiss... | [
"faiss.index_cpu_to_gpu",
"os.path.exists",
"wav2vec_extract_features.Wav2VecFeatureReader",
"argparse.ArgumentParser",
"tqdm.tqdm",
"os.path.join",
"torch.nn.functional.normalize",
"torch.no_grad",
"torch.mm",
"faiss.IndexFlatIP",
"os.path.basename",
"faiss.StandardGpuResources",
"faiss.Ind... | [((497, 550), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""apply clusters"""'}), "(description='apply clusters')\n", (520, 550), False, 'import argparse\n'), ((1255, 1305), 'os.path.join', 'osp.join', (['args.data', 'f"""{args.split}.{args.labels}"""'], {}), "(args.data, f'{args.split}... |
# Generated by Django 2.1.7 on 2019-02-25 20:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('eip', '0004_auto_20190224_0850'),
]
operations = [
migrations.AddField(
model_name='eip',
name='is_voting_active',
... | [
"django.db.models.BooleanField"
] | [((337, 371), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (356, 371), False, 'from django.db import migrations, models\n')] |
"""
Copyright 2017 <NAME>
Copyright 2017-2020 <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://www.apache.org/licenses/LICENSE-2.0
Unless required by app... | [
"os.path.exists",
"ida_kernwin.action_handler_t.__init__",
"ida_kernwin.attach_action_to_menu",
"ida_name.set_name",
"ida_kernwin.ask_file",
"ida_segment.getnseg",
"json.load",
"ida_segment.get_segm_qty",
"ida_name.get_name_ea",
"ida_kernwin.register_action"
] | [((4178, 4218), 'ida_kernwin.register_action', 'ida_kernwin.register_action', (['action_desc'], {}), '(action_desc)\n', (4205, 4218), False, 'import ida_kernwin\n'), ((4223, 4328), 'ida_kernwin.attach_action_to_menu', 'ida_kernwin.attach_action_to_menu', (['"""Edit/FakePDB/"""', '"""fakepdb_offsets_import"""', 'ida_ker... |
import os
import tarfile
import time
from grpc._channel import _InactiveRpcError
from timeit import default_timer as timer
from front_end.grpc.client import sendToBackend, kill_backend
from front_end.get_hash_files import download_files
from front_end.region_creation.input_streams import HashFile
from front_end.routi... | [
"os.path.exists",
"tarfile.open",
"front_end.get_hash_files.download_files",
"os.makedirs",
"os.getenv",
"timeit.default_timer",
"os.remove",
"os.environ.items",
"front_end.grpc.client.sendToBackend",
"front_end.region_creation.input_streams.HashFile",
"front_end.grpc.client.kill_backend",
"os... | [((974, 1008), 'os.getenv', 'os.getenv', (['"""SIMULATOR_REGION_SIZE"""'], {}), "('SIMULATOR_REGION_SIZE')\n", (983, 1008), False, 'import os\n'), ((1443, 1481), 'os.getenv', 'os.getenv', (['"""SIMULATOR_MIN_REGION_SIZE"""'], {}), "('SIMULATOR_MIN_REGION_SIZE')\n", (1452, 1481), False, 'import os\n'), ((1513, 1551), 'o... |
import os
class Config:
NEWS_ARTICLES_BASE_URL='https://newsapi.org/v2/top-headlines?sources={}&apiKey={}'
NEWS_SOURCES_BASE_URL='https://newsapi.org/v2/top-headlines/sources?category={}&language=en&apiKey={}'
#https://newsapi.org/v2/top-headlines?sources=bbc-news&apiKey=<KEY>
#GET https://newsapi.org/... | [
"os.environ.get"
] | [((479, 509), 'os.environ.get', 'os.environ.get', (['"""NEWS_API_KEY"""'], {}), "('NEWS_API_KEY')\n", (493, 509), False, 'import os\n'), ((527, 555), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (541, 555), False, 'import os\n')] |
import os,sys
try:
from PyProjects.config.pyconfig import *
except ImportError as e:
from config.pyconfig import *
class PyProjects():
def __init__(self):
pass
'''
Create the setup.py file.
@PARAM: temp_dir = The dir that the file is created in.
@PARAM: project_name =... | [
"os.path.exists",
"os.getcwd",
"os.path.isfile",
"os.mkdir",
"json.load",
"os.system"
] | [((11272, 11295), 'os.path.exists', 'os.path.exists', (['args[0]'], {}), '(args[0])\n', (11286, 11295), False, 'import os, sys\n'), ((4647, 4667), 'os.path.isfile', 'os.path.isfile', (['data'], {}), '(data)\n', (4661, 4667), False, 'import os, sys\n'), ((9111, 9135), 'os.path.exists', 'os.path.exists', (['temp_dir'], {... |
import argparse
import os
import pdb
import shutil
from timeit import default_timer as timer
import numpy as np
import pandas as pd
from tqdm import tqdm
from evaluation import write_submission
def iters_ensemble(args):
'''
Ensemble on different iterations and generate ensembled files in fusioned folder
... | [
"os.listdir",
"argparse.ArgumentParser",
"os.makedirs",
"pandas.read_csv",
"timeit.default_timer",
"os.path.join",
"numpy.zeros",
"pandas.DataFrame",
"evaluation.write_submission"
] | [((1360, 1367), 'timeit.default_timer', 'timer', ([], {}), '()\n', (1365, 1367), True, 'from timeit import default_timer as timer\n'), ((4391, 4436), 'os.makedirs', 'os.makedirs', (['test_fusioned_dir'], {'exist_ok': '(True)'}), '(test_fusioned_dir, exist_ok=True)\n', (4402, 4436), False, 'import os\n'), ((7067, 7074),... |
from django.shortcuts import render
from django.template import loader
from django.http import HttpResponse
from django.http import Http404
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate
from django.conf import settings
from django.shortcuts import redirect
from d... | [
"logging.getLogger",
"django.shortcuts.render",
"servicelog.models.Servicelog.objects.get",
"servicelog.models.Servicelog.objects.all",
"django.http.HttpResponse",
"acl.models.Machine.objects.get",
"email.mime.multipart.MIMEMultipart",
"django.shortcuts.redirect"
] | [((1725, 1752), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1742, 1752), False, 'import logging\n'), ((2167, 2194), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2184, 2194), False, 'import logging\n'), ((2598, 2620), 'email.mime.multipart.MIMEMultipar... |
"""
Artificial Intelligence for Humans
Volume 1: Fundamental Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2013 by <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you... | [
"numpy.zeros",
"rbf.RbfGaussian",
"numpy.random.uniform"
] | [((2117, 2193), 'numpy.zeros', 'np.zeros', (['(input_weight_count + output_weight_count + rbf_params)'], {'dtype': 'float'}), '(input_weight_count + output_weight_count + rbf_params, dtype=float)\n', (2125, 2193), True, 'import numpy as np\n'), ((2500, 2558), 'rbf.RbfGaussian', 'RbfGaussian', (['input_count', 'self.lon... |
# -*- coding: utf-8 -*-
from cmussyncthing.cmus_syncthing import SyncMachine
from xdg.BaseDirectory import xdg_config_home
from os.path import join
import sys
def main():
config_file = join(xdg_config_home,
"cmus-syncthing",
"cmus-syncthing.conf"
... | [
"cmussyncthing.cmus_syncthing.SyncMachine",
"os.path.join"
] | [((191, 253), 'os.path.join', 'join', (['xdg_config_home', '"""cmus-syncthing"""', '"""cmus-syncthing.conf"""'], {}), "(xdg_config_home, 'cmus-syncthing', 'cmus-syncthing.conf')\n", (195, 253), False, 'from os.path import join\n'), ((449, 479), 'cmussyncthing.cmus_syncthing.SyncMachine', 'SyncMachine', (['config_file',... |
import itertools
from fractions import Fraction
def get_keychain_value(d, key_chain=None, allowed_values=(list,)):
key_chain = [] if key_chain is None else list(key_chain).copy()
if not isinstance(d, dict):
if allowed_values is not None:
assert isinstance(d, allowed_values), 'Value needs ... | [
"itertools.product"
] | [((708, 734), 'itertools.product', 'itertools.product', (['*values'], {}), '(*values)\n', (725, 734), False, 'import itertools\n')] |
from werkzeug import generate_password_hash, check_password_hash
from flask.ext.login import UserMixin
from extensions import db
class User(db.Model, UserMixin):
__tablename__ = "user"
def __repr__(self):
return '<User %r>' % (self.user_name)
id = db.Column(db.Integer, primary_key = True)
use... | [
"werkzeug.check_password_hash",
"extensions.db.exists",
"extensions.db.Column",
"werkzeug.generate_password_hash",
"extensions.db.or_",
"extensions.db.String"
] | [((273, 312), 'extensions.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (282, 312), False, 'from extensions import db\n'), ((512, 536), 'extensions.db.Column', 'db.Column', (['db.PickleType'], {}), '(db.PickleType)\n', (521, 536), False, 'from extensions impor... |
# 用于推断
from config import MaskRcnnConfig
import modelibe
import tensorflow as tf
import skimage.io as io
import scipy.misc
import os
import numpy as np
import keras.backend.tensorflow_backend as KTF
from tqdm import tqdm
import cv2
import colorsys
from skimage.measure import find_contours
import argparse
class OurCo... | [
"cv2.rectangle",
"tensorflow.Graph",
"cv2.imwrite",
"argparse.ArgumentParser",
"numpy.where",
"cv2.polylines",
"numpy.fliplr",
"colorsys.hsv_to_rgb",
"cv2.imshow",
"modelibe.MaskRcnn",
"cv2.putText",
"numpy.zeros",
"numpy.any",
"cv2.destroyAllWindows",
"cv2.cvtColor",
"skimage.measure.... | [((4275, 4334), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Mask R-CNN influence"""'}), "(description='Mask R-CNN influence')\n", (4298, 4334), False, 'import argparse\n'), ((975, 1069), 'numpy.where', 'np.where', (['(mask == 1)', '(image[:, :, c] * (1 - alpha) + alpha * color[c] * 25... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
An attempt to create a generic input file generator for different waveform
solvers.
:copyright:
<NAME> (<EMAIL>), 2013
:license:
GNU General Public License, Version 3
(http://www.gnu.org/copyleft/gpl.html)
"""
from wfs_input_generator.station_xml_helper \
... | [
"wfs_input_generator.station_xml_helper.extract_coordinates_from_StationXML",
"json.loads",
"obspy.readEvents",
"os.path.exists",
"urllib2.urlopen",
"os.makedirs",
"inspect.currentframe",
"obspy.core.AttribDict",
"os.path.join",
"obspy.UTCDateTime",
"obspy.sac.core.isSAC",
"os.path.isdir",
"... | [((1023, 1035), 'obspy.core.AttribDict', 'AttribDict', ([], {}), '()\n', (1033, 1035), False, 'from obspy.core import AttribDict, read\n'), ((13638, 13658), 'obspy.xseed.Parser', 'Parser', (['station_item'], {}), '(station_item)\n', (13644, 13658), False, 'from obspy.xseed import Parser\n'), ((16596, 16622), 'copy.deep... |
from flask_sqlalchemy import SQLAlchemy, Model
class ModelClass(Model):
def update(self, kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
db = SQLAlchemy(model_class=ModelClass)
from .profile import User, Profile, Address, Education, Skill, WorkExperience, PersonalProj... | [
"flask_sqlalchemy.SQLAlchemy"
] | [((192, 226), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {'model_class': 'ModelClass'}), '(model_class=ModelClass)\n', (202, 226), False, 'from flask_sqlalchemy import SQLAlchemy, Model\n')] |
from __future__ import annotations
import logging
from pathlib import Path
from typing import Generator, List, Set, Union
import numpy as np
from apscheduler.executors.pool import ThreadPoolExecutor
from apscheduler.jobstores.memory import MemoryJobStore
from apscheduler.schedulers.background import BackgroundSchedul... | [
"logging.getLogger",
"card_live_dashboard.model.data_modifiers.AddGeographicNamesModifier.AddGeographicNamesModifier",
"apscheduler.executors.pool.ThreadPoolExecutor",
"apscheduler.jobstores.memory.MemoryJobStore",
"numpy.datetime64",
"card_live_dashboard.service.CardLiveDataLoader.CardLiveDataLoader",
... | [((824, 851), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (841, 851), False, 'import logging\n'), ((1102, 1140), 'card_live_dashboard.service.CardLiveDataLoader.CardLiveDataLoader', 'CardLiveDataLoader', (['card_live_data_dir'], {}), '(card_live_data_dir)\n', (1120, 1140), False, 'from... |
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from xmitgcm import open_mdsdataset
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
plt.ion()
dir1 = '/homedata/bderembl/runmit/test_southatlgyre'
ds1 = open_mdsdataset(dir1,iters='all',prefix=['Eta'])
nt = 0
... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"xmitgcm.open_mdsdataset",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.clf",
"cartopy.crs.PlateCarree",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.title"
] | [((192, 201), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (199, 201), True, 'import matplotlib.pyplot as plt\n'), ((263, 313), 'xmitgcm.open_mdsdataset', 'open_mdsdataset', (['dir1'], {'iters': '"""all"""', 'prefix': "['Eta']"}), "(dir1, iters='all', prefix=['Eta'])\n", (278, 313), False, 'from xmitgcm import... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import mptt.fields
import django.db.models.deletion
import yepes.fields
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial_schema'),
]
initial = True
operat... | [
"django.db.models.GenericIPAddressField",
"django.db.models.AutoField",
"django.db.models.PositiveIntegerField",
"django.db.models.DateTimeField",
"django.db.models.URLField"
] | [((439, 532), 'django.db.models.AutoField', 'models.AutoField', ([], {'verbose_name': '"""ID"""', 'serialize': '(False)', 'auto_created': '(True)', 'primary_key': '(True)'}), "(verbose_name='ID', serialize=False, auto_created=True,\n primary_key=True)\n", (455, 532), False, 'from django.db import migrations, models\... |
# Copyright (c) 2015 OpenStack Foundation
# 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 ... | [
"networking_odl.db.models.OpenDaylightJournal.operation.in_",
"sqlalchemy.func.now",
"networking_odl.db.models.OpenDaylightJournal",
"oslo_log.log.getLogger",
"neutron_lib.db.api.retry_if_session_inactive",
"sqlalchemy.orm.aliased",
"sqlalchemy.bindparam",
"networking_odl.db.models.journal_dependencie... | [((1019, 1046), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1036, 1046), True, 'from oslo_log import log as logging\n'), ((1057, 1071), 'sqlalchemy.ext.baked.bakery', 'baked.bakery', ([], {}), '()\n', (1069, 1071), False, 'from sqlalchemy.ext import baked\n'), ((3128, 3162), 'neu... |
'''
Copyright (c) 2020 <NAME> (<NAME>, <NAME>
@file openMotors.py
@date 2020/04/17
@brief Script to run at RPi startup to set all H-bridge motor control pins low
@license This project is released under the BSD-3-Clause license.
'''
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(31, GP... | [
"RPi.GPIO.setup",
"RPi.GPIO.cleanup",
"RPi.GPIO.output",
"RPi.GPIO.setmode"
] | [((278, 302), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BOARD'], {}), '(GPIO.BOARD)\n', (290, 302), True, 'import RPi.GPIO as GPIO\n'), ((303, 327), 'RPi.GPIO.setup', 'GPIO.setup', (['(31)', 'GPIO.OUT'], {}), '(31, GPIO.OUT)\n', (313, 327), True, 'import RPi.GPIO as GPIO\n'), ((341, 365), 'RPi.GPIO.setup', 'GPIO.setu... |
# -*- coding: utf-8 -*-
#
# Output status info to text files for use with streaming software such as Open Broadcaster Software, GameShow, XSplit, etc.
# https://obsproject.com/wiki/Sources-Guide#text-gdi
# https://telestream.force.com/kb2/articles/Knowledge_Article/Gameshow-Add-Text
# https://www.xsplit.com/broadcaster... | [
"l10n.Locale.stringFromNumber",
"os.path.join",
"config.config.get",
"companion.ship_map.get"
] | [((667, 687), 'config.config.get', 'config.get', (['"""outdir"""'], {}), "('outdir')\n", (677, 687), False, 'from config import config\n'), ((2343, 2363), 'config.config.get', 'config.get', (['"""outdir"""'], {}), "('outdir')\n", (2353, 2363), False, 'from config import config\n'), ((2387, 2407), 'config.config.get', '... |
"""
Test database building.
"""
from io import StringIO
from tempfile import NamedTemporaryFile
from microcosm.api import create_object_graph
from microcosm.loaders import load_from_dict
from hamcrest import assert_that, equal_to
from microcosm_sqlite.tests.fixtures import Example, Person, PersonStore
class TestCS... | [
"microcosm_sqlite.tests.fixtures.Person",
"microcosm_sqlite.tests.fixtures.Person.new_context",
"microcosm_sqlite.tests.fixtures.PersonStore",
"microcosm.api.create_object_graph",
"microcosm_sqlite.tests.fixtures.Example.create_all",
"microcosm_sqlite.tests.fixtures.Example.new_context",
"tempfile.Named... | [((376, 396), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', ([], {}), '()\n', (394, 396), False, 'from tempfile import NamedTemporaryFile\n'), ((596, 655), 'microcosm.api.create_object_graph', 'create_object_graph', (['"""example"""'], {'testing': '(True)', 'loader': 'loader'}), "('example', testing=True, loader... |
#!/usr/bin/env python3
# coding=utf-8
"""
Version 1.3
Script to manage IP list usages
and to remove allow rule IP pattern
All actions operate on the newest saved or active configuration
and will save a new configuration.
"""
from urllib import request
import ssl
import json
import os
import sys
import re
from argparse... | [
"signal.signal",
"json.loads",
"argparse.ArgumentParser",
"http.cookiejar.CookieJar",
"zipfile.ZipFile",
"xml.etree.ElementTree.tostring",
"urllib.request.Request",
"json.dumps",
"os.environ.get",
"io.BytesIO",
"sys.exit",
"xml.etree.ElementTree.fromstring",
"re.search"
] | [((543, 559), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (557, 559), False, 'from argparse import ArgumentParser\n'), ((5080, 5165), 'urllib.request.Request', 'request.Request', (["(TARGET_GATEWAY + '/airlock/rest/' + path)", 'body', 'DEFAULT_HEADERS'], {}), "(TARGET_GATEWAY + '/airlock/rest/' + pat... |
#!/usr/bin/env python3
import pandas as pd
import joblib
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn.multiclass import OneVsRestClassifier
from sklearn.metrics import accuracy_score
from sklearn.pipeline import make_pipeline
df = pd.read_csv("../data/c... | [
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.pipeline.make_pipeline",
"sklearn.naive_bayes.GaussianNB",
"joblib.dump",
"sklearn.metrics.accuracy_score"
] | [((298, 351), 'pandas.read_csv', 'pd.read_csv', (['"""../data/ca_fires.csv"""'], {'low_memory': '(False)'}), "('../data/ca_fires.csv', low_memory=False)\n", (309, 351), True, 'import pandas as pd\n'), ((522, 588), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.2)', 'rando... |
from copy import deepcopy
import random
from typing import Optional
import numpy as np
import torch
import torch.nn.functional as F
from tqdm import trange
from dataset_helpers import get_dataloaders
from experiment_config import (
Config,
DatasetSubsetType,
HParams,
State,
EvaluationMetrics,
... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"numpy.random.get_state",
"measures.get_all_measures",
"models.NiN",
"random.seed",
"dataset_helpers.get_dataloaders",
"torch.get_rng_state",
"numpy.random.seed",
"logs.Printer",
"copy.deepcopy",
"torch.nn.functional.cross_entropy",
"torch.n... | [((8040, 8055), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (8053, 8055), False, 'import torch\n'), ((9074, 9089), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (9087, 9089), False, 'import torch\n'), ((10064, 10079), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (10077, 10079), False, 'import torch... |
import os
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from app import create_app, db
#from app import socketio
# from app import user, RolesUsers,Roles
#print(sys.argv[2])
#app=None
#gunicorn -w 1 --worker-class eventlet -b 0.0.0.0:4000 'manage:create_prod_app()'
###############... | [
"flask_script.Manager",
"flask_migrate.Migrate",
"app.create_app"
] | [((415, 432), 'app.create_app', 'create_app', (['"""dev"""'], {}), "('dev')\n", (425, 432), False, 'from app import create_app, db\n'), ((529, 541), 'flask_script.Manager', 'Manager', (['app'], {}), '(app)\n', (536, 541), False, 'from flask_script import Manager\n'), ((575, 591), 'flask_migrate.Migrate', 'Migrate', (['... |
# -*- coding: utf-8 -*-
# @Author: xiaodong
# @Date : 2021/4/17
import logging
from log2db import init, Proxy, LoggingMQHandler
Proxy.DBURL = "sqlite:///{}".format("mylogger.db")
_ = init()
logger = logging.getLogger("log2db")
logger.parent = None
handler = LoggingMQHandler(logging.INFO)
logger.addHandler(handler... | [
"logging.getLogger",
"log2db.init",
"random.choice",
"log2db.LoggingMQHandler"
] | [((188, 194), 'log2db.init', 'init', ([], {}), '()\n', (192, 194), False, 'from log2db import init, Proxy, LoggingMQHandler\n'), ((205, 232), 'logging.getLogger', 'logging.getLogger', (['"""log2db"""'], {}), "('log2db')\n", (222, 232), False, 'import logging\n'), ((264, 294), 'log2db.LoggingMQHandler', 'LoggingMQHandle... |
# Author: <NAME>
# This game does not run on windows due to the lack of
# support for the curses library
import atexit
import random
import curses
import time
import threading
import os
# An IOController controls the input (keyboard) and output
# (console) of the game
class IOController():
# TODO: curses is b... | [
"random.randint",
"atexit.register",
"threading.Lock",
"curses.endwin",
"time.sleep",
"curses.noecho",
"curses.initscr",
"curses.cbreak",
"threading.Thread"
] | [((638, 654), 'curses.initscr', 'curses.initscr', ([], {}), '()\n', (652, 654), False, 'import curses\n'), ((663, 678), 'curses.cbreak', 'curses.cbreak', ([], {}), '()\n', (676, 678), False, 'import curses\n'), ((687, 702), 'curses.noecho', 'curses.noecho', ([], {}), '()\n', (700, 702), False, 'import curses\n'), ((803... |
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.animation as animation
import numpy as np
import utils
def plot_glimpse(config, images, locations, preds, labels, step, animate):
"""
For each image in images, draws bounding boxes
corresponding to glimpse locations.
... | [
"matplotlib.patches.Rectangle",
"numpy.argmax",
"numpy.squeeze",
"matplotlib.pyplot.close",
"matplotlib.animation.ArtistAnimation",
"matplotlib.pyplot.figure",
"matplotlib.animation.ImageMagickWriter",
"utils.truncate",
"matplotlib.pyplot.subplots"
] | [((832, 881), 'matplotlib.animation.ImageMagickWriter', 'animation.ImageMagickWriter', ([], {'fps': '(15)', 'bitrate': '(1800)'}), '(fps=15, bitrate=1800)\n', (859, 881), True, 'import matplotlib.animation as animation\n'), ((3713, 3817), 'matplotlib.patches.Rectangle', 'patches.Rectangle', (['xy', 'width', 'height'], ... |
# lineSegmentInformation.pyw
# This is a program designed to allow the user to draw a line segment
# and then displays then displays the midpoint of the line segment in
# cyan and prints the length and slope of the line.
"""
Input: Two mouse clicks for the end points of the line segment.
Output: Draw the midpoint of th... | [
"math.sqrt"
] | [((1597, 1625), 'math.sqrt', 'math.sqrt', (['(dx ** 2 + dy ** 2)'], {}), '(dx ** 2 + dy ** 2)\n', (1606, 1625), False, 'import math\n')] |
import discord
from discord.ext import commands
from discord.utils import get
from Tools.utils import getConfig, getGuildPrefix, guild_owner_only, updateConfig
class Disable(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(usage="all")
@commands.coold... | [
"Tools.utils.updateConfig",
"discord.utils.get",
"Tools.utils.getConfig",
"discord.ext.commands.cooldown",
"discord.ext.commands.command"
] | [((270, 299), 'discord.ext.commands.command', 'commands.command', ([], {'usage': '"""all"""'}), "(usage='all')\n", (286, 299), False, 'from discord.ext import commands\n'), ((306, 358), 'discord.ext.commands.cooldown', 'commands.cooldown', (['(1)', '(10)', 'commands.BucketType.member'], {}), '(1, 10, commands.BucketTyp... |
#!/usr/bin/env python3
# import modules
import os
from aws_cdk import core
# import cdk classes
from vpc.vpc_stack import VpcStack
from kafka.kafka_stack import KafkaStack
from elastic.elastic_stack import ElasticStack
from logstash.logstash_stack import LogstashStack
from filebeat.filebeat_stack import FilebeatStack... | [
"aws_cdk.core.Environment",
"aws_cdk.core.App"
] | [((416, 426), 'aws_cdk.core.App', 'core.App', ([], {}), '()\n', (424, 426), False, 'from aws_cdk import core\n'), ((495, 600), 'aws_cdk.core.Environment', 'core.Environment', ([], {'account': "os.environ['CDK_DEFAULT_ACCOUNT']", 'region': "os.environ['CDK_DEFAULT_REGION']"}), "(account=os.environ['CDK_DEFAULT_ACCOUNT']... |
from elma.lgr import LGR
from elma.lgr import LGR_Image
from elma.lgr import pack_LGR
from elma.lgr import unpack_LGR
import elma.error
from elma.error import check_LGR_error
from elma.constants import LGR_DEFAULT_PALETTE
import unittest
from PIL import Image
from PIL import ImageDraw
import os
import shutil
class Te... | [
"PIL.Image.open",
"elma.lgr.pack_LGR",
"os.makedirs",
"elma.lgr.LGR_Image",
"PIL.Image.new",
"elma.lgr.unpack_LGR",
"elma.error.check_LGR_error",
"shutil.rmtree",
"PIL.ImageDraw.Draw",
"elma.lgr.LGR"
] | [((376, 424), 'os.makedirs', 'os.makedirs', (['"""tests/files/result"""'], {'exist_ok': '(True)'}), "('tests/files/result', exist_ok=True)\n", (387, 424), False, 'import os\n'), ((828, 847), 'elma.lgr.LGR_Image', 'LGR_Image', (['"""barrel"""'], {}), "('barrel')\n", (837, 847), False, 'from elma.lgr import LGR_Image\n')... |
# coding=utf-8
import binascii
import struct
import unittest
from hazelcast.config import SerializationConfig
from hazelcast.serialization.bits import *
from hazelcast.serialization.data import Data
from hazelcast.serialization.serialization_const import CONSTANT_TYPE_STRING
from hazelcast.serialization.service import... | [
"hazelcast.config.SerializationConfig",
"hazelcast.six.u",
"binascii.hexlify",
"hazelcast.serialization.data.Data",
"struct.pack_into",
"unittest.main"
] | [((391, 445), 'hazelcast.six.u', 'six.u', (['"""Pijamalı hasta, yağız şoföre çabucak güvendi."""'], {}), "('Pijamalı hasta, yağız şoföre çabucak güvendi.')\n", (396, 445), False, 'from hazelcast import six\n'), ((467, 502), 'hazelcast.six.u', 'six.u', (['"""イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム"""'], {}), "('イロハニホヘト チリヌルヲ ワカヨタレソ ... |
import getopt
import sys
import test
from config import config as conf
from config import ReqType
import windows
def main():
# opts
try:
opts, args = getopt.getopt(
sys.argv[1:],
"hlt:d:p:",
["help", "logList", "type=", "duration=", "logPath="])
except getopt.... | [
"getopt.getopt",
"windows.lst",
"test.log",
"sys.exit",
"windows.handle",
"test.config"
] | [((170, 268), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '"""hlt:d:p:"""', "['help', 'logList', 'type=', 'duration=', 'logPath=']"], {}), "(sys.argv[1:], 'hlt:d:p:', ['help', 'logList', 'type=',\n 'duration=', 'logPath='])\n", (183, 268), False, 'import getopt\n'), ((984, 997), 'windows.lst', 'windows.lst',... |
"""Configure the module warnings
https://docs.python.org/3/library/warnings.html
"""
import warnings
from pathlib import Path
##__________________________________________________________________||
_module_path = Path(__file__).resolve().parent.parent
# the path to the dir in which the module is installed,
# i.e., th... | [
"pathlib.Path"
] | [((215, 229), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (219, 229), False, 'from pathlib import Path\n'), ((454, 468), 'pathlib.Path', 'Path', (['filename'], {}), '(filename)\n', (458, 468), False, 'from pathlib import Path\n')] |
"""
Execute showcase cpp examples with VaRA's taint analysis.
We run the analysis on exemplary cpp files. The cpp examples can be found in the
https://github.com/se-passau/vara-perf-tests repository. The result LLVM IR is
then parsed into an file contaning only the instructions tainted by the commit
regions of the cpp... | [
"varats.utils.settings.bb_cfg",
"varats.experiment.experiment_util.PEErrorHandler",
"benchbuild.utils.actions.Clean"
] | [((6363, 6385), 'benchbuild.utils.actions.Clean', 'actions.Clean', (['project'], {}), '(project)\n', (6376, 6385), True, 'import benchbuild.utils.actions as actions\n'), ((5117, 5176), 'varats.experiment.experiment_util.PEErrorHandler', 'PEErrorHandler', (['result_folder', 'error_file', 'timeout_duration'], {}), '(resu... |
import sys
import logging
import subprocess
from pid import PidFile
from configparser import ConfigParser
from http.server import BaseHTTPRequestHandler,HTTPServer
#This class will handles any incoming request from
#the browser
class HealthCheckHandler(BaseHTTPRequestHandler):
def check_status(self):
glo... | [
"logging.basicConfig",
"configparser.ConfigParser",
"subprocess.Popen",
"logging.info",
"http.server.HTTPServer",
"pid.PidFile",
"sys.exit",
"logging.error"
] | [((344, 454), 'subprocess.Popen', 'subprocess.Popen', (['("bash -c \'" + command + "\'")'], {'shell': '(True)', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), '("bash -c \'" + command + "\'", shell=True, stdout=subprocess\n .PIPE, stderr=subprocess.PIPE)\n', (360, 454), False, 'import subprocess\n'), ((... |
#
# MIT License
#
# (C) Copyright 2018-2022 Hewlett Packard Enterprise Development LP
#
# 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... | [
"os.path.expanduser",
"os.getenv"
] | [((2085, 2109), 'os.getenv', 'os.getenv', (['"""S3_ENDPOINT"""'], {}), "('S3_ENDPOINT')\n", (2094, 2109), False, 'import os\n'), ((2130, 2156), 'os.getenv', 'os.getenv', (['"""S3_ACCESS_KEY"""'], {}), "('S3_ACCESS_KEY')\n", (2139, 2156), False, 'import os\n'), ((2177, 2203), 'os.getenv', 'os.getenv', (['"""S3_SECRET_KE... |
import datetime
import simplejson as json
from django.conf import settings
from django.http import HttpResponse
from django.utils.encoding import force_text
from django.utils.functional import Promise
from django.views.generic import FormView
from .app_settings import SLICK_REPORTING_DEFAULT_END_DATE, SLICK_REPORTING... | [
"simplejson.dumps",
"django.utils.encoding.force_text"
] | [((2440, 2525), 'simplejson.dumps', 'json.dumps', (['response_data'], {'indent': 'indent', 'use_decimal': '(True)', 'default': 'date_handler'}), '(response_data, indent=indent, use_decimal=True, default=date_handler\n )\n', (2450, 2525), True, 'import simplejson as json\n'), ((2335, 2350), 'django.utils.encoding.for... |
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by <NAME> <<EMAIL>>
#
# This file is part of CBI Toolbox.
#
# CBI Toolbox is free software: you can redistribute it and/or modify
# it under the terms of the 3-Clause BSD License.
#
# CBI Toolbox is distributed in the hope that it will be use... | [
"cbi_toolbox.reconstruct.psnr",
"json.dump",
"os.path.join",
"numpy.arange"
] | [((795, 816), 'numpy.arange', 'np.arange', (['(10)', '(101)', '(5)'], {}), '(10, 101, 5)\n', (804, 816), True, 'import numpy as np\n'), ((870, 897), 'os.path.join', 'os.path.join', (['path', '"""noise"""'], {}), "(path, 'noise')\n", (882, 897), False, 'import os\n'), ((906, 933), 'os.path.join', 'os.path.join', (['path... |
import os
import sublime
import string
import random
import tempfile
import subprocess
import sublime_plugin
WINDOWS_LINE_ENDING = b'\r\n'
UNIX_LINE_ENDING = b'\n'
settingsFile = "SublimeOpenFileOverSSH.sublime-settings"
isWindows = (sublime.platform() == "windows")
viewToShell = {} #Maps view.id() to an sshShell. ... | [
"random.choice",
"sublime.Region",
"subprocess.STARTUPINFO",
"sublime.load_settings",
"tempfile.NamedTemporaryFile",
"sublime.platform",
"sublime.save_settings",
"os.remove"
] | [((237, 255), 'sublime.platform', 'sublime.platform', ([], {}), '()\n', (253, 255), False, 'import sublime\n'), ((609, 633), 'subprocess.STARTUPINFO', 'subprocess.STARTUPINFO', ([], {}), '()\n', (631, 633), False, 'import subprocess\n'), ((4134, 4169), 'sublime.save_settings', 'sublime.save_settings', (['settingsFile']... |
"""
Module: Doccode Mapping form grouping changer
Project: Adlibre DMS
Copyright: Adlibre Pty Ltd 2012
License: See LICENSE for license information
Author: <NAME>
"""
from djangoplugins.models import Plugin, PluginPoint
from django import forms
from django.utils.importlib import import_module
from .models import Doc... | [
"djangoplugins.models.Plugin.objects.all",
"django.utils.importlib.import_module",
"djangoplugins.models.PluginPoint.objects.all"
] | [((7452, 7477), 'django.utils.importlib.import_module', 'import_module', (['modulename'], {}), '(modulename)\n', (7465, 7477), False, 'from django.utils.importlib import import_module\n'), ((875, 895), 'djangoplugins.models.Plugin.objects.all', 'Plugin.objects.all', ([], {}), '()\n', (893, 895), False, 'from djangoplug... |
import math
class Angle:
def __init__(self, value, unit='deg'):
if unit == 'deg':
self._value = math.radians(value)
elif unit == 'rad':
self._value = value
else:
raise ValueError(f'{unit} is not recognized')
def __call__(self, unit='rad'):
i... | [
"math.degrees",
"math.radians"
] | [((122, 141), 'math.radians', 'math.radians', (['value'], {}), '(value)\n', (134, 141), False, 'import math\n'), ((356, 381), 'math.degrees', 'math.degrees', (['self._value'], {}), '(self._value)\n', (368, 381), False, 'import math\n')] |
from __future__ import absolute_import, unicode_literals
import httplib
from django.contrib.messages.api import get_messages
from towel.api import Resource, APIException
class FrankenResource(Resource):
"""
Really ugly and hacky way of reusing customizations made in a ``ModelView``
subclass for API res... | [
"towel.api.APIException",
"django.contrib.messages.api.get_messages"
] | [((1167, 1205), 'towel.api.APIException', 'APIException', ([], {'status': 'httplib.FORBIDDEN'}), '(status=httplib.FORBIDDEN)\n', (1179, 1205), False, 'from towel.api import Resource, APIException\n'), ((1832, 1878), 'towel.api.APIException', 'APIException', ([], {'data': "{'validation': form.errors}"}), "(data={'valida... |