code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""empty message
Revision ID: b62d1c35a8e2
Revises:
Create Date: 2020-08-12 14:48:17.213365
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated b... | [
"alembic.op.drop_table",
"sqlalchemy.DateTime",
"alembic.op.drop_index",
"alembic.op.create_index",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Boolean",
"sqlalchemy.UniqueConstraint",
"sqlalchemy.String",
"sqlalchemy.Integer"
] | [((984, 1057), 'alembic.op.create_index', 'op.create_index', (['"""ix_key"""', '"""common_cnf"""', "['key', 'created']"], {'unique': '(False)'}), "('ix_key', 'common_cnf', ['key', 'created'], unique=False)\n", (999, 1057), False, 'from alembic import op\n'), ((2346, 2432), 'alembic.op.create_index', 'op.create_index', ... |
# Copyright (c) 2012 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... | [
"neutron_lib.exceptions.InvalidInput",
"neutron._i18n._"
] | [((1161, 1218), 'neutron._i18n._', '_', (['"""Plugin does not support updating provider attributes"""'], {}), "('Plugin does not support updating provider attributes')\n", (1162, 1218), False, 'from neutron._i18n import _\n'), ((1233, 1270), 'neutron_lib.exceptions.InvalidInput', 'n_exc.InvalidInput', ([], {'error_mess... |
import numpy as np
data = np.genfromtxt('jajka1.csv', delimiter=";", dtype=('|U16'))
data2 = np.array([[s.replace(',', '.') for s in line] for line in data])
suma = 0
x = 0
for i in range(1, 17):
for j in range(1, 9):
if data2[i][j] == "":
data2[i][j] = 0
suma += data2[i][j].astype(np.... | [
"numpy.array",
"numpy.genfromtxt"
] | [((27, 83), 'numpy.genfromtxt', 'np.genfromtxt', (['"""jajka1.csv"""'], {'delimiter': '""";"""', 'dtype': '"""|U16"""'}), "('jajka1.csv', delimiter=';', dtype='|U16')\n", (40, 83), True, 'import numpy as np\n'), ((842, 908), 'numpy.array', 'np.array', (["['Miasto', '<NAME>', 'Ceny', m1, s1, maxi, m2, s2, mini]"], {}), ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test for debug info."""
from __future__ import print_function
import os
import subprocess
import sys
... | [
"os.path.isdir",
"subprocess.Popen",
"os.path.isfile"
] | [((652, 764), 'subprocess.Popen', 'subprocess.Popen', (["['scanelf', '-y', '-B', '-F', '%F', '-R', root]"], {'stdout': 'subprocess.PIPE', 'encoding': '"""utf-8"""'}), "(['scanelf', '-y', '-B', '-F', '%F', '-R', root], stdout=\n subprocess.PIPE, encoding='utf-8')\n", (668, 764), False, 'import subprocess\n'), ((966, ... |
# coding=utf-8
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
"absl.testing.absltest.main",
"learned_optimization.tasks.parametric.parametric_utils.orth_init",
"numpy.abs",
"jax.jit",
"learned_optimization.tasks.parametric.parametric_utils.SampleInitializer.sample",
"learned_optimization.tasks.parametric.parametric_utils.SampleInitializer.get_dynamic",
"learned_op... | [((2289, 2304), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (2302, 2304), False, 'from absl.testing import absltest\n'), ((923, 944), 'jax.random.PRNGKey', 'jax.random.PRNGKey', (['(0)'], {}), '(0)\n', (941, 944), False, 'import jax\n'), ((955, 1002), 'learned_optimization.tasks.parametric.parametr... |
import socket
from time import sleep
# Buffer size
BUFFER_SIZE = 1024
# Create a UDP socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # AF_INET means that this socket Internet Protocol v4 addresses
#SOCK_DGRAM means this is a UDP scoke... | [
"socket.socket",
"time.sleep"
] | [((117, 165), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (130, 165), False, 'import socket\n'), ((1183, 1192), 'time.sleep', 'sleep', (['(10)'], {}), '(10)\n', (1188, 1192), False, 'from time import sleep\n')] |
# -*- coding: utf-8 -*-
from ..base_classes import ParamTemplate, SimulationObject
from ..base_classes import StatesWithImplicitRatesTemplate as StateVariables
from ..decorators import prepare_rates, prepare_states
from ..traitlets import Float, Bool
from ..util import limit
from math import sqrt
from ..exceptions impo... | [
"math.sqrt"
] | [((13233, 13248), 'math.sqrt', 'sqrt', (['self.DSLR'], {}), '(self.DSLR)\n', (13237, 13248), False, 'from math import sqrt\n'), ((13251, 13272), 'math.sqrt', 'sqrt', (['(self.DSLR - 1.0)'], {}), '(self.DSLR - 1.0)\n', (13255, 13272), False, 'from math import sqrt\n')] |
# -*- coding: utf-8 -*-
from scrapy.exceptions import DropItem
# class TextPipeline(object):
#
# def process_item(self, item, spider):
# if item['text']:
# return item
# else:
# return DropItem('Missing Text')
import pymongo
class MongoPipeline(object):
def __init__(... | [
"pymongo.MongoClient",
"pymysql.connect"
] | [((674, 709), 'pymongo.MongoClient', 'pymongo.MongoClient', (['self.mongo_uri'], {}), '(self.mongo_uri)\n', (693, 709), False, 'import pymongo\n'), ((1626, 1730), 'pymysql.connect', 'pymysql.connect', (['self.host', 'self.user', 'self.password', 'self.database'], {'charset': '"""utf8"""', 'port': 'self.port'}), "(self.... |
import librosa
from logmmse import logmmse_from_file
from pydub import AudioSegment
def get_audio_duration(source_file):
return librosa.get_duration(filename=source_file)
def reduce_noise(source_file, output_file=None, initial_noise=30,
window_size=0, noise_threshold=0.15):
logmmse_from_fil... | [
"pydub.AudioSegment.from_wav",
"logmmse.logmmse_from_file",
"librosa.load",
"librosa.output.write_wav",
"librosa.effects.trim",
"librosa.get_duration"
] | [((134, 176), 'librosa.get_duration', 'librosa.get_duration', ([], {'filename': 'source_file'}), '(filename=source_file)\n', (154, 176), False, 'import librosa\n'), ((304, 470), 'logmmse.logmmse_from_file', 'logmmse_from_file', (['source_file'], {'output_file': '(output_file or source_file)', 'initial_noise': 'initial_... |
import glm
from ...opengl import *
from ...opengl.core.base import *
from ...geom import MeshFactory, LineMesh
vert_src = DEFAULT_SHADER_VERSION + """
#line 8
uniform mat4 u_projection;
in vec4 a_position;
in vec3 a_normal;
in vec4 a_color;
in vec2 a_texcoord;
in vec3 a_ambient;
out vec4 v_pos;
out vec3 v_normal;
o... | [
"glm.vec3"
] | [((4578, 4591), 'glm.vec3', 'glm.vec3', (['(1.1)'], {}), '(1.1)\n', (4586, 4591), False, 'import glm\n'), ((4542, 4568), 'glm.vec3', 'glm.vec3', (['self.focus_voxel'], {}), '(self.focus_voxel)\n', (4550, 4568), False, 'import glm\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-02-20 14:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0026_merge_20180220_1847'),
]
operations = [
migrations.AlterField(
... | [
"django.db.models.CharField"
] | [((406, 514), 'django.db.models.CharField', 'models.CharField', ([], {'choices': '[(\'live\', \'"live"\'), (\'closed\', \'"closed"\')]', 'default': '"""closed"""', 'max_length': '(100)'}), '(choices=[(\'live\', \'"live"\'), (\'closed\', \'"closed"\')],\n default=\'closed\', max_length=100)\n', (422, 514), False, 'fr... |
''' book and author data '''
from dataclasses import dataclass, field
from typing import List
from .base_activity import ActivityObject
from .image import Image
@dataclass(init=False)
class Book(ActivityObject):
''' serializes an edition or work, abstract '''
title: str
sortTitle: str = ''
subtitle: s... | [
"dataclasses.field",
"dataclasses.dataclass"
] | [((164, 185), 'dataclasses.dataclass', 'dataclass', ([], {'init': '(False)'}), '(init=False)\n', (173, 185), False, 'from dataclasses import dataclass, field\n'), ((876, 897), 'dataclasses.dataclass', 'dataclass', ([], {'init': '(False)'}), '(init=False)\n', (885, 897), False, 'from dataclasses import dataclass, field\... |
# coding: utf-8
"""Connect to a NatNet packet and dump the first mocap frame to disk.
This requires NatNetClient.py from the NatNet SDK, which I'm not distributing for legal reasons.
"""
import NatNetClient
def main():
client = NatNetClient.NatNetClient()
# Create socket
data_socket = client._create_d... | [
"NatNetClient.NatNetClient"
] | [((237, 264), 'NatNetClient.NatNetClient', 'NatNetClient.NatNetClient', ([], {}), '()\n', (262, 264), False, 'import NatNetClient\n')] |
import elasticsearch
import json
import time
import logging
logger = logging.getLogger("track.elasticlogs")
def __find_time_interval(query):
interval_found = False
ts_min = 0
ts_max = 0
ts_format = ""
field = ""
if 'query' in query and 'bool' in query['query'] and 'must' in query['query']['b... | [
"json.dumps",
"logging.getLogger",
"time.time"
] | [((71, 109), 'logging.getLogger', 'logging.getLogger', (['"""track.elasticlogs"""'], {}), "('track.elasticlogs')\n", (88, 109), False, 'import logging\n'), ((1988, 1999), 'time.time', 'time.time', ([], {}), '()\n', (1997, 1999), False, 'import time\n'), ((2531, 2550), 'json.dumps', 'json.dumps', (['request'], {}), '(re... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import sys
import numpy
import pkg_resources
from shutil import rmtree
from setuptools import setup, find_packages, Command
from distutils import util
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
from P... | [
"pkg_resources.parse_requirements",
"pybind11.get_include",
"setuptools.find_packages",
"wheel.bdist_wheel.bdist_wheel.finalize_options",
"os.path.dirname",
"os.system",
"PyMieSim.Tools.utils.Print",
"numpy.get_include",
"distutils.util.get_platform",
"os.path.join",
"sys.exit"
] | [((425, 510), 'PyMieSim.Tools.utils.Print', 'Print', ([], {'msg': 'f""" Plateform: {plateform} \n Version: {Version}"""', 'title': '"""PyMieSim"""'}), '(msg=f""" Plateform: {plateform} \n Version: {Version}""", title=\'PyMieSim\'\n )\n', (430, 510), False, 'from PyMieSim.Tools.utils import Print\n'), ((535, 560), 'o... |
from setuptools import setup
setup(name="european_factor_stockpicking_screener", version="0.0.1")
| [
"setuptools.setup"
] | [((30, 98), 'setuptools.setup', 'setup', ([], {'name': '"""european_factor_stockpicking_screener"""', 'version': '"""0.0.1"""'}), "(name='european_factor_stockpicking_screener', version='0.0.1')\n", (35, 98), False, 'from setuptools import setup\n')] |
import tkinter as tk
import moderngl
import numpy as np
from tkinter_framebuffer import FramebufferImage
from hello_world import HelloWorld2D, PanTool
ctx = moderngl.create_standalone_context()
canvas = HelloWorld2D(ctx)
pan_tool = PanTool()
def vertices():
x = np.linspace(-1.0, 1.0, 50)
y = np.random.ran... | [
"hello_world.PanTool",
"numpy.dstack",
"numpy.zeros",
"numpy.ones",
"numpy.linspace",
"moderngl.create_standalone_context",
"numpy.random.rand",
"hello_world.HelloWorld2D",
"tkinter.Label",
"tkinter.Tk",
"tkinter_framebuffer.FramebufferImage"
] | [((160, 196), 'moderngl.create_standalone_context', 'moderngl.create_standalone_context', ([], {}), '()\n', (194, 196), False, 'import moderngl\n'), ((207, 224), 'hello_world.HelloWorld2D', 'HelloWorld2D', (['ctx'], {}), '(ctx)\n', (219, 224), False, 'from hello_world import HelloWorld2D, PanTool\n'), ((236, 245), 'hel... |
'''
Copyright (c) 2020, Board of Trustees of the University of Iowa.
All rights reserved.
Use of this source code is governed by a BSD 3-Clause License that
can be found in the LICENSE file.
'''
from edu.uiowa.alogritms.SATMethod import run_sat_algo, run_enum_sat_algo, run_guided_sat_algo, run_guided_sat_enum_algo
fr... | [
"edu.uiowa.alogritms.DecisionTreeMethod.run_scikit_dt_algo",
"os.path.abspath",
"logging.debug",
"edu.uiowa.alogritms.SATMethod.run_sat_algo",
"logging.warn",
"edu.uiowa.alogritms.SMTMethod.run_adt_fin_algo",
"edu.uiowa.alogritms.SATMethod.run_enum_sat_algo",
"logging.info",
"edu.uiowa.alogritms.SyG... | [((1009, 1043), 'logging.info', 'logging.info', (["('*** AP:%s' % AP_Lit)"], {}), "('*** AP:%s' % AP_Lit)\n", (1021, 1043), False, 'import logging\n'), ((1250, 1307), 'logging.debug', 'logging.debug', (["('*** Unary Operators:%s' % unary_operators)"], {}), "('*** Unary Operators:%s' % unary_operators)\n", (1263, 1307),... |
import ntpath
import pathlib
import textwrap
from argo.workflows.dsl import Workflow
from argo.workflows.dsl.tasks import task
from argo.workflows.dsl.tasks import dependencies
from argo.workflows.dsl.tasks import parameter
from argo.workflows.dsl.templates import inputs
from argo.workflows.dsl.templates import templa... | [
"textwrap.dedent",
"ntpath.basename",
"argo.workflows.dsl.templates.V1alpha1ScriptTemplate",
"argo.workflows.dsl.templates.inputs.parameter",
"pathlib.Path",
"argo.workflows.dsl.tasks.parameter",
"argo.workflows.dsl.tasks.dependencies",
"argo.workflows.dsl.templates.V1Container"
] | [((638, 706), 'argo.workflows.dsl.tasks.parameter', 'parameter', ([], {'name': '"""message"""', 'value': '"""{{tasks.generate.outputs.result}}"""'}), "(name='message', value='{{tasks.generate.outputs.result}}')\n", (647, 706), False, 'from argo.workflows.dsl.tasks import parameter\n'), ((712, 738), 'argo.workflows.dsl.... |
import os
import time
import json
import utility_functions as UF
def cd_into_drive():
"""
Will change the current directory into the directory where the files that will be sorted are.
"""
project_location = os.getcwd()
directory_layers = len(project_location.split("/"))
command_parts = ["../"]... | [
"os.listdir",
"utility_functions.run_command",
"utility_functions.clear_output",
"json.load",
"utility_functions.file_creation_date",
"os.getcwd",
"os.popen",
"time.sleep",
"utility_functions.print_colored",
"os.chdir"
] | [((225, 236), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (234, 236), False, 'import os\n'), ((434, 448), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (442, 448), False, 'import os\n'), ((2961, 3007), 'utility_functions.run_command', 'UF.run_command', (["['mkdir', 'Duplicates']", '(False)'], {}), "(['mkdir', 'Du... |
from flask import Flask,request
app = Flask(__name__)
@app.route("/test", methods=['GET', 'POST'])
def test():
if request.method=="GET":
params=request.args
print(params)
return 'ok'
else:
params = request.form
print(params)
return 'oko'
if __name__ == '__main__':
app.run(
host='0.0... | [
"flask.Flask"
] | [((41, 56), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (46, 56), False, 'from flask import Flask, request\n')] |
from som.vm.universe import Universe
from som.vmobjects.primitive import UnaryPrimitive, BinaryPrimitive, Primitive
from som.primitives.primitives import Primitives
def _at(rcvr, i):
return rcvr.get_indexable_field(i.get_embedded_integer() - 1)
def _length(rcvr):
from som.vmobjects.integer import Integer
... | [
"som.vmobjects.primitive.UnaryPrimitive",
"som.vmobjects.primitive.BinaryPrimitive"
] | [((636, 679), 'som.vmobjects.primitive.BinaryPrimitive', 'BinaryPrimitive', (['"""at:"""', 'self._universe', '_at'], {}), "('at:', self._universe, _at)\n", (651, 679), False, 'from som.vmobjects.primitive import UnaryPrimitive, BinaryPrimitive, Primitive\n'), ((722, 771), 'som.vmobjects.primitive.UnaryPrimitive', 'Unar... |
import win32service
import win32serviceutil
import win32event
import win32evtlog
from time import sleep
import nt
import winreg
import zipimport
import ntpath
import win32con
import winerror
import pywintypes
import _win32sysloader
import servicemanager
from storjreports import send_storj_reports
class PySvc(win32ser... | [
"win32serviceutil.HandleCommandLine",
"servicemanager.StartServiceCtrlDispatcher",
"win32event.SetEvent",
"storjreports.send_storj_reports.windows_main",
"servicemanager.PrepareToHostSingle",
"win32event.WaitForSingleObject",
"win32event.CreateEvent",
"servicemanager.Initialize",
"win32serviceutil.S... | [((760, 814), 'win32serviceutil.ServiceFramework.__init__', 'win32serviceutil.ServiceFramework.__init__', (['self', 'args'], {}), '(self, args)\n', (802, 814), False, 'import win32serviceutil\n'), ((897, 937), 'win32event.CreateEvent', 'win32event.CreateEvent', (['None', '(0)', '(0)', 'None'], {}), '(None, 0, 0, None)\... |
# MicroPython One Time Password Generator
# Copyright (C) 2016 <NAME> <<EMAIL>>
# MIT License
from gc import collect
class Storage():
# TODO use json only in setup mode, store binary data
def __init__(self, file):
self.file = file
self._intent_prefix = '~'
def get_or_create(self):
... | [
"json.loads",
"os.rename",
"json.dumps",
"gc.collect",
"ubinascii.unhexlify"
] | [((703, 714), 'json.loads', 'loads', (['data'], {}), '(data)\n', (708, 714), False, 'from json import loads\n'), ((849, 858), 'gc.collect', 'collect', ([], {}), '()\n', (856, 858), False, 'from gc import collect\n'), ((951, 965), 'json.dumps', 'dumps', (['storage'], {}), '(storage)\n', (956, 965), False, 'from json imp... |
# --------------
import pandas as pd
from sklearn.model_selection import train_test_split
# Code starts here
data = pd.read_csv(path)
X = data.drop(columns=['customer.id', 'paid.back.loan'])
y = data['paid.back.loan']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0)
# Code ends h... | [
"sklearn.model_selection.GridSearchCV",
"matplotlib.pyplot.show",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.axis",
"sklearn.preprocessing.LabelEncoder",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.tree.export_graphviz",
"pydotplus.graph_from_dot_data",
"... | [((116, 133), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (127, 133), True, 'import pandas as pd\n'), ((253, 306), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.3)', 'random_state': '(0)'}), '(X, y, test_size=0.3, random_state=0)\n', (269, 306), False, ... |
import os
import sys
import time
import logging
for module in ['vk_api', 'flask']:
if module not in sys.modules:
os.system('python3 -m pip install {} --user'.format(module))
from vk_api.longpoll import VkLongPoll
from vk_api.exceptions import Captcha, ApiError, AuthError
from vk_api import VkApi
from fla... | [
"vk_api.longpoll.VkLongPoll",
"flask.redirect",
"logging.basicConfig",
"time.time",
"flask.jsonify",
"vk_api.VkApi"
] | [((847, 959), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""logs.log"""', 'filemode': '"""w"""', 'format': '"""%(asctime)s | %(levelname)s -- %(message)s"""'}), "(filename='logs.log', filemode='w', format=\n '%(asctime)s | %(levelname)s -- %(message)s')\n", (866, 959), False, 'import logging\n'... |
#!/usr/bin/env python
"""Run the app."""
from app import app
app.run(debug=True)
| [
"app.app.run"
] | [((70, 89), 'app.app.run', 'app.run', ([], {'debug': '(True)'}), '(debug=True)\n', (77, 89), False, 'from app import app\n')] |
from evolution.constants import TRAIT_CARD_DEFAULT_FOOD_TOKENS
from evolution.trait_cards.cards import TraitCard
__author__ = 'zeinamigeed'
class AmbushCard(TraitCard):
def __init__(self, num_tokens_as_food_card=TRAIT_CARD_DEFAULT_FOOD_TOKENS):
"""
:param num_tokens_as_food_card: The food tokens ... | [
"evolution.trait_cards.cards.TraitCard.__eq__"
] | [((667, 696), 'evolution.trait_cards.cards.TraitCard.__eq__', 'TraitCard.__eq__', (['self', 'other'], {}), '(self, other)\n', (683, 696), False, 'from evolution.trait_cards.cards import TraitCard\n')] |
import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipies.serializer import... | [
"tempfile.NamedTemporaryFile",
"core.models.Tag.objects.create",
"PIL.Image.new",
"core.models.Recipe.objects.all",
"core.models.Recipe.objects.create",
"recipies.serializer.RecipeSerializer",
"core.models.Recipe.objects.get",
"recipies.serializer.RecipeDetailSerializer",
"os.path.exists",
"django... | [((377, 408), 'django.urls.reverse', 'reverse', (['"""recipies:recipe-list"""'], {}), "('recipies:recipe-list')\n", (384, 408), False, 'from django.urls import reverse\n'), ((630, 674), 'core.models.Recipe.objects.create', 'Recipe.objects.create', ([], {'user': 'user'}), '(user=user, **defaults)\n', (651, 674), False, ... |
import math
import copy
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
# class EncoderDecoder(nn.Module):
# """
# A standard Encoder-Decoder architecture. Base for this and many
# other models.
# """
# def __init__(self, encoder, decoder, src_embed, tgt_embed... | [
"torch.nn.Dropout",
"torch.nn.Embedding",
"torch.cat",
"numpy.ones",
"torch.cos",
"torch.arange",
"torch.ones",
"torch.nn.Linear",
"torch.zeros",
"math.log",
"torch.matmul",
"copy.deepcopy",
"torch.zeros_like",
"math.sqrt",
"torch.nn.init.xavier_uniform_",
"torch.from_numpy",
"torch.... | [((1758, 1782), 'torch.zeros', 'torch.zeros', (['x.shape[:2]'], {}), '(x.shape[:2])\n', (1769, 1782), False, 'import torch\n'), ((7274, 7295), 'torch.zeros_like', 'torch.zeros_like', (['tgt'], {}), '(tgt)\n', (7290, 7295), False, 'import torch\n'), ((7791, 7816), 'torch.nn.functional.softmax', 'F.softmax', (['scores'],... |
import os
import sys
from pypy.tool.udir import udir
from distutils import ccompiler
import py
import ctypes
c_source = """
void *int_to_void_p(int arg) {}
struct random_strucutre {
int one;
int *two;
};
struct random_structure* int_int_to_struct_p(int one, int two) {}
"""
class TestBasic:
def setup_class(... | [
"pypy.tool.udir.udir.join",
"distutils.ccompiler.new_compiler"
] | [((345, 369), 'distutils.ccompiler.new_compiler', 'ccompiler.new_compiler', ([], {}), '()\n', (367, 369), False, 'from distutils import ccompiler\n'), ((387, 409), 'pypy.tool.udir.udir.join', 'udir.join', (['"""rffilib.c"""'], {}), "('rffilib.c')\n", (396, 409), False, 'from pypy.tool.udir import udir\n'), ((659, 682),... |
import matplotlib
matplotlib.use('MacOSX')
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import mglearn
X, y = mglearn.datasets.load_extended_boston()
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
from sklearn.li... | [
"mglearn.datasets.load_extended_boston",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.legend",
"sklearn.linear_model.LinearRegression",
"matplotlib.use",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.x... | [((18, 42), 'matplotlib.use', 'matplotlib.use', (['"""MacOSX"""'], {}), "('MacOSX')\n", (32, 42), False, 'import matplotlib\n'), ((137, 176), 'mglearn.datasets.load_extended_boston', 'mglearn.datasets.load_extended_boston', ([], {}), '()\n', (174, 176), False, 'import mglearn\n'), ((265, 303), 'sklearn.model_selection.... |
import urllib.request
import requests
class GeocoderPipeline(object):
def process_item(self, item, spider):
address = item['address']
print(address)
geocode_url = 'https://geocode-maps.yandex.ru/1.x/?format=json&geocode={0}'.format(
urllib.request.quote(address))
respons... | [
"requests.get"
] | [((324, 349), 'requests.get', 'requests.get', (['geocode_url'], {}), '(geocode_url)\n', (336, 349), False, 'import requests\n')] |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
"openstack.exceptions.raise_from_response",
"openstack.resource.Body",
"openstack.utils.urljoin"
] | [((900, 944), 'openstack.resource.Body', 'resource.Body', (['"""tags"""'], {'type': 'list', 'default': '[]'}), "('tags', type=list, default=[])\n", (913, 944), False, 'from openstack import resource\n'), ((1176, 1222), 'openstack.utils.urljoin', 'utils.urljoin', (['self.base_path', 'self.id', '"""tags"""'], {}), "(self... |
import tkinter
import test as t
def main_form(main_wind):
def save_info():
t.add_person(firstname.get(), lastname.get(), birth.get(), tel.get(), adresse.get(), mail.get(), id_bien.get(), presta.get(), divers.get())
firstname_entry.delete(0, tkinter.END)
lastname_entry.delete(0, tkinter.END)
birth_e... | [
"tkinter.StringVar",
"tkinter.Button",
"tkinter.Entry",
"tkinter.Toplevel",
"tkinter.Label"
] | [((625, 652), 'tkinter.Toplevel', 'tkinter.Toplevel', (['main_wind'], {}), '(main_wind)\n', (641, 652), False, 'import tkinter\n'), ((736, 845), 'tkinter.Label', 'tkinter.Label', (['screen'], {'text': '"""Ajouter un(e) client(e)"""', 'bg': '"""#645e6b"""', 'fg': '"""white"""', 'width': '"""500"""', 'height': '"""3"""'}... |
import pytest
from app.models import User
class TestUserModel:
def test_password_setter(self):
u = User('test', '<EMAIL>', password='<PASSWORD>')
assert u.password_hash
def test_no_password_getter(self):
u = User('test', '<EMAIL>', password='<PASSWORD>')
with pytest.raises(At... | [
"app.models.User",
"app.models.User.query.get",
"app.models.User.validate",
"pytest.raises",
"app.models.User.decodeToken",
"pytest.mark.usefixtures"
] | [((545, 583), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""vanilla_app"""'], {}), "('vanilla_app')\n", (568, 583), False, 'import pytest\n'), ((114, 160), 'app.models.User', 'User', (['"""test"""', '"""<EMAIL>"""'], {'password': '"""<PASSWORD>"""'}), "('test', '<EMAIL>', password='<PASSWORD>')\n", (118, ... |
from picotui.context import Context
from picotui.dialogs import *
with Context():
# Feel free to comment out extra dialogs to play with a particular
# in detail
d = DTextEntry(25, "Hello World", title="Wazzup?")
res = d.result()
d = DMultiEntry(25, 5, "Hello\nWorld".split("\n"), title="Comment:")
... | [
"picotui.context.Context"
] | [((73, 82), 'picotui.context.Context', 'Context', ([], {}), '()\n', (80, 82), False, 'from picotui.context import Context\n')] |
# Copyright (C) 2016 Red Hat
#
# 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,... | [
"managesf.services.exceptions.GroupNotFoundException",
"logging.getLogger"
] | [((687, 714), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (704, 714), False, 'import logging\n'), ((1487, 1552), 'managesf.services.exceptions.GroupNotFoundException', 'exc.GroupNotFoundException', (["('Unable to find group %s' % groupname)"], {}), "('Unable to find group %s' % groupna... |
#!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "<NAME>" at 21:43, 01/02/2020 %
# ... | [
"pickle.dump",
"utils.FunctionUtil.cal_std",
"pickle.load",
"numpy.array",
"utils.class_utils.AlgoInfor",
"utils.FunctionUtil.cal_mean"
] | [((1245, 1256), 'utils.class_utils.AlgoInfor', 'AlgoInfor', ([], {}), '()\n', (1254, 1256), False, 'from utils.class_utils import AlgoInfor\n'), ((2712, 2756), 'pickle.dump', 'pkl.dump', (['algo_dict', 'f', 'pkl.HIGHEST_PROTOCOL'], {}), '(algo_dict, f, pkl.HIGHEST_PROTOCOL)\n', (2720, 2756), True, 'import pickle as pkl... |
import fenics
N = 1000
mesh = fenics.UnitIntervalMesh(N)
P1 = fenics.FiniteElement('P', mesh.ufl_cell(), 1)
V = fenics.FunctionSpace(mesh, P1)
psi = fenics.TestFunction(V)
T = fenics.Function(V)
stefan_number = 0.045
Ste = fenics.Constant(stefan_number)
regularization_central_temperature = 0.
T_r = fenic... | [
"fenics.TestFunction",
"fenics.tanh",
"fenics.Expression",
"fenics.NonlinearVariationalSolver",
"fenics.NonlinearVariationalProblem",
"fenics.DirichletBC",
"fenics.Constant",
"fenics.TrialFunction",
"fenics.UnitIntervalMesh",
"fenics.Function",
"fenics.FunctionSpace"
] | [((33, 59), 'fenics.UnitIntervalMesh', 'fenics.UnitIntervalMesh', (['N'], {}), '(N)\n', (56, 59), False, 'import fenics\n'), ((118, 148), 'fenics.FunctionSpace', 'fenics.FunctionSpace', (['mesh', 'P1'], {}), '(mesh, P1)\n', (138, 148), False, 'import fenics\n'), ((157, 179), 'fenics.TestFunction', 'fenics.TestFunction'... |
import unittest
import os
import sys
sys.path.append('..')
from app import app
from auth import randomString, encode_jwt, decode_jwt
class Test_Pubworkflow(unittest.TestCase):
# adapted from https://pynative.com/python-generate-random-string/
def setUp(self):
self.app = app
admin = {}
... | [
"sys.path.append",
"os.path.abspath",
"auth.decode_jwt",
"auth.encode_jwt",
"auth.randomString",
"os.path.join"
] | [((37, 58), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (52, 58), False, 'import sys\n'), ((468, 485), 'auth.encode_jwt', 'encode_jwt', (['admin'], {}), '(admin)\n', (478, 485), False, 'from auth import randomString, encode_jwt, decode_jwt\n'), ((595, 611), 'auth.encode_jwt', 'encode_jwt', (['... |
#/usr/bin/env python
#-*- coding:utf-8 -*-
'''
@author: wujiyang
@date: 2018-01-31
@brief: use mtcnn.py to do face detection and face alignment work.
'''
import cv2
import sys
import math
import mtcnn
def faceAlign(input_image, points, output_size = (96, 112), ec_mc_y = 40):
'''
return the size-fixed align i... | [
"math.sqrt",
"math.atan2",
"cv2.waitKey",
"cv2.imread",
"cv2.warpAffine",
"mtcnn.drawBoxes",
"mtcnn.initFaceDetector",
"mtcnn.detect_face",
"cv2.imshow",
"cv2.getRotationMatrix2D"
] | [((2121, 2196), 'mtcnn.detect_face', 'mtcnn.detect_face', (['img', 'minsize', 'PNet', 'RNet', 'ONet', 'threshold', '(False)', 'factor'], {}), '(img, minsize, PNet, RNet, ONet, threshold, False, factor)\n', (2138, 2196), False, 'import mtcnn\n'), ((2601, 2625), 'mtcnn.initFaceDetector', 'mtcnn.initFaceDetector', ([], {}... |
# This handles the basic functions of a CaptainJapan scraper.
from selenium.webdriver.chrome.options import Options
import undetected_chromedriver as uc
from bs4 import BeautifulSoup
import requests
import time
from cj.utils.exceptions import NoJsException, NoScrollException
class Scraper:
"""
Implements th... | [
"selenium.webdriver.chrome.options.Options",
"time.sleep",
"undetected_chromedriver.Chrome",
"requests.get",
"bs4.BeautifulSoup"
] | [((1984, 1993), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (1991, 1993), False, 'from selenium.webdriver.chrome.options import Options\n'), ((2693, 2719), 'undetected_chromedriver.Chrome', 'uc.Chrome', ([], {'options': 'options'}), '(options=options)\n', (2702, 2719), True, 'import undete... |
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, re_path
from django.conf.urls import include
from django.views.generic.base import RedirectView
from rest_framework.decorators import api_view
from rest_framework.response import ... | [
"django.views.generic.base.RedirectView.as_view",
"django.conf.urls.include",
"django.urls.path",
"rest_framework.response.Response",
"rest_framework.decorators.api_view",
"django.conf.urls.static.static"
] | [((669, 679), 'rest_framework.decorators.api_view', 'api_view', ([], {}), '()\n', (677, 679), False, 'from rest_framework.decorators import api_view\n'), ((721, 747), 'rest_framework.response.Response', 'Response', (['settings.VERSION'], {}), '(settings.VERSION)\n', (729, 747), False, 'from rest_framework.response impo... |
from PyQt5 import QtCore, QtGui, QtWidgets
import sys
class InputDialog(QtWidgets.QDialog):
def __init__(self, max_frames, parent=None):
super().__init__(parent)
self.setWindowFlags(self.windowFlags()
^ QtCore.Qt.WindowContextHelpButtonHint)
# init view and callbacks
... | [
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtWidgets.QSpacerItem",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QDialogButtonBox",
"PyQt5.QtWidgets.QSpinBox",
"PyQt5.QtWidgets.QFormLayout"
] | [((2662, 2694), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (2684, 2694), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((634, 661), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', (['self'], {}), '(self)\n', (655, 661), False, 'from PyQt5 import QtCor... |
#!/usr/bin/env python3
import os
from setuptools import setup
base_dir = os.path.dirname(__file__)
about = {}
with open(os.path.join(base_dir, "delphin", "__about__.py")) as f:
exec(f.read(), about)
with open(os.path.join(base_dir, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
repp_requi... | [
"os.path.dirname",
"os.path.isfile",
"os.path.join",
"setuptools.setup"
] | [((75, 100), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (90, 100), False, 'import os\n'), ((467, 517), 'os.path.join', 'os.path.join', (['base_dir', '"""docs"""', '"""requirements.txt"""'], {}), "(base_dir, 'docs', 'requirements.txt')\n", (479, 517), False, 'import os\n'), ((521, 553), 'o... |
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
from commons.core_util import CollectionTools
from cpp.cpp_util import regular_guard, is_ms_generated_guard
import csv
import logging
import os.path
import sys
#from commons.configurator import Configurator
def check_include_guards(files_to_guards, path_name, guard):
... | [
"cpp.cpp_util.is_ms_generated_guard",
"cpp.cpp_util.regular_guard",
"logging.basicConfig"
] | [((1115, 1174), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stderr', 'level': 'logging.DEBUG'}), '(stream=sys.stderr, level=logging.DEBUG)\n', (1134, 1174), False, 'import logging\n'), ((538, 562), 'cpp.cpp_util.regular_guard', 'regular_guard', (['file_name'], {}), '(file_name)\n', (551, 562), Fa... |
import inspect
import sys
from operator import methodcaller
import pytest
from gentools import py2_compatible, return_
import snug
try:
import urllib.request as urllib
except ImportError:
import urllib2 as urllib
py3 = pytest.mark.skipif(sys.version_info < (3, ), reason='python 3+ only')
class MockClient... | [
"snug.executor",
"snug.query._identity",
"snug.send.register",
"snug.send_async.register",
"operator.methodcaller",
"snug.GET",
"snug.Response",
"pytest.mark.skipif",
"inspect.isawaitable",
"snug.async_executor"
] | [((232, 300), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(sys.version_info < (3,))'], {'reason': '"""python 3+ only"""'}), "(sys.version_info < (3,), reason='python 3+ only')\n", (250, 300), False, 'import pytest\n'), ((481, 528), 'snug.send.register', 'snug.send.register', (['MockClient', 'MockClient.send'], {}), ... |
"""
Copyright (C) 2020 ETH Zurich. All rights reserved.
Author: <NAME>, ETH Zurich
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
... | [
"os.path.abspath",
"sys.path.insert"
] | [((818, 849), 'sys.path.insert', 'sys.path.insert', (['(0)', 'path_to_lib'], {}), '(0, path_to_lib)\n', (833, 849), False, 'import sys\n'), ((1278, 1295), 'os.path.abspath', 'abspath', (['__file__'], {}), '(__file__)\n', (1285, 1295), False, 'from os.path import abspath\n'), ((795, 812), 'os.path.abspath', 'abspath', (... |
# %% REQUIRED LIBRARIES
import os
import pandas as pd
import numpy as np
from plotly.offline import plot
import plotly.graph_objs as go
import plotly.express as px
from pyloopkit.loop_data_manager import update
from src.input_data_tools import input_table_to_dict, dict_inputs_to_dataframes
# %% REFERENCES
"""
A versio... | [
"pandas.DataFrame",
"os.path.join",
"plotly.graph_objs.Scatter",
"src.input_data_tools.dict_inputs_to_dataframes",
"numpy.ones",
"plotly.offline.plot",
"numpy.max",
"numpy.mean",
"numpy.arange",
"pyloopkit.loop_data_manager.update",
"numpy.linspace",
"src.input_data_tools.input_table_to_dict",... | [((746, 778), 'src.input_data_tools.input_table_to_dict', 'input_table_to_dict', (['scenario_df'], {}), '(scenario_df)\n', (765, 778), False, 'from src.input_data_tools import input_table_to_dict, dict_inputs_to_dataframes\n'), ((838, 862), 'pyloopkit.loop_data_manager.update', 'update', (['inputs_from_file'], {}), '(i... |
import tensorflow as tf
from tensorflow.contrib.seq2seq.python.ops.helper import CustomHelper
from tensorflow.contrib.rnn import *
class InferenceHelper(CustomHelper):
def _initialize_fn(self):
# we always reconstruct the whole output
finished = tf.tile([False], [self._batch_size])
next_in... | [
"tensorflow.layers.dense",
"tensorflow.concat",
"tensorflow.variable_scope",
"tensorflow.tile",
"tensorflow.zeros",
"tensorflow.layers.max_pooling1d",
"tensorflow.summary.histogram",
"tensorflow.layers.conv1d",
"tensorflow.nn.bidirectional_dynamic_rnn",
"tensorflow.shape",
"tensorflow.layers.bat... | [((1103, 1165), 'tensorflow.layers.dense', 'tf.layers.dense', (['inputs'], {'units': 'units', 'activation': 'tf.nn.sigmoid'}), '(inputs, units=units, activation=tf.nn.sigmoid)\n', (1118, 1165), True, 'import tensorflow as tf\n'), ((1255, 1314), 'tensorflow.layers.dense', 'tf.layers.dense', (['inputs'], {'units': 'units... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-08-06 02:47
from __future__ import unicode_literals
from django.conf import settings
import django.contrib.gis.db.models.fields
import django.contrib.postgres.fields.jsonb
import django.core.files.storage
from django.db import migrations, models
import djang... | [
"django.db.models.TextField",
"django.db.models.NullBooleanField",
"django.db.migrations.swappable_dependency",
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.PositiveIntegerField",
"django.db.models.BooleanField",
"django.db.models... | [((489, 546), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (520, 546), False, 'from django.db import migrations, models\n'), ((26611, 26766), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)'... |
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D, multiply, BatchNormalization
from tensorflow.keras.optimizers import Adam
from vunet.train.models.control_strong import FilmStrong
from vunet.train.models.unet import get_activation, u_net_deconv_block
f... | [
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.multiply",
"tensorflow.keras.layers.BatchNormalization",
"vunet.train.models.unet.u_net_deconv_block",
"vunet.train.models.unet.get_activation",
"vunet.train.models.control_strong.FilmStrong",
"tensorflow.keras.models.Model",
"tensorflow.rando... | [((1149, 1180), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': 'config.INPUT_SHAPE'}), '(shape=config.INPUT_SHAPE)\n', (1154, 1180), False, 'from tensorflow.keras.layers import Input, Conv2D, multiply, BatchNormalization\n'), ((1250, 1294), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '[config.Z_D... |
import time
import numpy as np
import tensorflow as tf
from PIL import Image
from core import utils
import cv2
import argparse
IMAGE_H, IMAGE_W = 416, 416
parser = argparse.ArgumentParser(description="gpu模式下不能设置score_thresh和iou_thresh")
parser.add_argument("--video_id", "-vi", default=0, help="传入相机的id,可以是图片,视频,网络摄像头(e... | [
"argparse.ArgumentParser",
"core.utils.cpu_nms",
"cv2.imshow",
"core.utils.draw_boxes",
"cv2.cvtColor",
"cv2.imwrite",
"time.localtime",
"core.utils.read_pb_return_tensors",
"cv2.waitKey",
"numpy.asarray",
"tensorflow.Session",
"tensorflow.Graph",
"core.utils.draw_Chinese",
"cv2.putText",
... | [((165, 237), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""gpu模式下不能设置score_thresh和iou_thresh"""'}), "(description='gpu模式下不能设置score_thresh和iou_thresh')\n", (188, 237), False, 'import argparse\n'), ((725, 767), 'core.utils.read_coco_names', 'utils.read_coco_names', (['"""./data/coco.name... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.thing_list, name='thing_list'),
path('<thing_id>', views.thing_single_properties, name='thing_single_properties'),
path('<thing_id>/actions', views.thing_single_actions, name='thing_single_actions'),
path('<thing_id>/event... | [
"django.urls.path"
] | [((71, 116), 'django.urls.path', 'path', (['""""""', 'views.thing_list'], {'name': '"""thing_list"""'}), "('', views.thing_list, name='thing_list')\n", (75, 116), False, 'from django.urls import path\n'), ((122, 208), 'django.urls.path', 'path', (['"""<thing_id>"""', 'views.thing_single_properties'], {'name': '"""thing... |
import server
import mud
import event
def __init__() :
event.add_null_system_listener("logon.enter",server.HOOK_PLAYER_ENTERED_GAME,do_q)
def __end__() :
event.remove_null_system_listener("logon.enter")
def do_q(type, args) :
mud.log("Player login (%s) detected (python event)" % args.actor.player.name)
return 0... | [
"mud.log",
"event.remove_null_system_listener",
"event.add_null_system_listener"
] | [((57, 146), 'event.add_null_system_listener', 'event.add_null_system_listener', (['"""logon.enter"""', 'server.HOOK_PLAYER_ENTERED_GAME', 'do_q'], {}), "('logon.enter', server.\n HOOK_PLAYER_ENTERED_GAME, do_q)\n", (87, 146), False, 'import event\n'), ((158, 206), 'event.remove_null_system_listener', 'event.remove_... |
#!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "0.1.0",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = r"""
---
module: launchdarkly_project
short_description: Create Project
descript... | [
"ansible_collections.launchdarkly_labs.collection.plugins.module_utils.base.rego_test",
"ansible_collections.launchdarkly_labs.collection.plugins.module_utils.environment.env_ld_builder",
"ansible_collections.launchdarkly_labs.collection.plugins.module_utils.base.configure_instance",
"ansible_collections.laun... | [((2658, 2683), 'ansible_collections.launchdarkly_labs.collection.plugins.module_utils.base.ld_common_argument_spec', 'ld_common_argument_spec', ([], {}), '()\n', (2681, 2683), False, 'from ansible_collections.launchdarkly_labs.collection.plugins.module_utils.base import configure_instance, fail_exit, ld_common_argumen... |
"""
OpenSSH tasks
=============
This module provides tools to manage OpenSSH server and client.
"""
from __future__ import print_function
# from fabric.api import hide, shell_env
# from fabric.contrib.files import append, sed
# from burlap.service import is_running, restart
# from burlap.files import watch
from bu... | [
"burlap.decorators.task"
] | [((3320, 3349), 'burlap.decorators.task', 'task', ([], {'precursors': "['packager']"}), "(precursors=['packager'])\n", (3324, 3349), False, 'from burlap.decorators import task\n')] |
import os
import spur
import httplib
from overlord import celery
from urlparse import urlparse
def check_uptime(site):
"""
Simple script to perform HTTP requests to any URL and see if it
throws an exception when we do a HEAD request.
"""
url = urlparse(site)
try:
conn = httplib.HTTPCon... | [
"httplib.HTTPConnection",
"urlparse.urlparse",
"spur.SshShell"
] | [((266, 280), 'urlparse.urlparse', 'urlparse', (['site'], {}), '(site)\n', (274, 280), False, 'from urlparse import urlparse\n'), ((305, 335), 'httplib.HTTPConnection', 'httplib.HTTPConnection', (['url[1]'], {}), '(url[1])\n', (327, 335), False, 'import httplib\n'), ((871, 1075), 'spur.SshShell', 'spur.SshShell', ([], ... |
# -*- coding: utf-8 -*-
import os
import ssl
import aiohttp
from enum import Enum
from hagworm.extend.base import ContextManager
from hagworm.extend.asyncio.base import AsyncCirculatorForSecond
from hagworm.extend.asyncio.buffer import FileBuffer
from .base import Utils
class STATE(Enum):
PENDING = 0x00
... | [
"hagworm.extend.asyncio.buffer.FileBuffer",
"os.path.abspath",
"os.remove",
"aiohttp.client.ClientTimeout",
"ssl.create_default_context",
"hagworm.extend.asyncio.base.AsyncCirculatorForSecond",
"os.path.exists",
"aiohttp.ClientSession",
"aiohttp.TCPConnector"
] | [((394, 479), 'aiohttp.client.ClientTimeout', 'aiohttp.client.ClientTimeout', ([], {'total': '(60)', 'connect': '(10)', 'sock_read': '(60)', 'sock_connect': '(10)'}), '(total=60, connect=10, sock_read=60,\n sock_connect=10)\n', (422, 479), False, 'import aiohttp\n'), ((495, 582), 'aiohttp.client.ClientTimeout', 'aio... |
#!/usr/bin/env python3
import base64
import json
import logging
import os
import time
import arrow
import boto3
import click
import docker
from botocore.exceptions import ClientError
from git import Repo
class EcrImageScanTimeout(Exception):
pass
class EcrGetImageIdTimeout(Exception):
pass
class Multipl... | [
"docker.from_env",
"click.argument",
"boto3.client",
"click.option",
"git.Repo",
"json.dumps",
"time.sleep",
"click.Choice",
"os.environ.get",
"logging.info",
"base64.b64decode",
"arrow.utcnow",
"click.group"
] | [((7957, 7970), 'click.group', 'click.group', ([], {}), '()\n', (7968, 7970), False, 'import click\n'), ((8219, 8262), 'click.option', 'click.option', (['"""--repo-path"""'], {'required': '(False)'}), "('--repo-path', required=False)\n", (8231, 8262), False, 'import click\n'), ((8278, 8341), 'click.option', 'click.opti... |
import direct.showbase.ShowBase as panda3d_SB
class MyApp(panda3d_SB.ShowBase):
def __init__(self):
panda3d_SB.ShowBase.__init__(self)
# Make sure models are not stored in "models/" or panda3d will look inside the sdk
self.icosphere = self.loader.loadModel("myModels/icosphere")
sel... | [
"direct.showbase.ShowBase.ShowBase.__init__"
] | [((113, 147), 'direct.showbase.ShowBase.ShowBase.__init__', 'panda3d_SB.ShowBase.__init__', (['self'], {}), '(self)\n', (141, 147), True, 'import direct.showbase.ShowBase as panda3d_SB\n')] |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 11 10:03:29 2020
@author: sid
"""
from matplotlib import pyplot as plt
import numpy as np
import plotly.express as px
from scipy import ndimage, signal
import pandas as pd
plt.ion()
#Detector calibration and setup
import pyFAI, pyFAI.detectors, fabio
impor... | [
"matplotlib.pyplot.loglog",
"numpy.ones",
"numpy.argmin",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tick_params",
"plotly.express.scatter",
"pyFAI.azimuthalIntegrator.AzimuthalIntegrator",
"scipy.signal.convolve2d",
"pyFAI.calibrant.get_calibrant",
"matplotlib.pyplot.imshow",
"matplotlib.py... | [((233, 242), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (240, 242), True, 'from matplotlib import pyplot as plt\n'), ((592, 697), 'fabio.open', 'fabio.open', (['"""C:\\\\PhD work\\\\PhD_May20\\\\SAXS107cm\\\\Box_01\\\\Aerogel1_2_60s_107cm_01_unwarped.gfrm"""'], {}), "(\n 'C:\\\\PhD work\\\\PhD_May20\\\\S... |
'''
Butterworth filter: lowpass, highpass and bandpass.
Author: <NAME> (<EMAIL>)
'''
import numpy as np
# import matplotlib.pyplot as plt
import xarray as xr
from ..butter import lowpass as lp
from ..butter import highpass as hp
from ..butter import bandpass as bp
def lowpass(da, cutoff=0.25, order=2, dim=None, fs=... | [
"xarray.DataArray"
] | [((1165, 1219), 'xarray.DataArray', 'xr.DataArray', (['Y'], {'dims': 'dims', 'coords': 'coords', 'attrs': 'attrs'}), '(Y, dims=dims, coords=coords, attrs=attrs)\n', (1177, 1219), True, 'import xarray as xr\n'), ((2124, 2178), 'xarray.DataArray', 'xr.DataArray', (['Y'], {'dims': 'dims', 'coords': 'coords', 'attrs': 'att... |
# Monitoring the progress of a multithreaded computation.
#
# Copyright © 2014 <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
# There is N... | [
"traceback.format_exception_only",
"signal.pthread_sigmask",
"select.poll",
"curses.endwin",
"os.pipe2",
"datetime.datetime.utcnow",
"os.close",
"sys.exc_info",
"locale.setlocale",
"curses.resizeterm",
"curses.typeahead",
"curses.initscr",
"signal.siginterrupt",
"threading.Lock",
"thread... | [((3951, 3985), 'traceback.format_exception', 'traceback.format_exception', (['*einfo'], {}), '(*einfo)\n', (3977, 3985), False, 'import traceback\n'), ((12085, 12101), 'curses.initscr', 'curses.initscr', ([], {}), '()\n', (12099, 12101), False, 'import curses\n'), ((12166, 12181), 'curses.noecho', 'curses.noecho', ([]... |
from django_pg import models
class Game(models.Model):
label = models.CharField(max_length=100)
number = models.PositiveIntegerField()
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
class Moogle(models.Model):
game = models.ForeignKey(Game)
l... | [
"django_pg.models.ForeignKey",
"django_pg.models.CharField",
"django_pg.models.DateTimeField",
"django_pg.models.PositiveIntegerField",
"django_pg.models.TextField"
] | [((69, 101), 'django_pg.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (85, 101), False, 'from django_pg import models\n'), ((115, 144), 'django_pg.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {}), '()\n', (142, 144), False, 'from django_pg import models... |
from refnx.reflect.reflect_model import (ReflectModel, reflectivity,
MixedReflectModel)
from refnx.reflect.structure import (Structure, SLD, Slab, Component,
sld_profile, Stack)
from refnx.reflect.interface import (Erf, Interface, Linear, Exp... | [
"refnx._lib._testutils.PytestTester"
] | [((944, 966), 'refnx._lib._testutils.PytestTester', 'PytestTester', (['__name__'], {}), '(__name__)\n', (956, 966), False, 'from refnx._lib._testutils import PytestTester\n')] |
# -*- coding: utf-8 -*-
"""Script for identifying insertions using available aligners."""
# pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import
from __future__ import absolute_import, division, print_function
from builtins import *
# pylint: enable=wildcard-import,redefined-builtin,unused-wildcard... | [
"imfusion.model.Insertion.to_frame",
"imfusion.insertions.aligners.get_aligners",
"argparse.ArgumentParser",
"logging.basicConfig"
] | [((536, 624), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': 'FORMAT', 'level': 'logging.INFO', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""'}), "(format=FORMAT, level=logging.INFO, datefmt=\n '%Y-%m-%d %H:%M:%S')\n", (555, 624), False, 'import logging\n'), ((1037, 1067), 'imfusion.model.Insertion.to_frame', '... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import os
from codecs import open
with open("README.rst", "r") as f:
readme = f.read()
def get_packages(package):
return [
dirpath
for dirpath, dirnames, filenames in os.walk(package)
if os.path.exists(os.path... | [
"os.walk",
"os.path.join",
"codecs.open"
] | [((116, 139), 'codecs.open', 'open', (['"""README.rst"""', '"""r"""'], {}), "('README.rst', 'r')\n", (120, 139), False, 'from codecs import open\n'), ((270, 286), 'os.walk', 'os.walk', (['package'], {}), '(package)\n', (277, 286), False, 'import os\n'), ((313, 349), 'os.path.join', 'os.path.join', (['dirpath', '"""__in... |
import io
from types import LambdaType
import pytest
import pickle
import dill
import src.lambdser as lambdser
@pytest.fixture()
def lambda_closure():
fine = "fine"
stop = "."
return lambda x: x + "works " + fine + stop
@pytest.fixture()
def lambda_no_closure():
return lambda x: x + "works fine."
... | [
"src.lambdser.dumps",
"io.BytesIO",
"src.lambdser.lambdser.LambdserPickler",
"pytest.fixture",
"dill.dumps",
"dill.loads",
"pytest.raises",
"src.lambdser.loads",
"pytest.mark.parametrize",
"pickle.dumps"
] | [((116, 132), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (130, 132), False, 'import pytest\n'), ((239, 255), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (253, 255), False, 'import pytest\n'), ((338, 354), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (352, 354), False, 'import pytest\n'), (... |
from distutils.core import setup
setup(
name = 'awssl',
packages = ['awssl', 'awssl.ext'],
version = '0.2',
description = 'Classes to generate ASL for AWS Step Functions',
author = '<NAME>',
author_email = '<EMAIL>',
url = 'https://github.com/gford1000/awssl',
download_url = 'https://github.com/gford1... | [
"distutils.core.setup"
] | [((33, 398), 'distutils.core.setup', 'setup', ([], {'name': '"""awssl"""', 'packages': "['awssl', 'awssl.ext']", 'version': '"""0.2"""', 'description': '"""Classes to generate ASL for AWS Step Functions"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/gford1000/awssl"""', 'd... |
from django.contrib import admin
from .models import ZakatType
admin.site.register([
ZakatType
])
| [
"django.contrib.admin.site.register"
] | [((65, 97), 'django.contrib.admin.site.register', 'admin.site.register', (['[ZakatType]'], {}), '([ZakatType])\n', (84, 97), False, 'from django.contrib import admin\n')] |
import numpy as np
from network import Netowork
from layers import FCLayer, ActivationLayer
from activations import tanh, tanh_prime
from loss import mse, mse_prime
# training data
x_train = np.array([[[0,0]],[[0,1]],[[1,0]],[[1,1]]])
y_train = np.array([[[0]],[[1]],[[1]],[[0]]])
# network
net = Netowork()
net.add(F... | [
"network.Netowork",
"layers.FCLayer",
"layers.ActivationLayer",
"numpy.array"
] | [((193, 243), 'numpy.array', 'np.array', (['[[[0, 0]], [[0, 1]], [[1, 0]], [[1, 1]]]'], {}), '([[[0, 0]], [[0, 1]], [[1, 0]], [[1, 1]]])\n', (201, 243), True, 'import numpy as np\n'), ((247, 285), 'numpy.array', 'np.array', (['[[[0]], [[1]], [[1]], [[0]]]'], {}), '([[[0]], [[1]], [[1]], [[0]]])\n', (255, 285), True, 'i... |
import os
import csv
from outputters.base_outputter import BaseOutputter
class Outputter(BaseOutputter):
"""Outputter result into a CSV file
"""
@property
def REQUIRED_FIELDS(self):
return []
def __init__(self, config):
BaseOutputter.__init__(self, config)
self.file = c... | [
"outputters.base_outputter.BaseOutputter.__init__",
"os.path.join",
"os.path.exists"
] | [((261, 297), 'outputters.base_outputter.BaseOutputter.__init__', 'BaseOutputter.__init__', (['self', 'config'], {}), '(self, config)\n', (283, 297), False, 'from outputters.base_outputter import BaseOutputter\n'), ((613, 656), 'os.path.join', 'os.path.join', (['self.output_folder', 'self.file'], {}), '(self.output_fol... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import numpy as np
from ..tokenization import WordTokenizer
class BaseEncoder(nn.Module):
def __init__(self,
token2id,
max_length=128,
hidden_size=230,
word_size=5... | [
"math.sqrt",
"torch.nn.Embedding",
"torch.randn",
"torch.cat",
"torch.zeros",
"torch.tensor",
"torch.from_numpy"
] | [((1747, 1791), 'torch.nn.Embedding', 'nn.Embedding', (['self.num_token', 'self.word_size'], {}), '(self.num_token, self.word_size)\n', (1759, 1791), True, 'import torch.nn as nn\n'), ((2402, 2465), 'torch.nn.Embedding', 'nn.Embedding', (['(2 * max_length)', 'self.position_size'], {'padding_idx': '(0)'}), '(2 * max_len... |
import numpy as np
import warnings
import copy
from scipy.special import expit
from .stratification import Strata
def verify_positive(value):
"""Throws exception if value is not positive"""
if not value > 0:
raise ValueError("expected positive integer")
return value
def verify_predictions(predicti... | [
"copy.deepcopy",
"numpy.sum",
"numpy.log",
"numpy.isfinite",
"numpy.any",
"scipy.special.expit",
"numpy.min",
"numpy.max",
"numpy.array",
"numpy.logical_or",
"numpy.unique",
"numpy.repeat"
] | [((510, 543), 'numpy.array', 'np.array', (['predictions'], {'copy': '(False)'}), '(predictions, copy=False)\n', (518, 543), True, 'import numpy as np\n'), ((990, 1018), 'numpy.array', 'np.array', (['scores'], {'copy': '(False)'}), '(scores, copy=False)\n', (998, 1018), True, 'import numpy as np\n'), ((2049, 2085), 'num... |
from decimal import Decimal
import pytest
from yandex_geocoder import (
Client,
InvalidKey,
NothingFound,
UnexpectedResponse,
)
def test_returns_found_coordinates(mock_api):
mock_api("coords_found", 200, geocode="Москва Льва Толстого 16")
client = Client("well-known-key")
assert client.... | [
"yandex_geocoder.Client",
"pytest.raises",
"decimal.Decimal"
] | [((276, 300), 'yandex_geocoder.Client', 'Client', (['"""well-known-key"""'], {}), "('well-known-key')\n", (282, 300), False, 'from yandex_geocoder import Client, InvalidKey, NothingFound, UnexpectedResponse\n'), ((555, 579), 'yandex_geocoder.Client', 'Client', (['"""well-known-key"""'], {}), "('well-known-key')\n", (56... |
import json
import os
import random
random.seed(int(os.getenv("SEED"), 16))
from prjxray import util
from prjxray import verilog
from prjxray.db import Database
from prjxray.lut_maker import LutMaker
WRITE_MODES = ("WRITE_FIRST", "NO_CHANGE", "READ_FIRST")
def gen_sites():
db = Database(util.get_db_root())
g... | [
"json.dump",
"random.randint",
"prjxray.lut_maker.LutMaker",
"prjxray.verilog.vrandbit",
"random.choice",
"prjxray.verilog.quote",
"os.getenv",
"prjxray.util.get_db_root"
] | [((3407, 3425), 'prjxray.verilog.vrandbit', 'verilog.vrandbit', ([], {}), '()\n', (3423, 3425), False, 'from prjxray import verilog\n'), ((3441, 3470), 'random.choice', 'random.choice', (["('SDP', 'TDP')"], {}), "(('SDP', 'TDP'))\n", (3454, 3470), False, 'import random\n'), ((7278, 7299), 'random.choice', 'random.choic... |
import asyncio
import logging
from dataclasses import dataclass, field
from typing import Callable, Coroutine, List, Optional
from urllib.parse import urljoin
import aiohttp
from aiohttp import ClientResponseError, StreamReader
from aiohttp.client import ClientSession, ClientTimeout
from aiohttp_socks import ProxyConn... | [
"aiohttp_socks.ProxyConnector.from_url",
"urllib.parse.urljoin",
"aiohttp.client.ClientTimeout",
"dataclasses.field",
"logging.getLogger"
] | [((424, 451), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (441, 451), False, 'import logging\n'), ((976, 1003), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (981, 1003), False, 'from dataclasses import dataclass, field\n'), ((1027, 1054),... |
from django.contrib import admin
from django_summernote.admin import SummernoteModelAdmin
from .models import Post, Subscriber, Newsletter, ProductOptions, ProductImage, Product, Order, OrderItem, ArtItem
from image_cropping import ImageCroppingMixin
def send_newsletter(modeladmin, request, queryset):
for newslett... | [
"django.contrib.admin.site.register"
] | [((1503, 1539), 'django.contrib.admin.site.register', 'admin.site.register', (['Post', 'PostAdmin'], {}), '(Post, PostAdmin)\n', (1522, 1539), False, 'from django.contrib import admin\n'), ((1540, 1582), 'django.contrib.admin.site.register', 'admin.site.register', (['Product', 'ProductAdmin'], {}), '(Product, ProductAd... |
# Models required for data analysis. These should never be populated in prod on
# heroku
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
import multiselectfield
from .. import constants
from .domain import State, T... | [
"django.utils.translation.gettext_lazy",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((866, 915), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.CASCADE'}), '(User, on_delete=models.CASCADE)\n', (883, 915), False, 'from django.db import models\n'), ((938, 960), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {}), '()\n', (958, 960), False, 'from dja... |
from pathlib import Path
from typing import Final
# LOGGING
LOG_LEVEL: Final[str] = "INFO"
LOG_FORMAT: Final[
str
] = "%(asctime)s [%(name)s] (%(threadName)s) <%(levelname)s> %(message)s"
# GMAIL GATEWAY
GMAIL_READ_ONLY_SCOPE: Final[str] = "https://www.googleapis.com/auth/gmail.readonly"
LIST_MESSAGES_MAX_RESULTS... | [
"pathlib.Path"
] | [((376, 391), 'pathlib.Path', 'Path', (['"""output/"""'], {}), "('output/')\n", (380, 391), False, 'from pathlib import Path\n'), ((417, 430), 'pathlib.Path', 'Path', (['"""auth/"""'], {}), "('auth/')\n", (421, 430), False, 'from pathlib import Path\n')] |
from flask import Flask,session,request
import os
from datetime import timedelta
app = Flask(__name__)
app.config['SECRET_KEY'] = os.urandom(24)
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=7)
#session.permanent = True 默认31天
#如果修改 设置PERMANENT_SESSION_LIFETIME 后面就是指定过期时间
@app.route('/')
def hello_world()... | [
"flask.session.pop",
"flask.request.args.get",
"flask.Flask",
"flask.session.get",
"datetime.timedelta",
"os.urandom",
"flask.session.clear"
] | [((87, 102), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (92, 102), False, 'from flask import Flask, session, request\n'), ((131, 145), 'os.urandom', 'os.urandom', (['(24)'], {}), '(24)\n', (141, 145), False, 'import os\n'), ((189, 206), 'datetime.timedelta', 'timedelta', ([], {'days': '(7)'}), '(days=7... |
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
import math
import sys
import os
data_dir = sys.argv[1]
out_dir = sys.argv[2]
dataX = os.path.join(sys.argv[1], 'logisticX.csv')
dataY = os.path.join(sys.argv[1],... | [
"numpy.log",
"numpy.std",
"numpy.zeros",
"numpy.ones",
"numpy.linalg.pinv",
"numpy.mean",
"matplotlib.use",
"numpy.loadtxt",
"numpy.exp",
"numpy.column_stack",
"numpy.dot",
"os.path.join"
] | [((37, 58), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (51, 58), False, 'import matplotlib\n'), ((244, 286), 'os.path.join', 'os.path.join', (['sys.argv[1]', '"""logisticX.csv"""'], {}), "(sys.argv[1], 'logisticX.csv')\n", (256, 286), False, 'import os\n'), ((295, 337), 'os.path.join', 'os.pa... |
from django.urls import path
from . import views
urlpatterns = [
path("", views.index),
path("<slug:slug>", views.book_detail, name="book-detail")
]
| [
"django.urls.path"
] | [((71, 92), 'django.urls.path', 'path', (['""""""', 'views.index'], {}), "('', views.index)\n", (75, 92), False, 'from django.urls import path\n'), ((98, 156), 'django.urls.path', 'path', (['"""<slug:slug>"""', 'views.book_detail'], {'name': '"""book-detail"""'}), "('<slug:slug>', views.book_detail, name='book-detail')... |
"""Test top-1 generation with dummy model.
Test target:
- :py:meth:`lmp.infer.Top1Infer.gen`.
"""
from lmp.infer import Top1Infer
from lmp.model import BaseModel
from lmp.tknzr import BaseTknzr
def test_gen(gen_max_non_sp_tk_model: BaseModel, max_non_sp_tk: str, max_seq_len: int, tknzr: BaseTknzr) -> None:
"""Onl... | [
"lmp.infer.Top1Infer"
] | [((369, 403), 'lmp.infer.Top1Infer', 'Top1Infer', ([], {'max_seq_len': 'max_seq_len'}), '(max_seq_len=max_seq_len)\n', (378, 403), False, 'from lmp.infer import Top1Infer\n')] |
# -*- coding: utf-8 -*-
"""
@author: <NAME>, <NAME>, <NAME>, <NAME>
"""
import nltk
#rp = ResourceParser()
class Tagger():
taggedReviews = []
review_set = []
def __init__(self):
with open ('OnePlus8_reviews.csv', 'r', encoding='utf-8') as f:
for i in f:
... | [
"nltk.pos_tag"
] | [((536, 554), 'nltk.pos_tag', 'nltk.pos_tag', (['text'], {}), '(text)\n', (548, 554), False, 'import nltk\n')] |
#!/usr/bin/python3
import time
import dcmotorbasic
class motoranalyse(dcmotorbasic.motor):
"""
extends the standard motor class with methods to test and log the results
"""
def findMaxrpm(self, **kwargs):
if self.postick is None:
x=17/0
self.addTicker(tickgen=self.doMaxRPM(... | [
"time.time"
] | [((579, 590), 'time.time', 'time.time', ([], {}), '()\n', (588, 590), False, 'import time\n'), ((14240, 14251), 'time.time', 'time.time', ([], {}), '()\n', (14249, 14251), False, 'import time\n'), ((4059, 4070), 'time.time', 'time.time', ([], {}), '()\n', (4068, 4070), False, 'import time\n'), ((9218, 9229), 'time.time... |
import unittest
import miniparser
class TestMiniParser(unittest.TestCase):
def test_return_all_args(self):
miniparser.add_command('v', view_args, nargs=-1, help='return all args')
sys_argv_simulation = ['dummy_filename.py', 'v', 'first_arg', 'second_arg']
actual = miniparser.parser... | [
"unittest.main",
"miniparser.add_command",
"miniparser.parser"
] | [((2992, 3007), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3005, 3007), False, 'import unittest\n'), ((127, 199), 'miniparser.add_command', 'miniparser.add_command', (['"""v"""', 'view_args'], {'nargs': '(-1)', 'help': '"""return all args"""'}), "('v', view_args, nargs=-1, help='return all args')\n", (149, 19... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('statmaps', '0041_cognitive_atlas_ondelete_do_nothing'),
]
operations = [
migrations.RemoveField(
model_name='nid... | [
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((269, 346), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""nidmresultstatisticmap"""', 'name': '"""thumbnail"""'}), "(model_name='nidmresultstatisticmap', name='thumbnail')\n", (291, 346), False, 'from django.db import models, migrations\n'), ((391, 458), 'django.db.migrations.R... |
from django.db import models
from datetime import datetime, timedelta
class Event(models.Model):
name = models.CharField(max_length=200)
when = models.DateTimeField(default=datetime.now()+timedelta(days=7))
def __str__(self):
return str(self.name) | [
"django.db.models.CharField",
"datetime.datetime.now",
"datetime.timedelta"
] | [((109, 141), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (125, 141), False, 'from django.db import models\n'), ((182, 196), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (194, 196), False, 'from datetime import datetime, timedelta\n'), ((197, 214)... |
import sys
assert sys.version_info >= (3, 6), "crypt4gh requires python 3.6 or higher"
from pathlib import Path
from setuptools import setup, find_packages
_readme = (Path(__file__).parent / "README.md").read_text()
setup(name='crypt4gh',
version='1.3',
url='https://www.github.com/EGA-archive/crypt4gh',
... | [
"pathlib.Path",
"setuptools.find_packages"
] | [((560, 575), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (573, 575), False, 'from setuptools import setup, find_packages\n'), ((169, 183), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (173, 183), False, 'from pathlib import Path\n')] |
import asyncio
from aioipfabric import IPFabricClient
from aioipfabric.mixins.configs import IPFConfigsMixin
class Client(IPFabricClient, IPFConfigsMixin):
pass
asyncio.set_event_loop(asyncio.get_event_loop())
async def backup_device(**options):
async with Client() as ipf:
return await ipf.trigger... | [
"asyncio.get_event_loop"
] | [((192, 216), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (214, 216), False, 'import asyncio\n')] |
"""
Model used by Video module for Branding configuration.
Includes:
BrandingInfoConfig: A ConfigurationModel for managing how Video Module will
use Branding.
"""
import json
from config_models.models import ConfigurationModel
from django.core.exceptions import ValidationError
from django.db.models impo... | [
"django.db.models.TextField",
"django.core.exceptions.ValidationError",
"json.loads"
] | [((842, 911), 'django.db.models.TextField', 'TextField', ([], {'help_text': '"""JSON data of Configuration for Video Branding."""'}), "(help_text='JSON data of Configuration for Video Branding.')\n", (851, 911), False, 'from django.db.models import TextField\n'), ((1041, 1071), 'json.loads', 'json.loads', (['self.confi... |
"""Test the utility functions."""
import unittest
from template_package.utils import iter_together
import pathlib
HERE = pathlib.Path(__file__).parent.resolve()
class TestUtils(unittest.TestCase):
"""Test the utilities."""
def test_my_function(self):
"""Test the :func: iter_together."""
pat... | [
"template_package.utils.iter_together",
"pathlib.Path"
] | [((415, 444), 'template_package.utils.iter_together', 'iter_together', (['path_1', 'path_2'], {}), '(path_1, path_2)\n', (428, 444), False, 'from template_package.utils import iter_together\n'), ((123, 145), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (135, 145), False, 'import pathlib\n')] |
import random
import pickle
import time
fighting = int
# This is the enemy class
class enemy:
def __init__(self, health, str, intel, dex, name, id):
self.health = health
self.str = str
self.intel = intel
self.dex = dex
self.name = name
self.id = ... | [
"time.sleep",
"random.randint",
"random.uniform"
] | [((3629, 3653), 'random.randint', 'random.randint', (['(100)', '(110)'], {}), '(100, 110)\n', (3643, 3653), False, 'import random\n'), ((3719, 3743), 'random.randint', 'random.randint', (['(100)', '(110)'], {}), '(100, 110)\n', (3733, 3743), False, 'import random\n'), ((3788, 3812), 'random.randint', 'random.randint', ... |
from typing import List, Optional, Tuple, TypeVar
import random
from . import testing
from .testing import generate_random_list
T = TypeVar('T')
# Assume ls is sorted
def binary_search(ls: List[T], item: T, partition_idxs: Optional[Tuple[int, int]] = None) -> Optional[int]:
if len(ls) == 0:
return None
... | [
"typing.TypeVar",
"random.randint",
"random.choice"
] | [((133, 145), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (140, 145), False, 'from typing import List, Optional, Tuple, TypeVar\n'), ((866, 883), 'random.choice', 'random.choice', (['ls'], {}), '(ls)\n', (879, 883), False, 'import random\n'), ((1169, 1190), 'random.randint', 'random.randint', (['(1)', '(... |
import unittest
import subprocess
from time import sleep
import uuid
import pychimp
import regression_settings
class DSLISTCommandTestCase(unittest.TestCase):
def setUp(self):
self.proc = subprocess.Popen(regression_settings.chimp_location)
sleep(1)
self.c = pychimp.ChimpClient(regression... | [
"subprocess.Popen",
"uuid.uuid4",
"pychimp.ChimpClient",
"time.sleep"
] | [((203, 255), 'subprocess.Popen', 'subprocess.Popen', (['regression_settings.chimp_location'], {}), '(regression_settings.chimp_location)\n', (219, 255), False, 'import subprocess\n'), ((264, 272), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (269, 272), False, 'from time import sleep\n'), ((290, 341), 'pychimp.Chimp... |
import sqlite3
import datetime
danes = datetime.datetime.now()
BAZA = "ppt.db"
con = sqlite3.connect(BAZA)
cur = con.cursor()
cur.execute("PRAGMA foreign_keys = ON")
########## TOCKOVANJE & KATEGORIJE #################
tockovanje = {1:25, 2:18, 3:15, 4:12, 5:10, 6:8, 7:6, 8:4, 9:2, 10:1}
kategorije = {1:[0,18,'Ž'],... | [
"sqlite3.connect",
"datetime.datetime.now"
] | [((40, 63), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (61, 63), False, 'import datetime\n'), ((87, 108), 'sqlite3.connect', 'sqlite3.connect', (['BAZA'], {}), '(BAZA)\n', (102, 108), False, 'import sqlite3\n')] |
# Copyright © 2019 Province of British Columbia
#
# 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 agr... | [
"mhr_api.models.search_utils.ACCOUNT_SEARCH_HISTORY_QUERY_NEW.replace",
"flask.current_app.config.get",
"mhr_api.models.db2.search_utils.search_by_serial_number",
"mhr_api.models.utils.get_ind_name_from_db2",
"mhr_api.models.search_utils.ACCOUNT_SEARCH_HISTORY_DATE_QUERY.replace",
"mhr_api.models.search_u... | [((6177, 6250), 'mhr_api.models.db2.search_utils.search_by_mhr_number', 'db2_search_utils.search_by_mhr_number', (['current_app', 'db', 'self.request_json'], {}), '(current_app, db, self.request_json)\n', (6214, 6250), True, 'from mhr_api.models.db2 import search_utils as db2_search_utils\n'), ((7017, 7102), 'mhr_api.m... |