code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from contextlib import contextmanager
from pathlib import Path
import pytest
from dagos.core.configuration import ConfigurationScanner
from dagos.core.configuration.configuration_domain import DefaultPlaceholder
from dagos.exceptions import ValidationException
@contextmanager
def does_not_raise():
yield
@pyte... | [
"pytest.raises",
"dagos.core.configuration.ConfigurationScanner"
] | [((1004, 1026), 'dagos.core.configuration.ConfigurationScanner', 'ConfigurationScanner', ([], {}), '()\n', (1024, 1026), False, 'from dagos.core.configuration import ConfigurationScanner\n'), ((717, 739), 'dagos.core.configuration.ConfigurationScanner', 'ConfigurationScanner', ([], {}), '()\n', (737, 739), False, 'from... |
"""
Test the maximum a posteriori estimates
"""
import time
import numpy as np
from .test_model import prepare_dla_model
def test_DLA_MAP():
# test 1
dla_gp = prepare_dla_model(plate=5309, mjd=55929, fiber_id=362, z_qso=3.166)
tic = time.time()
max_dlas = 4
log_likelihoods_dla = dla_gp.log_mode... | [
"numpy.nanargmax",
"numpy.abs",
"numpy.array",
"numpy.isnan",
"time.time"
] | [((249, 260), 'time.time', 'time.time', ([], {}), '()\n', (258, 260), False, 'import time\n'), ((353, 364), 'time.time', 'time.time', ([], {}), '()\n', (362, 364), False, 'import time\n'), ((556, 761), 'numpy.array', 'np.array', (['[[22.28420156, np.nan, np.nan, np.nan], [20.63417494, 22.28420156, np.nan,\n np.nan],... |
#!/usr/local/bin/python
# various by python (v3.3) stuff while I learn the langugage
# (taking my features.rb script and porting it to python)
# Really useful to me:
# google course on python: https://developers.google.com/edu/python/
# software carpentry bootcamp: http://software-carpentry.org/v4/python/inde... | [
"re.sub",
"re.findall",
"random.randint",
"re.search"
] | [((1261, 1325), 're.search', 're.search', (['"""<td>(\\\\d+)</td><td>(\\\\w+)</td><td>(\\\\w+)</td>"""', 'text'], {}), "('<td>(\\\\d+)</td><td>(\\\\w+)</td><td>(\\\\w+)</td>', text)\n", (1270, 1325), False, 'import re\n'), ((1465, 1530), 're.findall', 're.findall', (['"""<td>(\\\\d+)</td><td>(\\\\w+)</td><td>(\\\\w+)</... |
"""
"""
import datetime
import os
# import sys
import logging
import numpy as np
import scipy as sp
import scipy.optimize # noqa
import tqdm
import h5py
import zcode.inout as zio
import zcode.math as zmath
from . import spectra, radiation # , utils
from . import PATH_DATA, MASS_EXTR, FEDD_EXTR, RADS_EXTR
from . co... | [
"numpy.product",
"zcode.plot.colormap",
"numpy.log10",
"numpy.sqrt",
"numpy.log",
"zcode.math.stats_str",
"numpy.argsort",
"numpy.array",
"logging.log",
"numpy.count_nonzero",
"numpy.isfinite",
"zcode.inout.get_file_size",
"os.path.exists",
"numpy.mean",
"numpy.isscalar",
"scipy.interp... | [((384, 442), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""', 'over': '"""raise"""'}), "(divide='ignore', invalid='ignore', over='raise')\n", (393, 442), True, 'import numpy as np\n'), ((1018, 1047), 'numpy.sqrt', 'np.sqrt', (['(C3 / C1 / ALPHA_VISC)'], {}), '(C3 / C1 / ALPHA_VIS... |
from django import template
register = template.Library()
@register.simple_tag
def format_date_range(date_from, date_to, separator=" - ",
format_str="%B %d, %Y", year_f=", %Y", month_f="%B", date_f=" %d"):
""" Takes a start date, end date, separator and formatting strings and
returns a pretty date ran... | [
"django.template.Library"
] | [((40, 58), 'django.template.Library', 'template.Library', ([], {}), '()\n', (56, 58), False, 'from django import template\n')] |
#!/usr/bin/env python3
from library_api_util import *
import json
# This variable is to decide how many nearest libraries you will look for.
LATITUDE = 35.7
LONGTITUDE = 139.8
ISBN = '4577002086'
LIBRARY_API_SEARCH_NUM = 5
try:
with open('apikey.json', 'r') as f:
api_data = json.load(f)
library_api =... | [
"json.load",
"json.dumps"
] | [((290, 302), 'json.load', 'json.load', (['f'], {}), '(f)\n', (299, 302), False, 'import json\n'), ((490, 536), 'json.dumps', 'json.dumps', (['data'], {'ensure_ascii': '(False)', 'indent': '(4)'}), '(data, ensure_ascii=False, indent=4)\n', (500, 536), False, 'import json\n')] |
#!/usr/bin/env python3
import argparse
import sys, os
import subprocess
from collections import defaultdict
import logging
import re
import math
sys.path.insert(0, os.path.sep.join([os.path.dirname(os.path.realpath(__file__)), "../PyLib"]))
import ctat_util
logging.basicConfig(stream=sys.stderr, level=logging.INFO... | [
"logging.basicConfig",
"logging.getLogger",
"argparse.ArgumentParser",
"subprocess.check_call",
"math.log2",
"re.match",
"os.path.realpath",
"collections.defaultdict",
"os.path.basename",
"ctat_util.open_file_for_reading",
"sys.exit"
] | [((263, 321), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stderr', 'level': 'logging.INFO'}), '(stream=sys.stderr, level=logging.INFO)\n', (282, 321), False, 'import logging\n'), ((331, 358), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (348, 358), False, 'import ... |
import os
from abc import ABC, abstractmethod
from typing import List, Optional
import feedparser as fp
import requests
from feedgen.feed import FeedGenerator
class Feed(ABC):
def __init__(
self,
id_: str,
links: List[dict],
title: str,
updated: Optional[str],
):
... | [
"os.makedirs",
"feedparser.parse",
"requests.get",
"os.path.split",
"feedgen.feed.FeedGenerator"
] | [((328, 343), 'feedgen.feed.FeedGenerator', 'FeedGenerator', ([], {}), '()\n', (341, 343), False, 'from feedgen.feed import FeedGenerator\n'), ((570, 588), 'feedparser.parse', 'fp.parse', (['feed_xml'], {}), '(feed_xml)\n', (578, 588), True, 'import feedparser as fp\n'), ((2066, 2085), 'os.path.split', 'os.path.split',... |
#!/usr/bin/env python3
import argparse
import os
import shutil
import re
from builder import Builder
from database_deployer import FlywayDatabaseDeployer
from token_fetcher import TokenFetcher
from web_deployer import WebDeployer
from web_static_deployer import WebStaticDeployer
from util import extract_zipfile, get_... | [
"builder.Builder",
"os.makedirs",
"argparse.ArgumentParser",
"re.match",
"os.path.join",
"os.getcwd",
"os.path.isfile",
"token_fetcher.TokenFetcher",
"os.path.basename",
"database_deployer.FlywayDatabaseDeployer",
"shutil.rmtree",
"util.get_directories_in_directory",
"util.load_json_file",
... | [((432, 464), 'util.load_config', 'load_config', (['options.config_file'], {}), '(options.config_file)\n', (443, 464), False, 'from util import extract_zipfile, get_directories_in_directory, load_json_file, load_config, pretty_string_to_bool\n'), ((623, 658), 'util.load_config', 'load_config', (['options.project_config... |
# This file contains fairly exhaustive tests of almost all the methods
# supported by the Python `str` type, and tests that `untrusted.string` type:
# * correctly supports the same methods
# * accepts `str` and/or `untrusted.string` arguments interchangeably
# * never returns `str` or any iterable of `str`, only an
# ... | [
"untrusted.sequence",
"untrusted.string",
"untrusted.mappingOf",
"untrusted.mapping",
"html.escape"
] | [((3267, 3290), 'untrusted.string', 'untrusted.string', (['"""cat"""'], {}), "('cat')\n", (3283, 3290), False, 'import untrusted\n'), ((8790, 8813), 'untrusted.string', 'untrusted.string', (['"""cat"""'], {}), "('cat')\n", (8806, 8813), False, 'import untrusted\n'), ((13504, 13554), 'untrusted.mapping', 'untrusted.mapp... |
import os
import shutil
import tempfile
import mne
from meggie.mainwindow.preferences import PreferencesHandler
from meggie.experiment import initialize_new_experiment
from meggie.experiment import open_existing_experiment
def test_experiment_and_subject():
with tempfile.TemporaryDirectory() as dirpath:
... | [
"meggie.experiment.initialize_new_experiment",
"tempfile.TemporaryDirectory",
"meggie.mainwindow.preferences.PreferencesHandler",
"meggie.experiment.open_existing_experiment",
"os.path.join",
"mne.datasets.sample.data_path"
] | [((270, 299), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (297, 299), False, 'import tempfile\n'), ((336, 367), 'mne.datasets.sample.data_path', 'mne.datasets.sample.data_path', ([], {}), '()\n', (365, 367), False, 'import mne\n'), ((391, 460), 'os.path.join', 'os.path.join', (['samp... |
# Generated by Django 3.1.13 on 2021-07-16 21:44
from django.db import migrations, models
import nautobot.extras.models.models
import uuid
class Migration(migrations.Migration):
dependencies = [
("extras", "0010_change_cf_validation_max_min_field_to_bigint"),
]
operations = [
migrations... | [
"django.db.models.UUIDField",
"django.db.models.FileField",
"django.db.migrations.AlterModelOptions",
"django.db.models.BinaryField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((1820, 1934), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""jobresult"""', 'options': "{'get_latest_by': 'created', 'ordering': ['-created']}"}), "(name='jobresult', options={'get_latest_by':\n 'created', 'ordering': ['-created']})\n", (1848, 1934), False, 'from django... |
import os
from flask import Flask
BUILD_DIR = os.path.join(os.path.dirname(__file__), 'build')
app = Flask(__name__, static_url_path='', static_folder=BUILD_DIR)
@app.route('/')
def index():
return app.send_static_file('index.html')
if __name__ == "__main__":
app.run(host='0.0.0.0', port=os.environ.get('P... | [
"os.path.dirname",
"os.environ.get",
"flask.Flask"
] | [((103, 163), 'flask.Flask', 'Flask', (['__name__'], {'static_url_path': '""""""', 'static_folder': 'BUILD_DIR'}), "(__name__, static_url_path='', static_folder=BUILD_DIR)\n", (108, 163), False, 'from flask import Flask\n'), ((60, 85), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (75, 85), ... |
# coding: utf-8
# In[1]:
import glob
import os
import re
import pickle
import csv
import pandas as pd
import numpy as np
from unidecode import unidecode
import string
import language_check
import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.corpus import wordne... | [
"language_check.LanguageTool",
"nltk.corpus.stopwords.words",
"pandas.read_csv",
"nltk.stem.WordNetLemmatizer",
"cleaning_functions.clean_sentence",
"os.path.basename",
"pandas.DataFrame",
"glob.glob"
] | [((426, 462), 'language_check.LanguageTool', 'language_check.LanguageTool', (['"""en-US"""'], {}), "('en-US')\n", (453, 462), False, 'import language_check\n'), ((489, 508), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {}), '()\n', (506, 508), False, 'from nltk.stem import WordNetLemmatizer\n'), ((657, 742)... |
import numpy as np
def zShift(seq, pos):
"""Return components of Z curve shift.
zCurve[0] = (A+G)-(C+T) # purine/pyrimidine
zCurve[1] = (A+C)-(G+T) # amino/keto
zCurve[2] = (A+T)-(G+C) # weak/strong
"""
if seq[pos] == "A":
return np.array([1, 1, 1])
if seq[pos] == "G":
ret... | [
"numpy.array"
] | [((265, 284), 'numpy.array', 'np.array', (['[1, 1, 1]'], {}), '([1, 1, 1])\n', (273, 284), True, 'import numpy as np\n'), ((324, 345), 'numpy.array', 'np.array', (['[1, -1, -1]'], {}), '([1, -1, -1])\n', (332, 345), True, 'import numpy as np\n'), ((385, 406), 'numpy.array', 'np.array', (['[-1, 1, -1]'], {}), '([-1, 1, ... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"hypothesis.strategies.sampled_from",
"hypothesis.strategies.integers",
"program_config.TensorConfig",
"auto_scan_test.FusePassAutoScanTest.__init__",
"hypothesis.strategies.floats",
"program_config.Place",
"unittest.main",
"program_config.OpConfig",
"sys.path.append",
"program_config.CxxConfig",
... | [((621, 642), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (636, 642), False, 'import sys\n'), ((4696, 4720), 'unittest.main', 'unittest.main', ([], {'argv': "['']"}), "(argv=[''])\n", (4709, 4720), False, 'import unittest\n'), ((1289, 1341), 'auto_scan_test.FusePassAutoScanTest.__init__', 'Fus... |
import requests
import re
import datetime
import functools
from flask import current_app as app
from app import cache
def cache_timeout(f):
@functools.wraps(f)
def decorated_function(*args, **kwargs):
now = datetime.datetime.now()
deadline = now.replace(hour=23, minute=59)
period = (de... | [
"re.match",
"app.cache.memoize",
"requests.get",
"functools.wraps",
"datetime.datetime.now",
"flask.current_app.config.get"
] | [((1577, 1592), 'app.cache.memoize', 'cache.memoize', ([], {}), '()\n', (1590, 1592), False, 'from app import cache\n'), ((147, 165), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (162, 165), False, 'import functools\n'), ((1126, 1160), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(... |
""" Services
This module is reponsible to handle all interactions to the database
and bussiness rules
"""
import typing
import environs
import dotenv
import requests
import sqlalchemy.orm
from . import models, schemas, cache
env = environs.Env()
dotenv.load_dotenv()
SECRET_KEY_RECAPTCHA = env("RECAPTCHA_SECRET_K... | [
"environs.Env",
"requests.post",
"dotenv.load_dotenv"
] | [((237, 251), 'environs.Env', 'environs.Env', ([], {}), '()\n', (249, 251), False, 'import environs\n'), ((252, 272), 'dotenv.load_dotenv', 'dotenv.load_dotenv', ([], {}), '()\n', (270, 272), False, 'import dotenv\n'), ((3496, 3552), 'requests.post', 'requests.post', (['self._RECAPTCHA_SITEVERIFY_URL'], {'data': 'data'... |
import inspect
def get_func_parameter_index_by_name(func, parameter_name: str) -> str:
parameters = inspect.signature(func).parameters
if parameter_name not in parameters:
raise ValueError("parameter named: `{}`. dose not exists in the decorated function. `{}` ".format(parameter_name, func.__name__))
... | [
"inspect.signature"
] | [((106, 129), 'inspect.signature', 'inspect.signature', (['func'], {}), '(func)\n', (123, 129), False, 'import inspect\n'), ((454, 477), 'inspect.signature', 'inspect.signature', (['func'], {}), '(func)\n', (471, 477), False, 'import inspect\n')] |
#-*- coding:utf-8 -*-
import wx
class BlockWindow(wx.Panel):
def __init__(self, parent, ID = -1, label = "", pos = wx.DefaultPosition, size = (100, 25)):
super(BlockWindow, self).__init__(parent, ID, pos, size, wx.RAISED_BORDER, label)
self.lable = label
self.SetBackgroundColour('#FFF')
... | [
"wx.GridSizer",
"wx.PaintDC",
"wx.GridBagSizer"
] | [((473, 489), 'wx.PaintDC', 'wx.PaintDC', (['self'], {}), '(self)\n', (483, 489), False, 'import wx\n'), ((1043, 1087), 'wx.GridSizer', 'wx.GridSizer', ([], {'rows': '(3)', 'cols': '(3)', 'hgap': '(5)', 'vgap': '(5)'}), '(rows=3, cols=3, hgap=5, vgap=5)\n', (1055, 1087), False, 'import wx\n'), ((1601, 1632), 'wx.GridBa... |
# coding: utf-8 -*-
'''
GFS.py contains utility functions for GFS
'''
__all__ = ['get_akbk',
'get_pcoord',
'read_atcf']
import numpy as _np
import pandas as _pd
def get_akbk():
'''
Returns ak,bk for 64 level GFS model
vcoord is obtained from global_fcst.fd/gfsio_module.f
ak,bk ... | [
"numpy.array",
"pandas.to_datetime",
"numpy.float",
"pandas.read_csv"
] | [((417, 1206), 'numpy.array', '_np.array', (['[1.0, 0.99467099, 0.98863202, 0.98180002, 0.97408301, 0.96538502, 0.955603,\n 0.94463098, 0.93235999, 0.91867799, 0.90347999, 0.88666302, 0.86813903,\n 0.84783, 0.82568502, 0.80167699, 0.77581102, 0.748133, 0.71872902, \n 0.68773103, 0.655316, 0.621705, 0.58715999,... |
# Generated by Django 3.1 on 2020-10-30 11:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("attribute", "0001_initial"),
("product", "0137_drop_attribute_models"),
]
operations = [
migrations.AlterModelTable(name="assignedpageattribut... | [
"django.db.migrations.AlterModelTable"
] | [((267, 335), 'django.db.migrations.AlterModelTable', 'migrations.AlterModelTable', ([], {'name': '"""assignedpageattribute"""', 'table': 'None'}), "(name='assignedpageattribute', table=None)\n", (293, 335), False, 'from django.db import migrations\n'), ((346, 417), 'django.db.migrations.AlterModelTable', 'migrations.A... |
from itertools import combinations
from sklearn.metrics.pairwise import cosine_similarity
import numpy as np
embeddings = {}
with open("scripts/etm_w2v_embedding.txt", "r") as file:
for line in file.readlines():
splitted = line.split()
word = splitted[0]
embeddings[word] = np.array([float(n... | [
"sklearn.metrics.pairwise.cosine_similarity",
"numpy.average",
"numpy.argmax",
"numpy.append",
"numpy.array"
] | [((914, 926), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (922, 926), True, 'import numpy as np\n'), ((1429, 1452), 'numpy.argmax', 'np.argmax', (['similarities'], {}), '(similarities)\n', (1438, 1452), True, 'import numpy as np\n'), ((1311, 1346), 'numpy.append', 'np.append', (['similarities', 'similarity'], {}... |
import random
class RPG(object):
"""."""
def __init__(self):
"""."""
self.health = 10
self.stamina = 15
self.strength = 10
self.intelligence = 5
self.dex = 5
self.luck = 2
self.hp = 0
self.attack = None
self.bonus = None
... | [
"random.randint",
"random.randit"
] | [((395, 417), 'random.randint', 'random.randint', (['(10)', '(25)'], {}), '(10, 25)\n', (409, 417), False, 'import random\n'), ((601, 620), 'random.randit', 'random.randit', (['(0)', '(2)'], {}), '(0, 2)\n', (614, 620), False, 'import random\n'), ((789, 811), 'random.randint', 'random.randint', (['(10)', '(25)'], {}), ... |
import datetime as dt
from functools import singledispatch
__holidays = {}
__cache = set()
__min_year = None
__max_year = None
class _Holiday(object):
'''Container for public holiday meta information.
Most holidays recur on the same day every year so these
only require the month and day. Once-off holid... | [
"datetime.datetime.today",
"datetime.date.today",
"datetime.datetime.strptime",
"datetime.timedelta"
] | [((2242, 2261), 'datetime.datetime.today', 'dt.datetime.today', ([], {}), '()\n', (2259, 2261), True, 'import datetime as dt\n'), ((3663, 3678), 'datetime.date.today', 'dt.date.today', ([], {}), '()\n', (3676, 3678), True, 'import datetime as dt\n'), ((5720, 5739), 'datetime.datetime.today', 'dt.datetime.today', ([], {... |
import argparse
import os
import pathlib
import imageio
import matplotlib.pyplot as plt
import numpy as np
import omegaconf
import torch
import mbrl.env.termination_fns
import mbrl.models
import mbrl.planning
import mbrl.util.common
from mbrl.third_party.dmc2gym.wrappers import DMCWrapper
class PlanetVisualizer:
... | [
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"pathlib.Path",
"matplotlib.pyplot.close",
"os.remove",
"pathlib.Path.mkdir",
"imageio.imread",
"mbrl.third_party.dmc2gym.wrappers.DMCWrapper",
"omegaconf.OmegaConf.create",
"matplotlib.pyplot.subplots",
"imageio.get_writer",
"torch.Gener... | [((4860, 4885), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4883, 4885), False, 'import argparse\n'), ((653, 676), 'pathlib.Path', 'pathlib.Path', (['model_dir'], {}), '(model_dir)\n', (665, 676), False, 'import pathlib\n'), ((739, 786), 'pathlib.Path.mkdir', 'pathlib.Path.mkdir', (['self.v... |
from snippets import Icon, generate
snippets = {
"pl": "print($SEL0)",
"ss": ("self.x = x", "self.$1 = $1"),
"pld": ("pylint disable", "# pylint: disable="),
"main": ('if __name__ == "__main__"', 'if __name__ == "__main__":==>${0:main()}'),
"fi": ("from import", "from $1 import $0"),
"init": ("... | [
"snippets.generate"
] | [((1394, 1467), 'snippets.generate', 'generate', (['"""source.python"""', 'snippets', 'completions'], {'mutators': '[expand_colon]'}), "('source.python', snippets, completions, mutators=[expand_colon])\n", (1402, 1467), False, 'from snippets import Icon, generate\n')] |
import pytest
from truman import agent_registration
def fake_agent_factory(env, param_1, param_2):
assert env == "FAKE_ENVIRONMENT"
assert param_1 == "PARAM_1"
assert param_2 == "PARAM_2"
class FakeAgent:
def __init__(self, env, param_1, param_2):
assert env == "FAKE_ENVIRONMENT"
as... | [
"pytest.mark.parametrize",
"truman.agent_registration.AgentRegistry",
"pytest.raises"
] | [((385, 559), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""entry_point"""', "[fake_agent_factory, FakeAgent,\n 'tests.test_agent_registration:fake_agent_factory',\n 'tests.test_agent_registration:FakeAgent']"], {}), "('entry_point', [fake_agent_factory, FakeAgent,\n 'tests.test_agent_registratio... |
import markdown
import re
R_NOFOLLOW = re.compile('<a (?![^>]*rel=["\']nofollow[\'"])')
S_NOFOLLOW = '<a rel="nofollow" '
class NofollowPostprocessor(markdown.postprocessors.Postprocessor):
def run(self, text):
return R_NOFOLLOW.sub(S_NOFOLLOW, text)
class NofollowExtension(markdown.Extension):
""" A... | [
"re.compile"
] | [((40, 88), 're.compile', 're.compile', (['"""<a (?![^>]*rel=["\']nofollow[\'"])"""'], {}), '(\'<a (?![^>]*rel=["\\\']nofollow[\\\'"])\')\n', (50, 88), False, 'import re\n')] |
from zipfile import ZipFile
import os
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from wordcloud import WordCloud, STOPWORDS
from tqdm import tqdm
import nltk
import re
from nltk.tokenize import word_tokenize
# extract zip file
def extract_zip(file):
with ZipFile(file, "r") as zip:
... | [
"matplotlib.pyplot.imshow",
"pandas.read_csv",
"seaborn.distplot",
"nltk.download",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xlabel",
"nltk.FreqDist",
"zipfile.ZipFile",
"nltk.tokenize.word_tokenize",
"matplotlib.pyplot.axis",
"wordcloud.WordCloud",
"matplotlib.pyplot.figure",
"re.sub",
... | [((634, 658), 'pandas.read_csv', 'pd.read_csv', (['"""train.csv"""'], {}), "('train.csv')\n", (645, 658), True, 'import pandas as pd\n'), ((768, 794), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 6)'}), '(figsize=(8, 6))\n', (778, 794), True, 'import matplotlib.pyplot as plt\n'), ((800, 852), 'seabor... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
import json
import os
import codecs
from collections import Counter
import numpy as np
import tensorflow as tf
from parser.structs.vocabs.base_vocabs import CountVocab
from parser.struc... | [
"tensorflow.shape",
"tensorflow.variable_scope",
"parser.neural.classifiers.hidden",
"thumt.models.rnnsearch._decoder",
"thumt.layers.rnn_cell.LegacyGRUCell",
"sys.path.append",
"tensorflow.zeros"
] | [((721, 747), 'sys.path.append', 'sys.path.append', (['"""./THUMT"""'], {}), "('./THUMT')\n", (736, 747), False, 'import sys\n'), ((7666, 7716), 'tensorflow.zeros', 'tf.zeros', (['[batch_size, self.max_decode_length + 1]'], {}), '([batch_size, self.max_decode_length + 1])\n', (7674, 7716), True, 'import tensorflow as t... |
# 1)
import os
from random import randint
print("1)")
def create_domains_list():
with open("domains.txt", 'r') as file:
data = []
my_list = []
for line in file.readlines():
data.append(line.strip())
for element in data:
new_element = element.replace(".", "")
... | [
"random.randint"
] | [((1065, 1082), 'random.randint', 'randint', (['(100)', '(999)'], {}), '(100, 999)\n', (1072, 1082), False, 'from random import randint\n'), ((1107, 1120), 'random.randint', 'randint', (['(5)', '(7)'], {}), '(5, 7)\n', (1114, 1120), False, 'from random import randint\n'), ((1149, 1165), 'random.randint', 'randint', (['... |
from helpers.np import mod_to_num, pp
from helpers.db import get_last_beatmap
from helpers.config import config
import pyosu
api = pyosu.OsuApi(config["osuapikey"])
async def mods(ctx, args):
try:
modlist = args[1]
except:
modlist = 0
map = await get_last_beatmap(ctx.username)
... | [
"helpers.np.mod_to_num",
"pyosu.OsuApi",
"helpers.db.get_last_beatmap"
] | [((132, 165), 'pyosu.OsuApi', 'pyosu.OsuApi', (["config['osuapikey']"], {}), "(config['osuapikey'])\n", (144, 165), False, 'import pyosu\n'), ((282, 312), 'helpers.db.get_last_beatmap', 'get_last_beatmap', (['ctx.username'], {}), '(ctx.username)\n', (298, 312), False, 'from helpers.db import get_last_beatmap\n'), ((475... |
from __future__ import print_function, absolute_import
import os.path as osp
import numpy as np
from ..utils.data import Dataset
from ..utils.osutils import mkdir_if_missing
from ..utils.serialization import write_json, read_json
from ..utils.data.dataset import _pluck
class SynergyReID(Dataset):
md5 = '05050b5d... | [
"zipfile.ZipFile",
"os.path.join",
"numpy.asarray",
"os.path.splitext",
"os.path.isfile",
"os.path.isdir",
"os.path.basename"
] | [((1017, 1043), 'os.path.join', 'osp.join', (['self.root', '"""raw"""'], {}), "(self.root, 'raw')\n", (1025, 1043), True, 'import os.path as osp\n'), ((1127, 1168), 'os.path.join', 'osp.join', (['raw_dir', '"""synergyreid_data.zip"""'], {}), "(raw_dir, 'synergyreid_data.zip')\n", (1135, 1168), True, 'import os.path as ... |
import colored
from time import strftime, localtime
def colorize(text, color = 'green'):
return colored.stylize(text, colored.fg(color))
def time_colored(color = "gold_1", reverse = True):
return colored.stylize(
text = strftime('[%Y-%m-%d %H:%M:%S]', localtime()),
styles = [colored.fg(color... | [
"time.localtime",
"colored.fg",
"colored.attr"
] | [((124, 141), 'colored.fg', 'colored.fg', (['color'], {}), '(color)\n', (134, 141), False, 'import colored\n'), ((272, 283), 'time.localtime', 'localtime', ([], {}), '()\n', (281, 283), False, 'from time import strftime, localtime\n'), ((364, 381), 'colored.fg', 'colored.fg', (['color'], {}), '(color)\n', (374, 381), F... |
#!/usr/bin/python3
""" Test Bed for Diyhas System Status class """
import time
import datetime
from threading import Thread
import socket
from Adafruit_Python_LED_Backpack.Adafruit_LED_Backpack import SevenSegment
TIME_MODE = 0
WHO_MODE = 1
COUNT_MODE = 2
MAXIMUM_COUNT = 9999
class TimeDisplay:
""" display tim... | [
"socket.socket",
"time.strftime",
"Adafruit_Python_LED_Backpack.Adafruit_LED_Backpack.SevenSegment.SevenSegment",
"time.sleep",
"datetime.datetime.now",
"threading.Thread"
] | [((896, 927), 'time.strftime', 'time.strftime', (['self.time_format'], {}), '(self.time_format)\n', (909, 927), False, 'import time\n'), ((1236, 1259), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1257, 1259), False, 'import datetime\n'), ((1682, 1730), 'socket.socket', 'socket.socket', (['socke... |
#!/usr/bin/env python3
import os
import signal
import time
import subprocess
import sys
from amp.player import PlayerBackend
_thisPlayer = None
def _skip(signum, frame):
self = _thisPlayer
self.stopped = 0
self.tell("stop\n")
print("Skipping song...")
def _stop(signum, frame):
self = _thisPlay... | [
"signal.signal",
"os.kill",
"os.getpid",
"sys.exit",
"os.fork",
"time.time",
"os.setsid"
] | [((1307, 1316), 'os.fork', 'os.fork', ([], {}), '()\n', (1314, 1316), False, 'import os\n'), ((1661, 1672), 'os.getpid', 'os.getpid', ([], {}), '()\n', (1670, 1672), False, 'import os\n'), ((2164, 2175), 'time.time', 'time.time', ([], {}), '()\n', (2173, 2175), False, 'import time\n'), ((2746, 2781), 'signal.signal', '... |
import threading
import queue
from loguru import logger
from typing import Callable, Any, Iterator, Iterable
class SimpleThreadsRunner:
"""
A simple ThreadsRunner. This runs multiple threads to do the I/O;
Performance is at least as good as Queue producer/consumer, which works in an analogous fashion.
... | [
"threading.currentThread",
"loguru.logger.info",
"threading.RLock",
"loguru.logger.error",
"threading.Thread",
"queue.Queue"
] | [((427, 440), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (438, 440), False, 'import queue\n'), ((462, 479), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (477, 479), False, 'import threading\n'), ((878, 951), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.fetch', 'args': '(fn,)', 'name': '... |
from PIL import Image
import numpy as np
import os
def main():
img = Image(os.path.join('..', 'img', 'paras_prf_pic.jpeg'))
aray = np.array(img)
r, g, b = np.split(aray, 3, axis = 2)
r = r.reshape(-1)
g = g.reshape(-1)
b = b.reshape(-1)
bitmap = list(map(lambda x: 0.299*x[0]+0.587*x[1]+0.11... | [
"numpy.array",
"numpy.split",
"os.path.join"
] | [((140, 153), 'numpy.array', 'np.array', (['img'], {}), '(img)\n', (148, 153), True, 'import numpy as np\n'), ((168, 193), 'numpy.split', 'np.split', (['aray', '(3)'], {'axis': '(2)'}), '(aray, 3, axis=2)\n', (176, 193), True, 'import numpy as np\n'), ((80, 127), 'os.path.join', 'os.path.join', (['""".."""', '"""img"""... |
import json
from webargs import fields as webargs_fields
from webargs.flaskparser import use_kwargs
from dataactbroker import exception_handler
def test_exception_handler(test_app):
exception_handler.add_exception_handlers(test_app.application)
@test_app.application.route("/endpoint/")
@use_kwargs({'pa... | [
"webargs.fields.String",
"webargs.fields.Int",
"dataactbroker.exception_handler.add_exception_handlers"
] | [((190, 252), 'dataactbroker.exception_handler.add_exception_handlers', 'exception_handler.add_exception_handlers', (['test_app.application'], {}), '(test_app.application)\n', (230, 252), False, 'from dataactbroker import exception_handler\n'), ((327, 347), 'webargs.fields.Int', 'webargs_fields.Int', ([], {}), '()\n', ... |
"""
Author: [<NAME>](https://github.com/russelljjarvis)
"""
import shelve
import streamlit as st
import os
import pandas as pd
import pickle
import streamlit as st
from holoviews import opts, dim
from collections import Iterable
import networkx
#import bokeh_chart
from auxillary_methods import author_to_coauthor_net... | [
"streamlit.sidebar.title",
"os.path.exists",
"streamlit.markdown",
"streamlit.sidebar.text_input",
"PIL.Image.open",
"holoviews.extension",
"netgeovis2.main_plot_routine",
"streamlit.image",
"holoviews.Graph.from_networkx",
"pickle.dump",
"streamlit.button",
"holoviews.output",
"pickle.load"... | [((1597, 1630), 'holoviews.extension', 'hv.extension', (['"""bokeh"""'], {'logo': '(False)'}), "('bokeh', logo=False)\n", (1609, 1630), True, 'import holoviews as hv\n'), ((1631, 1650), 'holoviews.output', 'hv.output', ([], {'size': '(300)'}), '(size=300)\n', (1640, 1650), True, 'import holoviews as hv\n'), ((548, 760)... |
"""App signals.
"""
import logging
from django.db.models.signals import post_save
from django.dispatch import receiver
from ..azure_projects.models import Project
from .models import TrainingStatus
logger = logging.getLogger(__name__)
@receiver(
signal=post_save,
sender=Project,
dispatch_uid="training... | [
"logging.getLogger",
"django.dispatch.receiver"
] | [((211, 238), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (228, 238), False, 'import logging\n'), ((242, 346), 'django.dispatch.receiver', 'receiver', ([], {'signal': 'post_save', 'sender': 'Project', 'dispatch_uid': '"""training_status_project_created_listener"""'}), "(signal=post_sav... |
import pytest
from democrasite.users.models import User
from democrasite.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture(autouse=True)
def enable_db_access_for_all_tests(db): # pylint: disable=unus... | [
"pytest.fixture",
"democrasite.users.tests.factories.UserFactory"
] | [((118, 146), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (132, 146), False, 'import pytest\n'), ((228, 256), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (242, 256), False, 'import pytest\n'), ((390, 403), 'democrasite.users.tests.factori... |
import sublime
import sublime_plugin
from .collections import DottedDict
from .css import load as load_css
from .css import unload as unload_css
from .handlers import LanguageHandler
from .logging import set_debug_logging, set_exception_logging
from .panels import destroy_output_panels
from .protocol import Response
f... | [
"sublime.windows"
] | [((5225, 5242), 'sublime.windows', 'sublime.windows', ([], {}), '()\n', (5240, 5242), False, 'import sublime\n'), ((5425, 5442), 'sublime.windows', 'sublime.windows', ([], {}), '()\n', (5440, 5442), False, 'import sublime\n'), ((5523, 5540), 'sublime.windows', 'sublime.windows', ([], {}), '()\n', (5538, 5540), False, '... |
from pathlib import Path
DEBUG = True
USE_TZ = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "very-secret"
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": "db.sqlite3"}}
ROOT_URLCONF = "tests.urls"
DJANGO_APPS = [
"django.contrib.admin",
"djan... | [
"pathlib.Path"
] | [((2327, 2341), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (2331, 2341), False, 'from pathlib import Path\n')] |
from numba import cuda
import numba
from numba import float32
@numba.cuda.jit("void(float32[:,:], float32[:,:], float32[:,:])")
def naive_matrix_mult(A, B, C):
n = A.shape[0]
x, y = cuda.grid(2)
if x >= n or y >= n:
return
C[y, x] = 0
for i in range(n):
C[y, x] += A[y, i] * B[i,... | [
"numba.cuda.grid",
"numba.cuda.jit",
"pytest.main",
"numba.cuda.shared.array",
"numba.cuda.syncthreads"
] | [((65, 129), 'numba.cuda.jit', 'numba.cuda.jit', (['"""void(float32[:,:], float32[:,:], float32[:,:])"""'], {}), "('void(float32[:,:], float32[:,:], float32[:,:])')\n", (79, 129), False, 'import numba\n'), ((327, 391), 'numba.cuda.jit', 'numba.cuda.jit', (['"""void(float32[:,:], float32[:,:], float32[:,:])"""'], {}), "... |
from sqlalchemy.ext.declarative import as_declarative
from sqlalchemy import Column, Integer
@as_declarative()
class Base:
__table_args__ = {'schema': 'public'}
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
| [
"sqlalchemy.Column",
"sqlalchemy.ext.declarative.as_declarative"
] | [((96, 112), 'sqlalchemy.ext.declarative.as_declarative', 'as_declarative', ([], {}), '()\n', (110, 112), False, 'from sqlalchemy.ext.declarative import as_declarative\n'), ((177, 242), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'index': '(True)', 'autoincrement': '(True)'}), '(Integer, prim... |
from bson import ObjectId
import mock
from tests import base
from d1_common.env import D1_ENV_DICT
def setUpModule():
base.enabledPlugins.append('wholetale')
base.startServer()
global JobStatus, Tale
from girder.plugins.jobs.constants import JobStatus
from girder.plugins.wholetale.models.tale imp... | [
"tests.base.startServer",
"mock.patch",
"tests.base.enabledPlugins.append",
"tests.base.stopServer",
"bson.ObjectId"
] | [((124, 163), 'tests.base.enabledPlugins.append', 'base.enabledPlugins.append', (['"""wholetale"""'], {}), "('wholetale')\n", (150, 163), False, 'from tests import base\n'), ((168, 186), 'tests.base.startServer', 'base.startServer', ([], {}), '()\n', (184, 186), False, 'from tests import base\n'), ((357, 374), 'tests.b... |
from tyr.lexer import *
import unittest
class TestConsolidate(unittest.TestCase):
def setUp(self):
from random import Random
self.random = Random(42)
def test_consolidate_char(self):
for i in range(2*26):
char = chr(i + ord('a')) if i < 26 else chr(i - 26 + ord('A'))
with self.subTest(char... | [
"unittest.main",
"random.Random"
] | [((579, 594), 'unittest.main', 'unittest.main', ([], {}), '()\n', (592, 594), False, 'import unittest\n'), ((150, 160), 'random.Random', 'Random', (['(42)'], {}), '(42)\n', (156, 160), False, 'from random import Random\n')] |
import pickle
import pandas as pd
method_columns = ['model_class', 'config', 'loss_function', 'q_dist', 'sample_from_q',
'detach', 'add_noise', 'noise_type', 'warm_up', 'is_loaded', 'method_name']
hparam_columns = ['grad_l1_penalty', 'grad_weight_decay',
'lamb', 'loss_function_par... | [
"pickle.load",
"pandas.concat"
] | [((1322, 1336), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1333, 1336), False, 'import pickle\n'), ((1457, 1488), 'pandas.concat', 'pd.concat', (['datasets'], {'sort': '(False)'}), '(datasets, sort=False)\n', (1466, 1488), True, 'import pandas as pd\n')] |
import os
import json
from metis.CondorTask import CondorTask
from metis.Constants import Constants
import metis.Utils as Utils
import traceback
class CMSSWTask(CondorTask):
def __init__(self, **kwargs):
"""
:kwarg pset_args: extra arguments to pass to cmsRun along with pset
:kwarg is_tre... | [
"os.path.exists",
"traceback.format_exc",
"os.path.basename",
"metis.Utils.condor_submit",
"os.path.abspath",
"json.dump"
] | [((3649, 3680), 'os.path.abspath', 'os.path.abspath', (['self.pset_path'], {}), '(self.pset_path)\n', (3664, 3680), False, 'import os\n'), ((3705, 3737), 'os.path.basename', 'os.path.basename', (['self.pset_path'], {}), '(self.pset_path)\n', (3721, 3737), False, 'import os\n'), ((6180, 6214), 'os.path.abspath', 'os.pat... |
from django.urls import path
from .views import (
video_list_view,
video_detail_view,
video_create_view,
video_edit_view,
video_delete_view
)
urlpatterns = [
path('create-view/', video_create_view, name='video-create'),
path('list-view/', video_list_view, name='video-list'),
path('deta... | [
"django.urls.path"
] | [((184, 244), 'django.urls.path', 'path', (['"""create-view/"""', 'video_create_view'], {'name': '"""video-create"""'}), "('create-view/', video_create_view, name='video-create')\n", (188, 244), False, 'from django.urls import path\n'), ((250, 304), 'django.urls.path', 'path', (['"""list-view/"""', 'video_list_view'], ... |
from setuptools import setup
setup(
name = 'mqttflask_app',
version = '0.1',
packages = [ 'site' ],
install_requires = [
'wheel',
'uwsgi',
'flask',
'flask_restful',
'flask_httpauth',
'python_dotenv',
'simplejson',
'paho-mqtt',
],
l... | [
"setuptools.setup"
] | [((30, 298), 'setuptools.setup', 'setup', ([], {'name': '"""mqttflask_app"""', 'version': '"""0.1"""', 'packages': "['site']", 'install_requires': "['wheel', 'uwsgi', 'flask', 'flask_restful', 'flask_httpauth',\n 'python_dotenv', 'simplejson', 'paho-mqtt']", 'license': '"""MIT"""', 'description': '"""A website for m... |
import configparser
class Configer(object):
def __init__(self, config_file=None):
if config_file is None:
config_file = 'app.properties'
self._config = configparser.ConfigParser()
self._config.read(config_file)
def get(self, property):
_split_properties = property.spli... | [
"configparser.ConfigParser"
] | [((182, 209), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (207, 209), False, 'import configparser\n')] |
import io
import time
import pytest
import swiftclient
@pytest.fixture
def test_data(mock_swift):
containername = f"functional-tests-container-{int(time.time())}"
objectname = f"functional-tests-object-{int(time.time())}"
yield {
"test_data": b"42" * 10,
"etag": "2704306ec982238d85d4b235c... | [
"time.time"
] | [((155, 166), 'time.time', 'time.time', ([], {}), '()\n', (164, 166), False, 'import time\n'), ((218, 229), 'time.time', 'time.time', ([], {}), '()\n', (227, 229), False, 'import time\n')] |
import subprocess
import PIL
from PIL import Image
import numpy as np
import os
import shutil
import re
script_path = os.path.dirname(os.path.realpath(__file__))
temp_img_dir_path = os.path.join(script_path, 'temp_imgs')
def arr_to_mp4(arr, output_path, framerate=30, resolution_str=None, temp_dir=temp_img_dir_path):
... | [
"PIL.Image.fromarray",
"os.path.join",
"re.match",
"os.path.realpath",
"numpy.random.randint",
"os.mkdir",
"shutil.rmtree"
] | [((182, 220), 'os.path.join', 'os.path.join', (['script_path', '"""temp_imgs"""'], {}), "(script_path, 'temp_imgs')\n", (194, 220), False, 'import os\n'), ((134, 160), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (150, 160), False, 'import os\n'), ((1134, 1157), 'shutil.rmtree', 'shutil.r... |
from interactiongrader import Answer
from interactiongrader import ChangeType
from fuzzywuzzy import fuzz
def test_calculate_ranges():
ans = Answer()
ranges = ans.calculate_ranges()
assert ans.sentence == ''
assert ranges[ChangeType.FLIP] == 0.75
def test_random_change_type():
ans = Answer()
... | [
"fuzzywuzzy.fuzz.ratio",
"interactiongrader.Answer"
] | [((146, 154), 'interactiongrader.Answer', 'Answer', ([], {}), '()\n', (152, 154), False, 'from interactiongrader import Answer\n'), ((307, 315), 'interactiongrader.Answer', 'Answer', ([], {}), '()\n', (313, 315), False, 'from interactiongrader import Answer\n'), ((419, 440), 'interactiongrader.Answer', 'Answer', (['"""... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'rsrc/ui/mainwindow.ui'
#
# Created: Tue May 6 19:08:29 2014
# by: PyQt4 UI code generator 4.6.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(sel... | [
"PyQt4.QtGui.QLabel",
"PyQt4.QtGui.QStatusBar",
"PyQt4.QtGui.QApplication.translate",
"PyQt4.QtGui.QMenuBar",
"PyQt4.QtGui.QSlider",
"PyQt4.QtCore.QSize",
"PyQt4.QtGui.QWidget",
"PyQt4.QtGui.QAction",
"PyQt4.QtGui.QMenu",
"PyQt4.QtCore.QMetaObject.connectSlotsByName",
"PyQt4.QtGui.QComboBox",
... | [((448, 473), 'PyQt4.QtGui.QWidget', 'QtGui.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (461, 473), False, 'from PyQt4 import QtCore, QtGui\n'), ((562, 599), 'PyQt4.QtGui.QVBoxLayout', 'QtGui.QVBoxLayout', (['self.centralwidget'], {}), '(self.centralwidget)\n', (579, 599), False, 'from PyQt4 import QtCore, QtGui\... |
from selenium import webdriver
#from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options
import time, send_mail
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options... | [
"selenium.webdriver.Chrome",
"selenium.webdriver.ChromeOptions",
"time.sleep",
"send_mail.sendmail"
] | [((191, 216), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (214, 216), False, 'from selenium import webdriver\n'), ((367, 430), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['"""chromedriver"""'], {'chrome_options': 'chrome_options'}), "('chromedriver', chrome_options=chrome_opt... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('bugs', '0013_auto_20151123_1415'),
]
operations = [
migrations.RenameField(
model_name='bug',
old_na... | [
"django.db.migrations.RenameField"
] | [((248, 338), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""bug"""', 'old_name': '"""person"""', 'new_name': '"""create_person"""'}), "(model_name='bug', old_name='person', new_name=\n 'create_person')\n", (270, 338), False, 'from django.db import models, migrations\n'), ((390... |
#!/usr/bin/env python
from setuptools import setup
from setuptools.command.test import test as BaseTestCommand
from djangocms_local_navigation import __version__
install_requires = [
'django-cms>=3.0',
'beautifulsoup4',
]
tests_require = [
'djangocms-text-ckeditor',
]
class TestCommand(BaseTestCommand)... | [
"django.test.runner.DiscoverRunner",
"django.setup",
"sys.exit"
] | [((720, 734), 'django.setup', 'django.setup', ([], {}), '()\n', (732, 734), False, 'import django\n'), ((757, 784), 'django.test.runner.DiscoverRunner', 'DiscoverRunner', ([], {'verbosity': '(1)'}), '(verbosity=1)\n', (771, 784), False, 'from django.test.runner import DiscoverRunner\n'), ((871, 889), 'sys.exit', 'sys.e... |
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.db.models import Q
from .models import (
Deck,
Grave,
Hand,
Duel,
Trigger,
Lock,
)
from pprint import pprint
from .battle_det import battle_det,battle_det_return_org_ai
from .duel import DuelOb... | [
"django.http.HttpResponse",
"time.time",
"django.urls.reverse"
] | [((8580, 8601), 'django.http.HttpResponse', 'HttpResponse', (['"""error"""'], {}), "('error')\n", (8592, 8601), False, 'from django.http import HttpResponse, HttpResponseRedirect\n'), ((7296, 7317), 'django.http.HttpResponse', 'HttpResponse', (['"""error"""'], {}), "('error')\n", (7308, 7317), False, 'from django.http ... |
from math import sqrt, floor, ceil
#import math
num = int(input("Digite um número: "))
#raiz = math.sqrt(num)
raiz = sqrt(num) #from math import sqrt, floor
#print (f"A raiz de {num} é igual a {math.ceil(raiz)}") # Arredonda pra cima
#print (f"A raiz de {num} é igual a {math.floor(raiz)}") #Arredonda pra baixo
print (... | [
"math.ceil",
"math.sqrt",
"math.floor"
] | [((118, 127), 'math.sqrt', 'sqrt', (['num'], {}), '(num)\n', (122, 127), False, 'from math import sqrt, floor, ceil\n'), ((350, 360), 'math.ceil', 'ceil', (['raiz'], {}), '(raiz)\n', (354, 360), False, 'from math import sqrt, floor, ceil\n'), ((421, 432), 'math.floor', 'floor', (['raiz'], {}), '(raiz)\n', (426, 432), F... |
import sys
sys.path.append('../')
import caffe2_paths
import numpy as np
import glob
from itertools import product
import pinn.preproc as preproc
import pinn.data_reader as data_reader
import matplotlib.pyplot as plt
import pickle
import os
# ----------------- Preprocessing --------------------
vds = np.concatenate((n... | [
"pinn.data_reader.write_db",
"numpy.abs",
"itertools.product",
"numpy.column_stack",
"os.path.isfile",
"numpy.array",
"numpy.linspace",
"numpy.sum",
"numpy.concatenate",
"pinn.preproc.dc_iv_preproc",
"numpy.expand_dims",
"numpy.load",
"sys.path.append",
"pinn.preproc.compute_dc_meta",
"g... | [((11, 33), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (26, 33), False, 'import sys\n'), ((396, 422), 'numpy.linspace', 'np.linspace', (['(-0.1)', '(0.3)', '(41)'], {}), '(-0.1, 0.3, 41)\n', (407, 422), True, 'import numpy as np\n'), ((442, 468), 'numpy.linspace', 'np.linspace', (['(-0.1)',... |
import random
import base64
import typing
_lowercase = "abcdefghijklmnopqrstuvwxyz"
_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
_numbers = "0123456789"
_specials = "_"
def gen_password(
n: int,
lower_letters: str = _lowercase,
upper_letters: str = _uppercase,
number_letters: str = _numbers,
special... | [
"random.sample",
"random.choice",
"random.shuffle"
] | [((1711, 1756), 'random.sample', 'random.sample', (['all_letters', '(n - minimal_total)'], {}), '(all_letters, n - minimal_total)\n', (1724, 1756), False, 'import random\n'), ((1818, 1841), 'random.shuffle', 'random.shuffle', (['results'], {}), '(results)\n', (1832, 1841), False, 'import random\n'), ((1935, 1957), 'ran... |
import click
import os
import yaml
import json
from bioblend import galaxy
from requests import ConnectionError as RequestsConnectionError
from bioblend import ConnectionError as BioblendConnectionError
from yaml import SafeLoader
from gxwf import utils
def invocations(id_):
gi, cnfg, aliases = utils._login()
... | [
"gxwf.utils._login"
] | [((305, 319), 'gxwf.utils._login', 'utils._login', ([], {}), '()\n', (317, 319), False, 'from gxwf import utils\n')] |
from pathlib import Path
import requests
from bs4 import BeautifulSoup
from loguru import logger as log
nginx_header = "../build-templates/proxy/confs/production.conf"
with open(nginx_header) as headers:
for line in headers.readlines():
line = line.strip()
if not line.startswith("ssl_ciphers"):
... | [
"loguru.logger.info",
"pathlib.Path",
"loguru.logger.warning",
"requests.get",
"bs4.BeautifulSoup",
"loguru.logger.error"
] | [((579, 651), 'requests.get', 'requests.get', (['f"""https://ciphersuite.info/search/?q={cipher}"""'], {'timeout': '(30)'}), "(f'https://ciphersuite.info/search/?q={cipher}', timeout=30)\n", (591, 651), False, 'import requests\n'), ((701, 740), 'bs4.BeautifulSoup', 'BeautifulSoup', (['page.content', '"""html5lib"""'], ... |
#!/usr/bin/env python
# coding: utf-8
import os
#from torchvision import datasets
import torch
from torch.utils.data import Dataset, DataLoader
from pathlib import Path
import glob
import torchvision.transforms as transforms
from PIL import Image
import torch.nn as nn
import torch.nn.functional as F
import torch.opt... | [
"torchvision.transforms.CenterCrop",
"torchvision.transforms.RandomPerspective",
"data.CustomDataset",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torchvision.transforms.RandomRotation",
"torch.load",
"tqdm.tqdm",
"torchvision.transforms.RandomHorizontalFlip",
"torch.nn.Conv2d",
"torchvisi... | [((662, 687), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (685, 687), False, 'import torch\n'), ((1317, 1366), 'data.CustomDataset', 'CustomDataset', (['"""dogImages/train"""', 'transform_train'], {}), "('dogImages/train', transform_train)\n", (1330, 1366), False, 'from data import CustomDat... |
# -*- coding: utf-8 -*-
import scrapy
from floss.items import WikipediaRowItem
from floss.items import WikipediaSoftwareItem
class WikipediaSpider(scrapy.Spider):
name = "wikipedia"
allowed_domains = ["wikipedia.org"]
start_urls = (
"https://fr.wikipedia.org/wiki/Correspondance_entre_logiciels_lib... | [
"floss.items.WikipediaRowItem",
"scrapy.Request",
"floss.items.WikipediaSoftwareItem"
] | [((587, 605), 'floss.items.WikipediaRowItem', 'WikipediaRowItem', ([], {}), '()\n', (603, 605), False, 'from floss.items import WikipediaRowItem\n'), ((1549, 1572), 'floss.items.WikipediaSoftwareItem', 'WikipediaSoftwareItem', ([], {}), '()\n', (1570, 1572), False, 'from floss.items import WikipediaSoftwareItem\n'), ((... |
from robot import RoboLogger
from robot import Message
from robot import MQTTEngine
from robot.common.singleton import Singleton
import asyncio
from collections import deque
import traceback
from uuid import uuid4, UUID
log = RoboLogger()
class InboundMessageProcessor(metaclass=Singleton):
"""
Description:
... | [
"robot.RoboLogger",
"traceback.print_exc",
"collections.deque",
"robot.MQTTEngine"
] | [((228, 240), 'robot.RoboLogger', 'RoboLogger', ([], {}), '()\n', (238, 240), False, 'from robot import RoboLogger\n'), ((1252, 1329), 'robot.MQTTEngine', 'MQTTEngine', ([], {'mqtt_configuration': 'mqtt_configuration', 'event_loop': 'self.event_loop'}), '(mqtt_configuration=mqtt_configuration, event_loop=self.event_loo... |
import streamlit as st
import pandas as pd
import numpy as np
import json
import pandas as pd
from pathlib import Path
from datetime import datetime,timedelta
import matplotlib.pyplot as plt
from plotly_calplot import calplot
import plotly.express as px
from utils import (
load_config,
save_config,
pretty... | [
"utils.polar_datetime_to_python_datetime_str",
"streamlit.metric",
"datetime.datetime.today",
"datetime.timedelta",
"utils.pretty_print_json",
"streamlit.header",
"pandas.to_datetime",
"accesslink.AccessLink",
"plotly.express.pie",
"utils.save_config",
"streamlit.title",
"utils.save_json_to_fi... | [((560, 574), 'pathlib.Path', 'Path', (['"""./data"""'], {}), "('./data')\n", (564, 574), False, 'from pathlib import Path\n'), ((7657, 7690), 'streamlit.set_page_config', 'st.set_page_config', ([], {'layout': '"""wide"""'}), "(layout='wide')\n", (7675, 7690), True, 'import streamlit as st\n'), ((7704, 7722), 'streamli... |
# -*- coding: utf-8 -*-
# Copyright 2019 Open End AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"blm.accounting.upgrade",
"blm.accounting.createSignedBgcOrder",
"blm.accounting.User",
"blm.accounting.Transaction",
"copy.deepcopy",
"os.fork",
"blm.accounting.Org._query",
"accounting.bankgiro.normalize_text",
"blm.accounting.VatCode",
"blm.accounting.next_verification_data",
"blm.accounting.... | [((12282, 12318), 'os.path.join', 'os.path.join', (['certs', '"""swish.crt.pem"""'], {}), "(certs, 'swish.crt.pem')\n", (12294, 12318), False, 'import bson, email, py, os, time, uuid\n'), ((12330, 12366), 'os.path.join', 'os.path.join', (['certs', '"""swish.key.pem"""'], {}), "(certs, 'swish.key.pem')\n", (12342, 12366... |
"""
Create a representation of the NK speedCoach data file.
Classes:
NKSession
NKDevice
NKSessionFile
Functions:
None
Misc variables:
None
"""
import pandas
from io import StringIO
class NKSession(object):
"""
A class to containing the session data obtained from a single NK SpeedCoach ... | [
"pandas.read_csv"
] | [((1951, 2059), 'pandas.read_csv', 'pandas.read_csv', (['pseudofile'], {'header': 'None', 'skiprows': '(2)', 'nrows': '(5)', 'usecols': '[0, 1]', 'names': "['Field', 'Value']"}), "(pseudofile, header=None, skiprows=2, nrows=5, usecols=[0, 1\n ], names=['Field', 'Value'])\n", (1966, 2059), False, 'import pandas\n'), ... |
# Copyright (c) 2016 <NAME> (<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, di... | [
"utils.annotations.overrides"
] | [((1369, 1398), 'utils.annotations.overrides', 'overrides', (['ElementTreeVisitor'], {}), '(ElementTreeVisitor)\n', (1378, 1398), False, 'from utils.annotations import virtual, overrides\n'), ((1782, 1809), 'utils.annotations.overrides', 'overrides', (['ElementProcessor'], {}), '(ElementProcessor)\n', (1791, 1809), Fal... |
# This program has been developed by students from the bachelor Computer Science at Utrecht University within the
# Software and Game project course
# ©Copyright Utrecht University Department of Information and Computing Sciences.
"""Perform sync_agent presence check on starting the app."""
from django.apps import AppC... | [
"django.core.validators.URLValidator",
"assistants.sync_agent.build_sync_agents",
"os.getenv",
"os.environ.get",
"django.core.exceptions.ValidationError"
] | [((636, 662), 'os.environ.get', 'os.environ.get', (['"""RUN_MAIN"""'], {}), "('RUN_MAIN')\n", (650, 662), False, 'import os\n'), ((854, 904), 'django.core.validators.URLValidator', 'validators.URLValidator', ([], {'schemes': "('http', 'https')"}), "(schemes=('http', 'https'))\n", (877, 904), True, 'import django.core.v... |
# Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"numpy.where",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.spacing"
] | [((2253, 2292), 'numpy.array', 'np.array', (["[k['score'] for k in kpts_db]"], {}), "([k['score'] for k in kpts_db])\n", (2261, 2292), True, 'import numpy as np\n'), ((2370, 2408), 'numpy.array', 'np.array', (["[k['area'] for k in kpts_db]"], {}), "([k['area'] for k in kpts_db])\n", (2378, 2408), True, 'import numpy as... |
# import the necessary packages
import numpy as np
import cv2
cap=cv2.VideoCapture(1)
def order_points(pts):
# initialzie a list of coordinates that will be ordered
# such that the first entry in the list is the top-left,
# the second entry is the top-right, the third is the
# bottom-right, and the fourth is the b... | [
"cv2.setMouseCallback",
"numpy.sqrt",
"cv2.getPerspectiveTransform",
"numpy.diff",
"numpy.argmax",
"cv2.imshow",
"numpy.array",
"numpy.zeros",
"cv2.warpPerspective",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.circle",
"numpy.argmin",
"cv2.waitKey",
"cv2.namedWindow"
] | [((66, 85), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(1)'], {}), '(1)\n', (82, 85), False, 'import cv2\n'), ((2964, 3006), 'numpy.array', 'np.array', (['[(0, 0), (0, 1), (1, 1), (1, 0)]'], {}), '([(0, 0), (0, 1), (1, 1), (1, 0)])\n', (2972, 3006), True, 'import numpy as np\n'), ((3787, 3810), 'cv2.destroyAllWindows',... |
#!/usr/bin/python
from snap.pyglog import *
from snap.deluge import provenance
from snap.deluge import core
def test_PrintResourceProvenanceList():
#uri = 'maprfs://data/itergraph/tide_v12//sift//cbir/3cf541188f15713d6ebb2b9ff6badb8e//itergraph/0142f574ff8a1d0f2deaabb1622e84f8//phase002//merged_matches.pert'
uri... | [
"snap.deluge.core.GetResourceFingerprintFromUri",
"snap.deluge.provenance.GetResourceTiming"
] | [((664, 703), 'snap.deluge.core.GetResourceFingerprintFromUri', 'core.GetResourceFingerprintFromUri', (['uri'], {}), '(uri)\n', (698, 703), False, 'from snap.deluge import core\n'), ((706, 747), 'snap.deluge.provenance.GetResourceTiming', 'provenance.GetResourceTiming', (['fingerprint'], {}), '(fingerprint)\n', (734, 7... |
from datetime import datetime, date
from marqeta.response_models import datetime_object
import json
import re
class Pos(object):
def __init__(self, json_response):
self.json_response = json_response
def __str__(self):
return json.dumps(self.json_response, default=self.json_serial)
@stati... | [
"json.dumps"
] | [((252, 308), 'json.dumps', 'json.dumps', (['self.json_response'], {'default': 'self.json_serial'}), '(self.json_response, default=self.json_serial)\n', (262, 308), False, 'import json\n')] |
import time
from selenium import webdriver
def main():
driver = webdriver.Chrome(executable_path='chromedriver.exe')
driver.get('https://www.w3schools.com/html/default.asp')
time.sleep(3)
driver.find_element_by_partial_link_text('HTML Global Attributes').click() #Es el texto que hace el link hacia una ... | [
"selenium.webdriver.Chrome",
"time.sleep"
] | [((69, 121), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': '"""chromedriver.exe"""'}), "(executable_path='chromedriver.exe')\n", (85, 121), False, 'from selenium import webdriver\n'), ((187, 200), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (197, 200), False, 'import time\n')] |
import numpy as np
from deap import benchmarks
from BayesOpt import BO
from BayesOpt.Surrogate import RandomForest
from BayesOpt.SearchSpace import ContinuousSpace, OrdinalSpace, NominalSpace
from BayesOpt.base import Solution
np.random.seed(42)
def obj_func(x):
x_r, x_i, x_d = np.array(x[:2]), x[2], x[3]
i... | [
"BayesOpt.SearchSpace.ContinuousSpace",
"BayesOpt.Surrogate.RandomForest",
"BayesOpt.BO",
"BayesOpt.SearchSpace.OrdinalSpace",
"numpy.array",
"numpy.sum",
"BayesOpt.base.Solution",
"numpy.random.seed",
"BayesOpt.SearchSpace.NominalSpace"
] | [((230, 248), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (244, 248), True, 'import numpy as np\n'), ((745, 872), 'BayesOpt.base.Solution', 'Solution', (["[4.6827082694127835, 9.87885354178838, 5, 'A']"], {'var_name': "['r_0', 'r_1', 'i', 'd']", 'n_eval': '(1)', 'fitness': '(236.76575128)'}), "([4.... |
# Standard library imports
import datetime
import time
import json
import copy
# Third party imports
import traceback
import requests
from loguru import logger
import pymysql
# import requests
import paramiko
# Local application imports
from func.save_data import save_509_data
from utils import send_to_axxnr
from fun... | [
"time.localtime",
"json.loads",
"func.save_data.save_509_data.save_loading_rate_increment",
"loguru.logger.debug",
"paramiko.AutoAddPolicy",
"func.save_data.save_509_data.save_hive_db_increment",
"func.save_data.save_509_data.save_row_flow",
"time.strftime",
"pymysql.connect",
"requests.get",
"d... | [((520, 540), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (538, 540), False, 'import paramiko\n'), ((1771, 1791), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (1789, 1791), False, 'import paramiko\n'), ((2212, 2232), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (2230,... |
'''
Author :: <NAME> -- https://github.com/ravisankar712
<NAME>' webpage :: http://www.red3d.com/cwr/boids/
'''
from manimlib.imports import *
import QuadTree as qt
###########################
## setup for simulations ##
###########################
#colors!!
BLUE_SHADES = ["#023E8A", "#0077B6", "#0096C7... | [
"QuadTree.QuadTree",
"QuadTree.Point",
"QuadTree.Rect"
] | [((14068, 14112), 'QuadTree.Rect', 'qt.Rect', (['(0.0)', '(0.0)', 'FRAME_WIDTH', 'FRAME_HEIGHT'], {}), '(0.0, 0.0, FRAME_WIDTH, FRAME_HEIGHT)\n', (14075, 14112), True, 'import QuadTree as qt\n'), ((14128, 14149), 'QuadTree.QuadTree', 'qt.QuadTree', (['boundary'], {}), '(boundary)\n', (14139, 14149), True, 'import QuadT... |
from flasgger import Swagger
from flask import Flask
from flask_cors import CORS
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_pymongo import PyMongo
from sitepipes.config import init_config, init_logger
config = init_config()
log = init_logger('log')
cors = CORS()
db = PyMongo()
... | [
"flask_login.LoginManager",
"sitepipes.config.init_config",
"flask_cors.CORS",
"sitepipes.config.init_logger",
"flasgger.Swagger",
"flask.Flask",
"flask_pymongo.PyMongo",
"flask_migrate.Migrate",
"sitepipes.network.abstract.Site"
] | [((251, 264), 'sitepipes.config.init_config', 'init_config', ([], {}), '()\n', (262, 264), False, 'from sitepipes.config import init_config, init_logger\n'), ((271, 289), 'sitepipes.config.init_logger', 'init_logger', (['"""log"""'], {}), "('log')\n", (282, 289), False, 'from sitepipes.config import init_config, init_l... |
import json
import os
import shutil
import subprocess
import sys
import tempfile
import unittest
sys.path.append("../main")
from algorithms import *
port = 2222
def sshd(**kwargs):
dirname = tempfile.mkdtemp()
confname = dirname + "/sshd_config"
logname = dirname + "/sshd.log"
with open(confname,... | [
"os.listdir",
"subprocess.Popen",
"tempfile.mkdtemp",
"shutil.copy",
"sys.path.append"
] | [((98, 124), 'sys.path.append', 'sys.path.append', (['"""../main"""'], {}), "('../main')\n", (113, 124), False, 'import sys\n'), ((200, 218), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (216, 218), False, 'import tempfile\n'), ((987, 1060), 'subprocess.Popen', 'subprocess.Popen', (["['/usr/sbin/sshd', '-f... |
from datetime import datetime, timedelta
from dateutil import parser as dateutil_parser
from .messages import LEMBRETE
def prettify_date(dt_object):
"""
Pretty-format a datetime object
Args:
dt_object(datetime.datetime): A datetime object.
Returns:
str: A pretty-formatted date.
... | [
"dateutil.parser.parse",
"datetime.timedelta"
] | [((794, 826), 'dateutil.parser.parse', 'dateutil_parser.parse', (['date_args'], {}), '(date_args)\n', (815, 826), True, 'from dateutil import parser as dateutil_parser\n'), ((1974, 1995), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(30)'}), '(minutes=30)\n', (1983, 1995), False, 'from datetime import datetime,... |
from .action import Action
from .exceptions import ShowMenuException
from game_state import GamePhase
from loader_functions.data_loaders import save_game
class ShowMenuAction(Action):
def _execute(self):
# Go back to main menu
# TODO When going back to main game it's always player's turn, mayb... | [
"loader_functions.data_loaders.save_game"
] | [((405, 484), 'loader_functions.data_loaders.save_game', 'save_game', (['self.player', 'self.game_map', 'self.message_log', 'GamePhase.PLAYERS_TURN'], {}), '(self.player, self.game_map, self.message_log, GamePhase.PLAYERS_TURN)\n', (414, 484), False, 'from loader_functions.data_loaders import save_game\n')] |
#1.Extract postcodes from csv file
#2.For every postcode
import urllib.request
import re
import csv
array = """DG1 1DF
DG1 1DG
DG1 1DJ
DG1 1DL
DG1 1DR
DG1 1DT
DG1 1DU
DG1 1DX
DG1 1EA
DG1 1EB
DG1 1ED
DG1 1EF
DG1 1EG
DG1 1EH
DG1 1EJ
DG1 1EL
DG1 1ET
DG1 1EW
DG1 1EX
DG1 1FA
DG1 1GL
DG1 1GN
... | [
"re.findall",
"csv.writer",
"re.compile"
] | [((68098, 68148), 're.compile', 're.compile', (["b'Please select one of the following '"], {}), "(b'Please select one of the following ')\n", (68108, 68148), False, 'import re\n'), ((68165, 68200), 're.findall', 're.findall', (['localityPattern', 'web_pg'], {}), '(localityPattern, web_pg)\n', (68175, 68200), False, 'im... |
"""
MIT License
Copyright (c) 2021 <NAME> (benrammok)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, me... | [
"wx.App",
"wx.Clipboard.Open",
"gui_wx.MyFrame1.__init__",
"wx.Clipboard.Clear"
] | [((5981, 5994), 'wx.App', 'wx.App', (['(False)'], {}), '(False)\n', (5987, 5994), False, 'import wx\n'), ((1230, 1268), 'gui_wx.MyFrame1.__init__', 'gui_wx.MyFrame1.__init__', (['self', 'parent'], {}), '(self, parent)\n', (1254, 1268), False, 'import gui_wx\n'), ((5840, 5856), 'wx.Clipboard.Open', 'Clipboard.Open', ([]... |
import re
from .constants import (
UK_POSTCODE_AREA_REGEX,
UK_POSTCODE_DISTRICT_REGEX,
UK_POSTCODE_RULES_LIST,
UK_POSTCODE_SECTOR_REGEX,
UK_POSTCODE_UNIT_REGEX,
UK_POSTCODE_VALIDATION_REGEX,
)
from .exceptions import InvalidPostcode, PostcodeNotValidated
class UKPostcode:
raw_postcode = N... | [
"re.search"
] | [((902, 949), 're.search', 're.search', (['UK_POSTCODE_AREA_REGEX', 'self.outward'], {}), '(UK_POSTCODE_AREA_REGEX, self.outward)\n', (911, 949), False, 'import re\n'), ((1012, 1063), 're.search', 're.search', (['UK_POSTCODE_DISTRICT_REGEX', 'self.outward'], {}), '(UK_POSTCODE_DISTRICT_REGEX, self.outward)\n', (1021, 1... |
import numpy as num
import scipy.sparse.linalg as alg
import scipy.linalg as algnorm
import scipy.sparse as smat
import random
# Operacje grafowe - może wydzielić ?
def to_adiacency_row(neighbours, n):
row = num.zeros(n)
row[neighbours] = 1
return row
def graph_to_matrix(graph): # Tworzy macierz rzadką... | [
"numpy.identity",
"scipy.sparse.lil_matrix",
"scipy.sparse.linalg.inv",
"scipy.sparse.linalg.eigsh",
"numpy.sum",
"numpy.zeros",
"scipy.linalg.norm",
"scipy.sparse.linalg.norm",
"random.random",
"scipy.sparse.diags",
"scipy.sparse.csr_matrix"
] | [((214, 226), 'numpy.zeros', 'num.zeros', (['n'], {}), '(n)\n', (223, 226), True, 'import numpy as num\n'), ((519, 569), 'scipy.sparse.csr_matrix', 'smat.csr_matrix', (['(data, (rows, cols))', '(n, n)', '"""d"""'], {}), "((data, (rows, cols)), (n, n), 'd')\n", (534, 569), True, 'import scipy.sparse as smat\n'), ((2878,... |
import os
os.environ.setdefault("DEBUG", "0")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangocon.settings")
from django.core.wsgi import get_wsgi_application # noqa
from whitenoise.django import DjangoWhiteNoise # noqa
application = DjangoWhiteNoise(get_wsgi_application())
| [
"os.environ.setdefault",
"django.core.wsgi.get_wsgi_application"
] | [((11, 46), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DEBUG"""', '"""0"""'], {}), "('DEBUG', '0')\n", (32, 46), False, 'import os\n'), ((47, 116), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""djangocon.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'djangocon.se... |
# -*- coding: utf-8 -*-
from odoo import http
from odoo.http import request
from odoo.addons.auth_signup_confirmation.controllers.auth_signup_confirmation import (
AuthConfirm,
)
class AuthLead(AuthConfirm):
@http.route("/web/signup/confirm", type="http", auth="public")
def singnup_using_generated_link(s... | [
"odoo.http.route"
] | [((220, 281), 'odoo.http.route', 'http.route', (['"""/web/signup/confirm"""'], {'type': '"""http"""', 'auth': '"""public"""'}), "('/web/signup/confirm', type='http', auth='public')\n", (230, 281), False, 'from odoo import http\n')] |
import keras
import pandas as pd
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.utils import to_categorical
import matplotlib.pyplot as plt
import time
start_time=time.time()
location="dataforDl.csv"
data=pd.read_csv(location)
data_columns=data.columns
xtrain = data[dat... | [
"pandas.read_csv",
"numpy.argmax",
"keras.models.Sequential",
"keras.utils.to_categorical",
"keras.layers.Dense",
"time.time"
] | [((213, 224), 'time.time', 'time.time', ([], {}), '()\n', (222, 224), False, 'import time\n'), ((255, 276), 'pandas.read_csv', 'pd.read_csv', (['location'], {}), '(location)\n', (266, 276), True, 'import pandas as pd\n'), ((425, 447), 'pandas.read_csv', 'pd.read_csv', (['location1'], {}), '(location1)\n', (436, 447), T... |
from django.contrib import admin
from .models import Profile
# Register your models here.
class ProfileAdmin(admin.ModelAdmin):
class Meta:
fields = '__all__'
admin.site.register(Profile, ProfileAdmin) | [
"django.contrib.admin.site.register"
] | [((174, 216), 'django.contrib.admin.site.register', 'admin.site.register', (['Profile', 'ProfileAdmin'], {}), '(Profile, ProfileAdmin)\n', (193, 216), False, 'from django.contrib import admin\n')] |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 15 15:41:38 2018
@author: steve
"""
import re,types
from HeroLabStatBase import VERBOSITY,Character
OPERATORS = ["<",">","==",">=","<=","<>","!=","is","not","in","and","or"]
class Matcher(object):
"""
Container for attributes and methods related to finding repla... | [
"re.split",
"re.sub",
"re.match",
"re.search"
] | [((12702, 12746), 're.sub', 're.sub', (['"""^\\\\{\\\\{(.*)\\\\}\\\\}$"""', '"""\\\\1"""', 'keyText'], {}), "('^\\\\{\\\\{(.*)\\\\}\\\\}$', '\\\\1', keyText)\n", (12708, 12746), False, 'import re, types\n'), ((12851, 12883), 're.search', 're.search', (['"""^\\\\{(.*)\\\\}$"""', 'myKey'], {}), "('^\\\\{(.*)\\\\}$', myKe... |
import subprocess
import json
import os
import csv
import numpy as np
import pandas as pd
import pysam
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
def get_orf(input_genome, output_genome, orf):
orf = int(orf)
record = SeqIO.read(input_genome, 'fasta')
record.seq = re... | [
"csv.DictWriter",
"pandas.read_csv",
"Bio.Seq.Seq",
"pysam.AlignmentFile",
"numpy.array",
"numpy.arange",
"os.remove",
"os.path.exists",
"subprocess.run",
"Bio.SeqIO.read",
"Bio.SeqIO.write",
"os.mkdir",
"numpy.random.seed",
"pandas.DataFrame",
"pysam.index",
"numpy.ceil",
"numpy.ran... | [((267, 300), 'Bio.SeqIO.read', 'SeqIO.read', (['input_genome', '"""fasta"""'], {}), "(input_genome, 'fasta')\n", (277, 300), False, 'from Bio import SeqIO\n'), ((339, 382), 'Bio.SeqIO.write', 'SeqIO.write', (['record', 'output_genome', '"""fasta"""'], {}), "(record, output_genome, 'fasta')\n", (350, 382), False, 'from... |
#!/usr/bin/python
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
from catkin_lint.main import main
main()
| [
"os.path.dirname",
"catkin_lint.main.main"
] | [((140, 146), 'catkin_lint.main.main', 'main', ([], {}), '()\n', (144, 146), False, 'from catkin_lint.main import main\n'), ((71, 96), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (86, 96), False, 'import os\n')] |
import sys
import pycpabe
argc = len(sys.argv)
if argc < 6:
print("Usage: keygen [sk] [pk] [mk] [no] [a1] ... [aN]")
print("sk: path to generate secret key")
print("pk: path to public key")
print("mk: path to master key")
print("no: number of attributeds in generated secret key")
print("a1 ... aN: attributes")
... | [
"pycpabe.cpabe_vkeygen",
"sys.exit"
] | [((321, 331), 'sys.exit', 'sys.exit', ([], {}), '()\n', (329, 331), False, 'import sys\n'), ((520, 564), 'pycpabe.cpabe_vkeygen', 'pycpabe.cpabe_vkeygen', (['sk', 'pk', 'mk', 'no', 'attrs'], {}), '(sk, pk, mk, no, attrs)\n', (541, 564), False, 'import pycpabe\n'), ((598, 608), 'sys.exit', 'sys.exit', ([], {}), '()\n', ... |
#!/usr/bin/env python3
import re
from os import path
import lxml.etree as ET
import lxml.objectify as objectify
from bs4 import BeautifulSoup
from .models import Corpora
class TeiReader:
__xmlns = re.compile(r' *xmlns(|\:\w+)="[^"]*"')
__invalid_ampersand = re.compile(r'&(?=[ <])')
__xslt = ET.parse(path... | [
"lxml.etree.XSLT",
"re.compile",
"bs4.BeautifulSoup",
"os.path.dirname",
"lxml.etree.fromstring"
] | [((204, 243), 're.compile', 're.compile', (['""" *xmlns(|\\\\:\\\\w+)="[^"]*\\""""'], {}), '(\' *xmlns(|\\\\:\\\\w+)="[^"]*"\')\n', (214, 243), False, 'import re\n'), ((269, 292), 're.compile', 're.compile', (['"""&(?=[ <])"""'], {}), "('&(?=[ <])')\n", (279, 292), False, 'import re\n'), ((403, 418), 'lxml.etree.XSLT',... |