code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# 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 unde... | [
"unittest.mock.Mock",
"senlinclient.common.utils.json_formatter",
"senlinclient.common.utils.await_action",
"senlinclient.common.utils.process_stack_spec",
"senlinclient.common.utils.format_parameters",
"senlinclient.common.utils._check",
"senlinclient.common.i18n._",
"senlinclient.common.utils.list_f... | [((1935, 2011), 'unittest.mock.patch.object', 'mock.patch.object', (['template_utils', '"""process_multiple_environments_and_files"""'], {}), "(template_utils, 'process_multiple_environments_and_files')\n", (1952, 2011), False, 'from unittest import mock\n'), ((2040, 2098), 'unittest.mock.patch.object', 'mock.patch.obj... |
#!/usr/bin/env python
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License is
# located at
# http://aws.amazon.com/apache2.0/
#
# or in t... | [
"logging.getLogger",
"logging.StreamHandler",
"argparse.ArgumentParser",
"AWSIoTPythonSDK.core.greengrass.discovery.providers.DiscoveryInfoProvider",
"logging.Formatter",
"json.dumps",
"gpiozero.Button",
"gg_group_setup.GroupConfigFile",
"os.path.realpath",
"datetime.datetime.now",
"utils.discov... | [((1079, 1106), 'logging.getLogger', 'logging.getLogger', (['"""button"""'], {}), "('button')\n", (1096, 1106), False, 'import logging\n'), ((1117, 1140), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (1138, 1140), False, 'import logging\n'), ((1153, 1223), 'logging.Formatter', 'logging.Formatter'... |
import argparse
import sys
class HelpOnFailArgumentParser(argparse.ArgumentParser):
"""
Prints help whenever the command-line arguments could not be parsed.
"""
def error(self, message):
sys.stderr.write("Error: %s\n\n" % message)
self.print_help()
sys.exit(2)
| [
"sys.stderr.write",
"sys.exit"
] | [((214, 257), 'sys.stderr.write', 'sys.stderr.write', (["('Error: %s\\n\\n' % message)"], {}), "('Error: %s\\n\\n' % message)\n", (230, 257), False, 'import sys\n'), ((292, 303), 'sys.exit', 'sys.exit', (['(2)'], {}), '(2)\n', (300, 303), False, 'import sys\n')] |
from __future__ import division
import itertools
from pyoperators.iterative.stopconditions import StopCondition
from pyoperators.utils.testing import assert_eq, assert_raises
class A():
pass
sc1 = StopCondition(lambda s: s.a > 2, 'a>2')
sc2 = StopCondition(lambda s: s.b > 2, 'b>2')
sc3 = StopCondition(lambda s... | [
"itertools.product",
"pyoperators.iterative.stopconditions.StopCondition",
"pyoperators.utils.testing.assert_raises"
] | [((206, 245), 'pyoperators.iterative.stopconditions.StopCondition', 'StopCondition', (['(lambda s: s.a > 2)', '"""a>2"""'], {}), "(lambda s: s.a > 2, 'a>2')\n", (219, 245), False, 'from pyoperators.iterative.stopconditions import StopCondition\n'), ((252, 291), 'pyoperators.iterative.stopconditions.StopCondition', 'Sto... |
from ctypes import c_ushort
class DOMException(Exception):
"""Exception `DOMException`
DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impossible to perform
(either for logical reasons, because data is lost, or because the implementation has become unstable... | [
"ctypes.c_ushort"
] | [((1100, 1111), 'ctypes.c_ushort', 'c_ushort', (['(1)'], {}), '(1)\n', (1108, 1111), False, 'from ctypes import c_ushort\n'), ((1147, 1158), 'ctypes.c_ushort', 'c_ushort', (['(2)'], {}), '(2)\n', (1155, 1158), False, 'from ctypes import c_ushort\n'), ((1197, 1208), 'ctypes.c_ushort', 'c_ushort', (['(3)'], {}), '(3)\n',... |
# Generated by Django 3.2b1 on 2021-03-16 23:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('videos', '0012_alter_video_video_id'),
('playlists', '0005_remove_playlist_videos'),
]
operations = [
... | [
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ManyToManyField",
"django.db.models.BigAutoField",
"django.db.models.DateTimeField"
] | [((1104, 1226), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'related_name': '"""playlist_item"""', 'through': '"""playlists.PlaylistItem"""', 'to': '"""videos.Video"""'}), "(blank=True, related_name='playlist_item', through=\n 'playlists.PlaylistItem', to='videos.Video')\n"... |
"""
Copyright 2010-2018 University Of Southern California
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... | [
"os.listdir",
"os.path.join",
"bbp_formatter.peer2bbp"
] | [((1255, 1271), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1265, 1271), False, 'import os\n'), ((1670, 1706), 'os.path.join', 'os.path.join', (['path', "('%s_E.acc' % sta)"], {}), "(path, '%s_E.acc' % sta)\n", (1682, 1706), False, 'import os\n'), ((1727, 1763), 'os.path.join', 'os.path.join', (['path', "(... |
#!/usr/bin/env python
# coding: utf-8
# # Publications markdown generator for academicpages
#
# Takes a set of bibtex of publications and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.... | [
"re.sub",
"pylatexenc.latex2text.LatexNodes2Text",
"os.path.basename",
"pybtex.database.input.bibtex.Parser"
] | [((1846, 1861), 'pybtex.database.input.bibtex.Parser', 'bibtex.Parser', ([], {}), '()\n', (1859, 1861), False, 'from pybtex.database.input import bibtex\n'), ((4515, 4565), 're.sub', 're.sub', (['"""\\\\[.*\\\\]|[^a-zA-Z0-9_-]"""', '""""""', 'clean_title'], {}), "('\\\\[.*\\\\]|[^a-zA-Z0-9_-]', '', clean_title)\n", (45... |
import os
from pathlib import Path
import pytest
from ploomber.util import default
from ploomber.exceptions import DAGSpecNotFound
@pytest.fixture
def pkg_location():
parent = Path('src', 'package_a')
parent.mkdir(parents=True)
pkg_location = (parent / 'pipeline.yaml')
pkg_location.touch()
retur... | [
"ploomber.util.default.path_to_env",
"ploomber.util.default.find_package_name",
"ploomber.util.default.entry_point_relative",
"pathlib.Path",
"ploomber.util.default.find_root_recursively",
"os.chdir",
"pytest.mark.parametrize",
"pytest.raises",
"ploomber.util.default.entry_point"
] | [((2543, 2588), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""arg"""', "['dir', None]"], {}), "('arg', ['dir', None])\n", (2566, 2588), False, 'import pytest\n'), ((2708, 3049), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""to_create, to_move"""', "[[['environment.yml'], '.'], [['requirement... |
import turtle
turtle.bgcolor("black")
sq = turtle.Turtle()
sq.speed(20)
sq.color("white")
for i in range(500):
sq.forward(i)
sq.left(91)
| [
"turtle.bgcolor",
"turtle.Turtle"
] | [((15, 38), 'turtle.bgcolor', 'turtle.bgcolor', (['"""black"""'], {}), "('black')\n", (29, 38), False, 'import turtle\n'), ((44, 59), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (57, 59), False, 'import turtle\n')] |
"""
@author: <NAME>
@title: SmartSearch - An Intelligent Search Engine.
@date: 05/06/2019
"""
import requests
from uuid import uuid4
from bs4 import BeautifulSoup
from urllib.parse import urlsplit
DOMAIN = "uic.edu"
def check_goodness(url):
"""
Function to check if the url is a dead end (pds, doc, docx, etc... | [
"bs4.BeautifulSoup",
"uuid.uuid4",
"urllib.parse.urlsplit"
] | [((3974, 3987), 'urllib.parse.urlsplit', 'urlsplit', (['url'], {}), '(url)\n', (3982, 3987), False, 'from urllib.parse import urlsplit\n'), ((5363, 5403), 'bs4.BeautifulSoup', 'BeautifulSoup', (['url_response.text', '"""lxml"""'], {}), "(url_response.text, 'lxml')\n", (5376, 5403), False, 'from bs4 import BeautifulSoup... |
from abc import ABC, abstractmethod
import requests
import time
import os
class BaseCollector(ABC):
@abstractmethod
def collect(self):
pass
def get_vcenters(self):
current_iteration = self.get_iteration()
url = "http://localhost:8000/vcenters/{}".format(current_iteration)
... | [
"requests.post",
"time.sleep",
"requests.get",
"requests.delete"
] | [((330, 347), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (342, 347), False, 'import requests\n'), ((594, 611), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (606, 611), False, 'import requests\n'), ((858, 875), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (870, 875), False, 'impo... |
import unittest
from rdbtools3.intset import unpack_intset
from rdbtools3.exceptions import RDBValueError
class TestIntset(unittest.TestCase):
def test_3x2bytes(self):
val = (b'\x02\x00\x00\x00' # int size
b'\x03\x00\x00\x00' # set length
b'\x01\x00' # item 1
... | [
"unittest.main",
"rdbtools3.intset.unpack_intset"
] | [((2043, 2058), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2056, 2058), False, 'import unittest\n'), ((426, 444), 'rdbtools3.intset.unpack_intset', 'unpack_intset', (['val'], {}), '(val)\n', (439, 444), False, 'from rdbtools3.intset import unpack_intset\n'), ((705, 723), 'rdbtools3.intset.unpack_intset', 'unp... |
"""
Predicts which tiles are of good quality in WBS.
Usage:
python3 quality_control.py --help
"""
import argparse
from tqdm import tqdm
import tensorflow as tf
from tensorflow import keras
from glob import glob
from quality_net_utilities import *
from image_generator import *
n_channels = 3
if __name__ == "__m... | [
"tqdm.tqdm",
"tensorflow.keras.models.load_model",
"tensorflow.data.Dataset.from_generator",
"argparse.ArgumentParser"
] | [((341, 433), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Predicts which tiles are of good quality in WBS."""'}), "(description=\n 'Predicts which tiles are of good quality in WBS.')\n", (364, 433), False, 'import argparse\n'), ((1432, 1477), 'tensorflow.keras.models.load_model', '... |
"""
Square
======
"""
import numpy as np
from ..topology_graph import Edge
from .cof import Cof
from .vertices import LinearVertex, NonLinearVertex
class Square(Cof):
"""
Represents a sqaure COF topology graph.
Unoptimized construction
.. moldoc::
import moldoc.molecule as molecule
... | [
"numpy.array"
] | [((3649, 3674), 'numpy.array', 'np.array', (['[1.0, 0.0, 0.0]'], {}), '([1.0, 0.0, 0.0])\n', (3657, 3674), True, 'import numpy as np\n'), ((3681, 3706), 'numpy.array', 'np.array', (['[0.0, 1.0, 0.0]'], {}), '([0.0, 1.0, 0.0])\n', (3689, 3706), True, 'import numpy as np\n'), ((3713, 3738), 'numpy.array', 'np.array', (['... |
# Scripts for modeling ATF data.
def atf_article_uri(url, post_id):
return get_url_hash(url)+"/"+post_id
def atf_thread_uri(url):
return get_url_hash(url)
test_date = "Wed Feb 11, 2015 10:31 am"
def atf_date_created(date, format="%a %b %d, %Y %I:%M %p"):
"""Put the date in ISO format"""
return iso86... | [
"re.finditer",
"re.compile"
] | [((26507, 26549), 're.compile', 're.compile', (["('\\\\b%s\\\\b' % ph)", 're.IGNORECASE'], {}), "('\\\\b%s\\\\b' % ph, re.IGNORECASE)\n", (26517, 26549), False, 'import re\n'), ((27304, 27346), 're.compile', 're.compile', (["('\\\\b%s\\\\b' % ph)", 're.IGNORECASE'], {}), "('\\\\b%s\\\\b' % ph, re.IGNORECASE)\n", (27314... |
#
# test_model
#
# Copyright (c) 2011-2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
#
import ayame
from ayame import model
from base import AyameTestCase
class ModelTestCase(AyameTestCase):
def test_model(self):
m = model.Model(None)
self.assertIsNone(m.object)
m.object = '... | [
"ayame.model.CompoundModel",
"ayame.Component",
"ayame.model.Model",
"ayame.MarkupContainer"
] | [((245, 262), 'ayame.model.Model', 'model.Model', (['None'], {}), '(None)\n', (256, 262), False, 'from ayame import model\n'), ((494, 509), 'ayame.model.Model', 'model.Model', (['""""""'], {}), "('')\n", (505, 509), False, 'from ayame import model\n'), ((1159, 1181), 'ayame.model.CompoundModel', 'model.CompoundModel', ... |
# coding: utf-8
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from config import config
app = Flask(__name__)
"""
config
-- 'default': DevelopmentConfig
-- 'develop': DevelopmentConfig
-- 'testing': TestingConfig
-- 'production': ProductionConfig
you can... | [
"flask_sqlalchemy.SQLAlchemy",
"flask_login.LoginManager",
"flask.Flask"
] | [((152, 167), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (157, 167), False, 'from flask import Flask\n'), ((457, 472), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (467, 472), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((489, 506), 'flask_login.LoginManager', 'LoginM... |
import unittest
from app.models import User,Posts,Comments,Subscribe
class UserModelTest(unittest.TestCase):
def setUp(self):
self.new_user = User(password = '<PASSWORD>')
def test_password_setter(self):
self.assertTrue(self.new_user.pass_secure is not None)
def test_no_access_pa... | [
"app.models.Subscribe.query.all",
"app.models.Posts",
"app.models.User",
"app.models.Subscribe",
"app.models.Posts.query.all",
"app.models.Comments.query.all",
"app.models.Comments"
] | [((156, 183), 'app.models.User', 'User', ([], {'password': '"""<PASSWORD>"""'}), "(password='<PASSWORD>')\n", (160, 183), False, 'from app.models import User, Posts, Comments, Subscribe\n'), ((618, 691), 'app.models.Posts', 'Posts', ([], {'title': '"""Terabyte"""', 'body': '"""This is a new post"""', 'category': '"""Te... |
import csv
import os
class csvReader:
def __init__(self, address) -> None:
self.address = address
self.data = []
def read(self, delimiter=",") -> None:
with open(self.address) as csvfile:
reader = csv.reader(csvfile, delimiter=delimiter)
self.fields = next(read... | [
"csv.writer",
"csv.reader",
"csv.DictReader"
] | [((244, 284), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': 'delimiter'}), '(csvfile, delimiter=delimiter)\n', (254, 284), False, 'import csv\n'), ((513, 600), 'csv.writer', 'csv.writer', (['csvfile'], {'delimiter': 'delimiter', 'quotechar': '"""\\""""', 'quoting': 'csv.QUOTE_MINIMAL'}), '(csvfile, delimiter=... |
# Made by @dyphen12
from flask import Flask, request
from flask_cors import CORS
from flask_restful import reqparse, abort, Api, Resource
import json
import os
from vibra.api.core import api_version
from vibra.api.users import handler as uhd
app = Flask(__name__)
api = Api(app)
CORS(app)
class Hello(Resource):
... | [
"json.loads",
"vibra.api.users.handler.user_login_ryzen",
"flask_restful.reqparse.RequestParser",
"flask_cors.CORS",
"flask_restful.Api",
"flask.Flask",
"vibra.api.users.handler.user_signup_ryzen",
"vibra.api.core.api_version"
] | [((252, 267), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (257, 267), False, 'from flask import Flask, request\n'), ((274, 282), 'flask_restful.Api', 'Api', (['app'], {}), '(app)\n', (277, 282), False, 'from flask_restful import reqparse, abort, Api, Resource\n'), ((283, 292), 'flask_cors.CORS', 'CORS',... |
from allauth.account.views import confirm_email as confirm_email_view
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path, re_path
from django.views import defaults as default_views
from django.views.generic import TemplateVi... | [
"django.urls.include",
"django.views.generic.TemplateView.as_view",
"django.conf.urls.static.static",
"django.urls.re_path",
"django.urls.path",
"drf_yasg.openapi.Info"
] | [((431, 483), 'drf_yasg.openapi.Info', 'openapi.Info', ([], {'title': '"""API Docs"""', 'default_version': '"""v1"""'}), "(title='API Docs', default_version='v1')\n", (443, 483), False, 'from drf_yasg import openapi\n'), ((1007, 1068), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root... |
'''
Module for using jyserver in Flask. This module provides to new
decorators.
Decorators
-----------
* @use
Link an application object to the Flask app
* @task
Helper that wraps a function inside a separate thread so that
it can execute concurrently.
Example
-------------
```html
<p id="time">TIME</... | [
"threading.Thread",
"json.loads",
"jyserver.ClientContext"
] | [((1232, 1285), 'threading.Thread', 'threading.Thread', ([], {'target': 'func', 'args': 'args', 'daemon': '(True)'}), '(target=func, args=args, daemon=True)\n', (1248, 1285), False, 'import threading\n'), ((1503, 1535), 'jyserver.ClientContext', 'jyserver.ClientContext', (['appClass'], {}), '(appClass)\n', (1525, 1535)... |
import pandas as pd
import matplotlib.cm as cm
import numpy as np
import matplotlib.pyplot as plt
def plot(problemVariants, *, zero, outfile, numThreads):
columns = ['Problem', 'NotTriedYet', 'Scheduled', 'Success', 'Timeout', 'Stopped', 'Ended']
colors = ['w', 'tab:purple', 'tab:green', 'tab:orange', 'tab:red... | [
"pandas.DataFrame",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.legend",
"numpy.arange"
] | [((3598, 3614), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(111)'], {}), '(111)\n', (3609, 3614), True, 'import matplotlib.pyplot as plt\n'), ((4671, 4709), 'matplotlib.pyplot.legend', 'plt.legend', (['n', 'labels'], {'loc': '[1.01, 0.1]'}), '(n, labels, loc=[1.01, 0.1])\n', (4681, 4709), True, 'import matplotlib.p... |
#!/usr/bin/python
from __future__ import print_function
import sys
import rubrik_cdm
import getopt
import getpass
import urllib3
urllib3.disable_warnings()
def usage():
sys.stderr.write("Usage: rbk_share_grab.py [-h] [-c creds] [-p protocol] [-t token] [-o outfile] rubrik\n")
sys.stderr.write("-h | --help: P... | [
"getopt.getopt",
"rubrik_cdm.Connect",
"getpass.getpass",
"urllib3.disable_warnings",
"sys.stderr.write"
] | [((130, 156), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (154, 156), False, 'import urllib3\n'), ((176, 296), 'sys.stderr.write', 'sys.stderr.write', (['"""Usage: rbk_share_grab.py [-h] [-c creds] [-p protocol] [-t token] [-o outfile] rubrik\n"""'], {}), '(\n """Usage: rbk_share_grab.p... |
"""Realtime rate limiting tests."""
import sched
import threading
import time
import pytest
from pytest import approx
from redbucket import (InMemoryRateLimiter, RedisScriptRateLimiter,
RedisTransactionalRateLimiter, RateLimit, Zone)
@pytest.fixture
def in_memory_rate_limiter():
return I... | [
"pytest.approx",
"time.monotonic",
"sched.scheduler",
"time.sleep",
"redbucket.InMemoryRateLimiter",
"pytest.raises",
"redbucket.Zone",
"redbucket.RedisScriptRateLimiter",
"pytest.fixture",
"threading.Thread",
"redbucket.RedisTransactionalRateLimiter"
] | [((698, 762), 'pytest.fixture', 'pytest.fixture', ([], {'params': "('in_memory', 'redis_tx', 'redis_script')"}), "(params=('in_memory', 'redis_tx', 'redis_script'))\n", (712, 762), False, 'import pytest\n'), ((319, 340), 'redbucket.InMemoryRateLimiter', 'InMemoryRateLimiter', ([], {}), '()\n', (338, 340), False, 'from ... |
import os
from .vendored import colorconv
import numpy as np
import vispy.color
_matplotlib_list_file = os.path.join(os.path.dirname(__file__),
'matplotlib_cmaps.txt')
with open(_matplotlib_list_file) as fin:
matplotlib_colormaps = [line.rstrip() for line in fin]
def _all_r... | [
"numpy.clip",
"numpy.convolve",
"numpy.unique",
"numpy.full",
"numpy.max",
"os.path.dirname",
"numpy.array",
"numpy.zeros",
"numpy.stack",
"numpy.concatenate",
"numpy.meshgrid",
"numpy.all",
"numpy.broadcast_to",
"numpy.arange"
] | [((609, 653), 'numpy.array', 'np.array', (['[0.0, -83.07790815, -134.09790293]'], {}), '([0.0, -83.07790815, -134.09790293])\n', (617, 653), True, 'import numpy as np\n'), ((662, 707), 'numpy.array', 'np.array', (['[100.0, 175.01447356, 107.39905336]'], {}), '([100.0, 175.01447356, 107.39905336])\n', (670, 707), True, ... |
#!/usr/bin/env python3
"""
pass.py
Find hardcoded passwords on source code of your project.
python pass.py path/to/project
"""
import os
import sys
import re
import fnmatch
import json
from argparse import ArgumentParser
DEFAULT_BAD_WORDS = ['token', 'oauth', 'secret', 'pass', 'password', '<PASSWORD>']
DEFAULT_ANAL... | [
"argparse.ArgumentParser",
"re.compile",
"json.dumps",
"os.path.join",
"fnmatch.fnmatch",
"sys.exit",
"os.walk"
] | [((2964, 2982), 'os.walk', 'os.walk', (['root_path'], {}), '(root_path)\n', (2971, 2982), False, 'import os\n'), ((3537, 3629), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Check for hardcoded passwords and tokens in your project."""'}), "(description=\n 'Check for hardcoded passwords and to... |
from django.contrib.auth.models import User
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth import authenticate
class AuthenticationUserTestCase(APITestCase):
def setUp(self):
self.list_url = reverse('Company-list')
... | [
"django.contrib.auth.models.User.objects.create_superuser",
"django.contrib.auth.authenticate",
"django.urls.reverse"
] | [((293, 316), 'django.urls.reverse', 'reverse', (['"""Company-list"""'], {}), "('Company-list')\n", (300, 316), False, 'from django.urls import reverse\n'), ((337, 397), 'django.contrib.auth.models.User.objects.create_superuser', 'User.objects.create_superuser', (['"""root"""'], {'password': '"""<PASSWORD>"""'}), "('ro... |
#! python
import PyPDF2
pdf = open('encrypted.pdf', 'rb')
pdfRead = PyPDF2.PdfFileReader(pdf)
if pdfRead.isEncrypted:
# если зашифрован, то пароль
pdfRead.decrypt('rosebud')
for i in range(pdfRead.getNumPages()):
data = pdfRead.getPage(i)
print(data.extractText())
pdf.close()
| [
"PyPDF2.PdfFileReader"
] | [((75, 100), 'PyPDF2.PdfFileReader', 'PyPDF2.PdfFileReader', (['pdf'], {}), '(pdf)\n', (95, 100), False, 'import PyPDF2\n')] |
from dipy.denoise.nlmeans import nlmeans_3d, nlmeans
from dipy.denoise.noise_estimate import estimate_sigma
import cv2 as cv
import numpy as np
import nibabel as nib
def preprocess(nifti, name):
"""Preprocess the 3D MRI image before image segmentation"""
image = nifti.get_fdata()
sigma = estimate_sigma(im... | [
"dipy.denoise.noise_estimate.estimate_sigma",
"dipy.denoise.nlmeans.nlmeans",
"nibabel.save",
"nibabel.load",
"cv2.kmeans",
"numpy.argmax",
"nibabel.Nifti1Image"
] | [((303, 330), 'dipy.denoise.noise_estimate.estimate_sigma', 'estimate_sigma', (['image'], {'N': '(16)'}), '(image, N=16)\n', (317, 330), False, 'from dipy.denoise.noise_estimate import estimate_sigma\n'), ((403, 424), 'dipy.denoise.nlmeans.nlmeans', 'nlmeans', (['image', 'sigma'], {}), '(image, sigma)\n', (410, 424), F... |
from conans import ConanFile, CMake, tools
class PionConan(ConanFile):
name = "pion"
version = "5.0.7+12"
license = "Boost Software License 1.0 - https://raw.githubusercontent.com/splunk/pion/develop/COPYING"
description = "C++ framework for building lightweight HTTP interfaces"
url = "https://git... | [
"conans.tools.collect_libs",
"conans.CMake"
] | [((1375, 1409), 'conans.CMake', 'CMake', (['self'], {'build_type': 'build_type'}), '(self, build_type=build_type)\n', (1380, 1409), False, 'from conans import ConanFile, CMake, tools\n'), ((2511, 2535), 'conans.tools.collect_libs', 'tools.collect_libs', (['self'], {}), '(self)\n', (2529, 2535), False, 'from conans impo... |
from sqlalchemy.inspection import inspect
from . import db
class CRUDMixin(object):
"""Implements methods to create, read, update, and delete."""
@classmethod
def create(cls, commit=True, **kwargs):
instance = cls(**kwargs)
return instance.save(commit=commit)
@classmethod
def ge... | [
"sqlalchemy.inspection.inspect"
] | [((1682, 1705), 'sqlalchemy.inspection.inspect', 'inspect', (['self.__class__'], {}), '(self.__class__)\n', (1689, 1705), False, 'from sqlalchemy.inspection import inspect\n')] |
import bpy
import os
import sys
import argparse
## Example call from commandline: blender -b -P decimate_mesh_blender.py -- -f mesh.obj -o mesh_dec.obj -r 0.5 -i 2 -n 4 -l 0.5
## Blender will ignore all options after -- so parameters can be passed to python script.
# get the args passed to blender after "--", all of ... | [
"bpy.ops.object.delete",
"bpy.ops.export_scene.obj",
"argparse.ArgumentParser",
"bpy.ops.import_scene.obj",
"os.path.abspath"
] | [((545, 565), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (560, 565), False, 'import os\n'), ((594, 709), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Mesh Decimation"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Mesh Decimat... |
#!/usr/bin/python
from Solution import Solution
obj = Solution()
A = 1
B = 9
print(obj.numberOfPatterns(A, B)) | [
"Solution.Solution"
] | [((55, 65), 'Solution.Solution', 'Solution', ([], {}), '()\n', (63, 65), False, 'from Solution import Solution\n')] |
"""Miscellaneous inspection tools
"""
from tempfile import NamedTemporaryFile
def disassemble_elf_to_cfg(elf):
"""
Gets the CFG of the disassembly of an ELF object, elf, and renders it
appropriately depending on the execution environment (terminal/notebook).
"""
try:
import r2pipe
exce... | [
"r2pipe.open",
"graphviz.Source",
"tempfile.NamedTemporaryFile"
] | [((524, 556), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', ([], {'delete': '(False)'}), '(delete=False)\n', (542, 556), False, 'from tempfile import NamedTemporaryFile\n'), ((2012, 2046), 'graphviz.Source', 'graphviz.Source', (['jupyter_rendering'], {}), '(jupyter_rendering)\n', (2027, 2046), False, 'import gra... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^add/$', views.add_exploit, name='crits-exploits-views-add_exploit'),
url(r'^edit/cve/$', views.edit_exploit_cve, name='crits-exploits-views-edit_exploit_cve'),
url(r'^edit/name/(?P<id_>\S+)/$', views.edit_exploit_name, name='crits... | [
"django.conf.urls.url"
] | [((75, 148), 'django.conf.urls.url', 'url', (['"""^add/$"""', 'views.add_exploit'], {'name': '"""crits-exploits-views-add_exploit"""'}), "('^add/$', views.add_exploit, name='crits-exploits-views-add_exploit')\n", (78, 148), False, 'from django.conf.urls import url\n'), ((155, 248), 'django.conf.urls.url', 'url', (['"""... |
"""Grades Model
"""
from django.core.exceptions import ValidationError
from django.db import models
from cs28.models import Student
from ..convert_to_ttpt import to_ttpt
class Grade(models.Model):
courseCode = models.CharField("Course Code",
max_length=30)
matricNo = models... | [
"django.db.models.UniqueConstraint",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.core.exceptions.ValidationError",
"django.db.models.CharField"
] | [((217, 263), 'django.db.models.CharField', 'models.CharField', (['"""Course Code"""'], {'max_length': '(30)'}), "('Course Code', max_length=30)\n", (233, 263), False, 'from django.db import models\n'), ((314, 388), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Student'], {'on_delete': 'models.CASCADE', 'db_co... |
"""
Installs Arch-Linux when called from a live-iso
"""
import argparse
from pyscripts import s000_detect_hardware as hardware
from pyscripts import s00_user_input as user_input
from pyscripts import s01_partitions as partitions
from pyscripts import s02_basic_arch as basic_arch
from pyscripts import s03_package_m... | [
"pyscripts.s07_fstab.generate_fstab",
"pyscripts.s10_desktop.configure_desktop",
"pyscripts.utilities.fake_install_user",
"pyscripts.s04_packages.install_packages",
"pyscripts.s000_detect_hardware.get_gpu_vendor",
"pyscripts.s000_detect_hardware.get_cpu_vendor_id",
"pyscripts.s02_basic_arch.install_basi... | [((1035, 1060), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1058, 1060), False, 'import argparse\n'), ((1446, 1474), 'pyscripts.s000_detect_hardware.get_cpu_vendor_id', 'hardware.get_cpu_vendor_id', ([], {}), '()\n', (1472, 1474), True, 'from pyscripts import s000_detect_hardware as hardwar... |
"""
@author: <NAME>
@contact: <EMAIL>
"""
import random
import copy
import numpy as np
from torch.utils.data.dataset import ConcatDataset
from torch.utils.data.sampler import Sampler
class DefaultSampler(Sampler):
r"""Traverse all :math:`N` domains, randomly select :math:`K` samples in each domain to form a mini-... | [
"numpy.random.choice",
"random.sample",
"copy.deepcopy"
] | [((1183, 1226), 'copy.deepcopy', 'copy.deepcopy', (['self.sample_idxes_per_domain'], {}), '(self.sample_idxes_per_domain)\n', (1196, 1226), False, 'import copy\n'), ((3199, 3242), 'copy.deepcopy', 'copy.deepcopy', (['self.sample_idxes_per_domain'], {}), '(self.sample_idxes_per_domain)\n', (3212, 3242), False, 'import c... |
from flask import Blueprint, render_template
from ..logic.crud import get_all_targets
pages = Blueprint('web', __name__, template_folder='../templates')
@pages.route('/targets/', methods=['GET'])
def get_web_targets():
targets = get_all_targets()
return render_template('targets.html', targets=targets)
| [
"flask.render_template",
"flask.Blueprint"
] | [((96, 154), 'flask.Blueprint', 'Blueprint', (['"""web"""', '__name__'], {'template_folder': '"""../templates"""'}), "('web', __name__, template_folder='../templates')\n", (105, 154), False, 'from flask import Blueprint, render_template\n'), ((266, 314), 'flask.render_template', 'render_template', (['"""targets.html"""... |
#!/usr/bin/env python
import argparse
import logging
import json
import re
from collections import defaultdict
from ensembl.rest_client import RestClient
from ensembl.server_utils import assert_mysql_uri, assert_mysql_db_uri
class DatacheckClient(RestClient):
"""Client for checking databases using the datacheck s... | [
"logging.basicConfig",
"argparse.FileType",
"argparse.ArgumentParser",
"re.compile",
"json.dumps",
"ensembl.server_utils.assert_mysql_uri",
"ensembl.rest_client.RestClient.submit_job",
"logging.info"
] | [((5963, 6035), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run datachecks via a REST service"""'}), "(description='Run datachecks via a REST service')\n", (5986, 6035), False, 'import argparse\n'), ((1433, 1461), 'ensembl.server_utils.assert_mysql_uri', 'assert_mysql_uri', (['server_... |
import requests
import json
from .osvc_python_file_handling import OSvCPythonFileHandler
from .osvc_python_config import OSvCPythonConfig
from .osvc_python_validations import OSvCPythonValidations
from .osvc_python_examples import CLIENT_NOT_DEFINED,CLIENT_NO_INTERFACE_SET_EXAMPLE,CLIENT_NO_USERNAME_SET_EXAMPLE,CLIENT_... | [
"requests.request"
] | [((1855, 1909), 'requests.request', 'requests.request', (["kwargs['verb']"], {}), "(kwargs['verb'], **final_request_data)\n", (1871, 1909), False, 'import requests\n')] |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the 'License'); you may not use th... | [
"st2common.util.date.get_datetime_utc_now",
"json.dumps",
"st2common.services.access.delete_token",
"st2common.triggers.InternalTriggerTypesRegistrar",
"st2tests.config.parse_args"
] | [((1138, 1163), 'st2tests.config.parse_args', 'tests_config.parse_args', ([], {}), '()\n', (1161, 1163), True, 'from st2tests import config as tests_config\n'), ((1358, 1391), 'st2common.util.date.get_datetime_utc_now', 'date_utils.get_datetime_utc_now', ([], {}), '()\n', (1389, 1391), True, 'from st2common.util import... |
import os
def touch_dir(wanted_dir):
not_exist_collection = []
while os.path.exists(wanted_dir) is not True and wanted_dir != '':
wanted_dir, step = os.path.split(wanted_dir)
not_exist_collection.append(step)
pass
while len(not_exist_collection) != 0:
step = not_exist_coll... | [
"os.path.exists",
"os.path.join",
"os.mkdir",
"os.path.split"
] | [((167, 192), 'os.path.split', 'os.path.split', (['wanted_dir'], {}), '(wanted_dir)\n', (180, 192), False, 'import os\n'), ((354, 384), 'os.path.join', 'os.path.join', (['wanted_dir', 'step'], {}), '(wanted_dir, step)\n', (366, 384), False, 'import os\n'), ((393, 413), 'os.mkdir', 'os.mkdir', (['wanted_dir'], {}), '(wa... |
"""
Module contains all functions working on users page.
Functions:
users_page()
edit_user(id)
delete_user(id)
check_session()
"""
import os
import sys
import urllib.parse
from flask_login import login_user, login_required
from flask import render_template, request, redirect, Blueprint, session
sys.pa... | [
"flask.render_template",
"models.users.User.query.get",
"flask.session.get",
"flask_login.login_user",
"os.path.join",
"flask.request.form.get",
"flask.redirect",
"flask.Blueprint",
"models.users.User.query.all"
] | [((479, 511), 'flask.Blueprint', 'Blueprint', (['"""api_users"""', '__name__'], {}), "('api_users', __name__)\n", (488, 511), False, 'from flask import render_template, request, redirect, Blueprint, session\n'), ((407, 424), 'models.users.User.query.get', 'User.query.get', (['(1)'], {}), '(1)\n', (421, 424), False, 'fr... |
# Generated by Django 3.0.8 on 2020-11-23 11:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('account', '0003_confirmstring'),
]
operations = [
migrations.CreateModel(
n... | [
"django.db.models.FloatField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((381, 474), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (397, 474), False, 'from django.db import migrations, models\... |
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/Contract
Release: STU3
Version: 3.0.2
Revision: 11917
Last updated: 2019-10-24T11:53:00+11:00
"""
import io
import json
import os
import unittest
import pytest
from .. import contract
from ..fhirdate import FHIRDate
from .fixtures import fo... | [
"json.load",
"os.environ.get",
"pytest.mark.usefixtures",
"os.path.join"
] | [((333, 373), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""base_settings"""'], {}), "('base_settings')\n", (356, 373), False, 'import pytest\n'), ((474, 513), 'os.environ.get', 'os.environ.get', (['"""FHIR_UNITTEST_DATADIR"""'], {}), "('FHIR_UNITTEST_DATADIR')\n", (488, 513), False, 'import os\n'), ((625... |
from django.contrib import admin
from django.urls import path
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.autodiscover()
# See: https://docs.djangoproject.com/en/dev/topics/http/urls/
urlpatterns = [
path('admin/', admin.site.urls),
]
| [
"django.urls.path",
"django.contrib.admin.autodiscover"
] | [((174, 194), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (192, 194), False, 'from django.contrib import admin\n'), ((280, 311), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (284, 311), False, 'from django.urls import path\n')] |
from stuff import *
# Get weekday pattern from case data in order to identify exact date on SGTF graph
# 0 mod 7 is Thursday in daytodate notation (being 1970-01-01)
nc={}
with open('SAcases','r') as fp:
for x in fp:
y=x.split()
nc[datetoday(y[0])]=int(y[1])
minday=min(nc)
maxday=max(nc)
c0=[0]*7
c1=[0]*7
f... | [
"numpy.dtype",
"PIL.Image.fromarray",
"PIL.Image.open",
"numpy.roll",
"numpy.argmax",
"numpy.array",
"numpy.zeros",
"numpy.concatenate",
"numpy.maximum",
"numpy.arange"
] | [((1195, 1213), 'PIL.Image.open', 'Image.open', (['infile'], {}), '(infile)\n', (1205, 1213), False, 'from PIL import Image\n'), ((1219, 1248), 'numpy.array', 'np.array', (['im_frame'], {'dtype': 'int'}), '(im_frame, dtype=int)\n', (1227, 1248), True, 'import numpy as np\n'), ((2239, 2302), 'numpy.concatenate', 'np.con... |
# -*- coding: utf-8 -*-
"""
Path handling
"""
import pathlib
from pathlib import Path
import simplejson as json
customdir = Path.home() / ".komoog"
def _prepare():
customdir.mkdir(exist_ok=True)
cred_file = customdir / "komoot.json"
if not cred_file.exists():
data = {
"email"... | [
"simplejson.load",
"pathlib.Path.home",
"simplejson.dump"
] | [((126, 137), 'pathlib.Path.home', 'Path.home', ([], {}), '()\n', (135, 137), False, 'from pathlib import Path\n'), ((884, 896), 'simplejson.load', 'json.load', (['f'], {}), '(f)\n', (893, 896), True, 'import simplejson as json\n'), ((483, 501), 'simplejson.dump', 'json.dump', (['data', 'f'], {}), '(data, f)\n', (492, ... |
"""
Test.py 10/10/2021
MIT License
Copyright (c) 2021 http-samc
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... | [
"Py2048_Engine.Game.Game"
] | [((1353, 1359), 'Py2048_Engine.Game.Game', 'Game', ([], {}), '()\n', (1357, 1359), False, 'from Py2048_Engine.Game import Game\n')] |
from megastone.util import round_up
import threading
import logging
import io
import enum
import dataclasses
import abc
from megastone.errors import UnsupportedError
from megastone.mem import SegmentMemory, MemoryAccessError
from megastone.debug import Debugger, StopReason, StopType, HookType, CPUError, InvalidInsnErr... | [
"logging.getLogger",
"enum.auto",
"megastone.errors.UnsupportedError",
"io.BytesIO",
"threading.Event"
] | [((579, 606), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (596, 606), False, 'import logging\n'), ((1018, 1029), 'enum.auto', 'enum.auto', ([], {}), '()\n', (1027, 1029), False, 'import enum\n'), ((1043, 1054), 'enum.auto', 'enum.auto', ([], {}), '()\n', (1052, 1054), False, 'import en... |
#!/usr/bin/python
from mininet.topo import Topo
from mininet.cli import CLI
from mininet.net import Mininet
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
from mininet.node import RemoteController
# Traffic Control
from mininet.link import TCLink
REMOTE_CONTROLLER_IP = "172.21.22.... | [
"mininet.topo.Topo.__init__",
"mininet.util.dumpNodeConnections",
"mininet.cli.CLI",
"mininet.log.setLogLevel",
"mininet.net.Mininet"
] | [((426, 493), 'mininet.net.Mininet', 'Mininet', ([], {'topo': 'topo', 'controller': 'RemoteController', 'autoStaticArp': '(True)'}), '(topo=topo, controller=RemoteController, autoStaticArp=True)\n', (433, 493), False, 'from mininet.net import Mininet\n'), ((668, 698), 'mininet.util.dumpNodeConnections', 'dumpNodeConnec... |
from datetime import tzinfo, timedelta, datetime
from dateutil.zoneinfo import getzoneinfofile_stream, ZoneInfoFile
class GeneralTZ(tzinfo):
"""
General timezone with hour offset.
"""
def __init__(self, hour_offset):
self.hour_offset = hour_offset
def __repr__(self):
return "<TZ{0... | [
"datetime.datetime.utcfromtimestamp",
"dateutil.zoneinfo.getzoneinfofile_stream",
"datetime.datetime.utcnow",
"datetime.datetime.now",
"datetime.timedelta"
] | [((2203, 2239), 'datetime.datetime.utcfromtimestamp', 'datetime.utcfromtimestamp', (['timestamp'], {}), '(timestamp)\n', (2228, 2239), False, 'from datetime import tzinfo, timedelta, datetime\n'), ((394, 427), 'datetime.timedelta', 'timedelta', ([], {'hours': 'self.hour_offset'}), '(hours=self.hour_offset)\n', (403, 42... |
import sys
from os.path import dirname
sys.path.append(dirname("../src/"))
from src.PhaseIdentification.common import *
from src.VisualizePhaseIdentification.visualization import *
from src.PhaseIdentification.voltageBasedPhaseIdentification import *
from src.PhaseIdentification.powerBasedPhaseIdentification import *
... | [
"os.path.dirname"
] | [((55, 73), 'os.path.dirname', 'dirname', (['"""../src/"""'], {}), "('../src/')\n", (62, 73), False, 'from os.path import dirname\n')] |
################################################################################
# @file ReversiPlayTest.py
# @brief リバーシプレイテストクラス実装ファイル
# @author <NAME>
# @date 2018.11.13
# $Version: $
# $Revision: $
#
# (c) 2018 <NAME>.
#
# - 本ソフトウェアの一部又は全てを無断で複写複製(コピー)することは、
# 著作権侵害にあたりますので、これを禁止します。
# - 本製品... | [
"model.ReversiPlay.ReversiPlay",
"model.Reversi.Reversi",
"model.ReversiSetting.ReversiSetting"
] | [((1176, 1201), 'model.ReversiPlay.ReversiPlay', 'ReversiPlay.ReversiPlay', ([], {}), '()\n', (1199, 1201), False, 'from model import ReversiPlay\n'), ((3809, 3924), 'model.Reversi.Reversi', 'Reversi.Reversi', (['ReversiConst.ReversiConst.DEF_MASU_CNT_MAX_VAL', 'ReversiConst.ReversiConst.DEF_MASU_CNT_MAX_VAL'], {}), '(... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWin... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QSpinBox",
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QGridLayout",
"pyqtgraph.GraphicsLayoutWidget",
"PyQt5.QtWidgets.QCheckBox",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtCore.QSize"
] | [((569, 598), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (586, 598), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((683, 724), 'PyQt5.QtWidgets.QGridLayout', 'QtWidgets.QGridLayout', (['self.centralwidget'], {}), '(self.centralwidget)\n', (704, 724), False, 'from ... |
"""
Prevent the system from shutting down if you have
no admin control and need it to run for many hours
"""
import pyautogui
import time
import sys
from datetime import datetime
# quickly move the mouse to the upper left corner to exit
pyautogui.FAILSAFE=True
numMin = 3
run = True
while(run == True):
x=0
... | [
"datetime.datetime.now",
"pyautogui.press",
"time.sleep"
] | [((710, 739), 'pyautogui.press', 'pyautogui.press', (['"""volumedown"""'], {}), "('volumedown')\n", (725, 739), False, 'import pyautogui\n'), ((744, 757), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (754, 757), False, 'import time\n'), ((762, 789), 'pyautogui.press', 'pyautogui.press', (['"""volumeup"""'], {}),... |
import json
import random
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Column, Integer, String, MetaData, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import select
import monitor_db
import monitor_logger
import monitor_util
Base = declar... | [
"monitor_db.get_connection_session",
"json.loads",
"monitor_logger.get_logger",
"monitor_db.get_connection_with_url",
"sqlalchemy.sql.select",
"flask.Flask",
"sqlalchemy.MetaData",
"sqlalchemy.String",
"sqlalchemy.ext.declarative.declarative_base",
"flask_sqlalchemy.SQLAlchemy",
"random.random",... | [((314, 332), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (330, 332), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((428, 443), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (433, 443), False, 'from flask import Flask\n'), ((545, 560), 'flas... |
# author: badf00d21
import os
from os.path import dirname, join
from textx import metamodel_from_file
from textx.export import metamodel_export, model_export
from datetime import datetime
from distutils.dir_util import copy_tree
CURRENT_DIR = dirname(__file__)
PROJECT_DIRECTORY_TREE = {}
PROJECT_GENERAL_INFO = {}
def... | [
"os.path.exists",
"distutils.dir_util.copy_tree",
"os.makedirs",
"os.path.join",
"textx.metamodel_from_file",
"os.path.dirname",
"datetime.datetime.now",
"os.mkdir"
] | [((244, 261), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (251, 261), False, 'from os.path import dirname, join\n'), ((1157, 1204), 'os.path.join', 'join', (['output_path', "PROJECT_GENERAL_INFO['name']"], {}), "(output_path, PROJECT_GENERAL_INFO['name'])\n", (1161, 1204), False, 'from os.path imp... |
from dataclasses import dataclass, field
from typing import Optional
__NAMESPACE__ = "http://www.opengis.net/ogc"
@dataclass
class FunctionNameType:
value: str = field(
default="",
metadata={
"required": True,
},
)
n_args: Optional[str] = field(
default=None,
... | [
"dataclasses.field"
] | [((169, 215), 'dataclasses.field', 'field', ([], {'default': '""""""', 'metadata': "{'required': True}"}), "(default='', metadata={'required': True})\n", (174, 215), False, 'from dataclasses import dataclass, field\n'), ((290, 380), 'dataclasses.field', 'field', ([], {'default': 'None', 'metadata': "{'name': 'nArgs', '... |
# coding: utf-8
"""
Selling Partner API for Pricing
The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products. # noqa: E501
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-codegen.g... | [
"six.iteritems"
] | [((7458, 7491), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (7471, 7491), False, 'import six\n')] |
import numpy as np
from sklearn import multioutput
import xgboost as xgb
class Regressor():
def _init_(self):
super()._init_()
self.model = None
def fit(self, X, y):
# Create empty model made
self.model_bag = dict()
# Data bag
self.data_bag = di... | [
"xgboost.XGBRegressor",
"numpy.asarray"
] | [((4365, 4382), 'numpy.asarray', 'np.asarray', (['preds'], {}), '(preds)\n', (4375, 4382), True, 'import numpy as np\n'), ((1460, 1502), 'numpy.asarray', 'np.asarray', (['self.data_bag[1][metadata_str]'], {}), '(self.data_bag[1][metadata_str])\n', (1470, 1502), True, 'import numpy as np\n'), ((2103, 2135), 'numpy.asarr... |
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import TypeVar
from typing import Iterable
T = TypeVar("T")
import os
BASE_PATH = os.path.dirname(__file__)
INPUT_PATH = os.path.join(BASE_PATH, "input.txt")
def median(iterable: Iterable[T]) -> T:
re... | [
"os.path.dirname",
"os.path.join",
"os.path.basename",
"typing.TypeVar"
] | [((196, 221), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (211, 221), False, 'import os\n'), ((235, 271), 'os.path.join', 'os.path.join', (['BASE_PATH', '"""input.txt"""'], {}), "(BASE_PATH, 'input.txt')\n", (247, 271), False, 'import os\n'), ((158, 170), 'typing.TypeVar', 'TypeVar', (['""... |
import pygame
import os
pygame.init()
SCREEN_WIDTH = 800
SCREEN_HEIGHT = int(SCREEN_WIDTH * 0.8)
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('Shooter')
#set framerate
clock = pygame.time.Clock()
FPS = 60
#define game variables
GRAVITY = 0.75
#define player action va... | [
"pygame.transform.flip",
"pygame.display.set_caption",
"os.listdir",
"pygame.init",
"pygame.quit",
"pygame.draw.line",
"pygame.event.get",
"pygame.sprite.Group",
"pygame.display.set_mode",
"pygame.sprite.Sprite.__init__",
"pygame.time.get_ticks",
"pygame.time.Clock",
"pygame.image.load",
"... | [((25, 38), 'pygame.init', 'pygame.init', ([], {}), '()\n', (36, 38), False, 'import pygame\n'), ((110, 164), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(SCREEN_WIDTH, SCREEN_HEIGHT)'], {}), '((SCREEN_WIDTH, SCREEN_HEIGHT))\n', (133, 164), False, 'import pygame\n'), ((165, 202), 'pygame.display.set_captio... |
import pytest
from app.api.business import brief_overview_business
@pytest.fixture()
def publish_links():
return [
'How long your brief will be open',
'Description of work',
'Location',
'Review and publish your requirements',
'Question and answer session details',
... | [
"pytest.fixture",
"app.api.business.brief_overview_business.get_publish_links"
] | [((71, 87), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (85, 87), False, 'import pytest\n'), ((535, 594), 'app.api.business.brief_overview_business.get_publish_links', 'brief_overview_business.get_publish_links', (['specialist_brief'], {}), '(specialist_brief)\n', (576, 594), False, 'from app.api.business imp... |
import os
import cv2
import gc
import random
import time
from tqdm import tqdm
import numpy as np
import matplotlib.pyplot as plt
import argparse
from glob import glob
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from PIL import Image, ImageFilter
from models.OEFT import OEFT
parse... | [
"models.OEFT.OEFT",
"torchvision.transforms.ToPILImage",
"numpy.array",
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"torch.unsqueeze",
"numpy.stack",
"os.path.isdir",
"numpy.random.seed",
"torchvision.transforms.ToTensor",
"gc.collect",
"torchvision.transforms.Normalize",
"t... | [((324, 379), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Code to optimize"""'}), "(description='Code to optimize')\n", (347, 379), False, 'import argparse\n'), ((4596, 4612), 'os.listdir', 'os.listdir', (['"""./"""'], {}), "('./')\n", (4606, 4612), False, 'import os\n'), ((4238, 4269... |
import tensorflow as tf
import numpy as np
import random
import time
from math import exp
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.layers import Merge
from keras.optimizers import RMSprop, Adam
start_time = time.time()
class UAV_fire_extinguish(object):
... | [
"keras.optimizers.Adam",
"keras.layers.Merge",
"keras.layers.core.Activation",
"numpy.random.random",
"numpy.argmax",
"keras.models.Sequential",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.random.randint",
"random.random",
"time.time",
"random.randint",
"keras.layers.core.Dense"
] | [((271, 282), 'time.time', 'time.time', ([], {}), '()\n', (280, 282), False, 'import time\n'), ((16855, 16867), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (16865, 16867), False, 'from keras.models import Sequential\n'), ((17025, 17037), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (17035, ... |
from django import forms
class ArticleRecommendForm(forms.Form):
"""Formulario para recomendar articulo."""
name = forms.CharField(
label='Nombre'
)
from_email = forms.EmailField(
label='Tu email',
widget=forms.EmailInput()
)
to_email = forms.EmailField(
label='... | [
"django.forms.Textarea",
"django.forms.EmailInput",
"django.forms.CharField"
] | [((125, 156), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Nombre"""'}), "(label='Nombre')\n", (140, 156), False, 'from django import forms\n'), ((247, 265), 'django.forms.EmailInput', 'forms.EmailInput', ([], {}), '()\n', (263, 265), False, 'from django import forms\n'), ((356, 374), 'django.forms.E... |
from time import sleep
print('\033[1:31m-=-\033[m' * 6)
print('\033[1m FATORIAL \033[m')
print('\033[1:31m-=-\033[m' * 6)
sleep(1)
numero = int(input('\033[1:33mDigite um número: \033[m'))
c = numero - 1
fatorial = numero
while c > 0:
fatorial = fatorial * c
c = c - 1
sleep(1)
print('O fatorial de {}... | [
"time.sleep"
] | [((129, 137), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (134, 137), False, 'from time import sleep\n'), ((288, 296), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (293, 296), False, 'from time import sleep\n'), ((344, 352), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (349, 352), False, 'from time import sleep\... |
#!/usr/bin/python
import math
import sys
#bValue = float(sys.argv[1])
#nomOhm = float(sys.argv[2])
#nomTemp = float(sys.argv[3])
#seriesR = float(sys.argv[4])
#adcRes = int(sys.argv[5])
bValue = 3750
nomOhm = 10000
nomTemp = 250
seriesR = 4700
adcRes = 10
adcMax = 2**adcRes
adcVal = 0
vals = [0] * adcMax
while ad... | [
"math.log"
] | [((374, 430), 'math.log', 'math.log', (['(seriesR / ((adcMax - 1) / adcVal - 1) / nomOhm)'], {}), '(seriesR / ((adcMax - 1) / adcVal - 1) / nomOhm)\n', (382, 430), False, 'import math\n')] |
# Copyright 2018 DeepMind Technologies Limited.
#
# 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 ag... | [
"sympy.factorial",
"six.itervalues",
"six.add_metaclass",
"itertools.product",
"six.iteritems",
"six.iterkeys",
"six.moves.zip",
"sympy.Rational"
] | [((1666, 1696), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (1683, 1696), False, 'import six\n'), ((1769, 1799), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (1786, 1799), False, 'import six\n'), ((1977, 2007), 'six.add_metaclass', 'six.add_... |
###############################################################################
# Copyright (c) 2007-2018, National Research Foundation (Square Kilometre Array)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the ... | [
"scikits.fitting.LinearLeastSquaresFit",
"numpy.vander",
"scikits.fitting.NonLinearLeastSquaresFit",
"numpy.ix_",
"numpy.array",
"numpy.zeros",
"numpy.testing.assert_almost_equal",
"numpy.dot",
"numpy.testing.run_module_suite",
"numpy.random.randn",
"numpy.arange"
] | [((5252, 5270), 'numpy.testing.run_module_suite', 'run_module_suite', ([], {}), '()\n', (5268, 5270), False, 'from numpy.testing import TestCase, assert_almost_equal, run_module_suite\n'), ((1392, 1409), 'numpy.array', 'np.array', (['[1, -4]'], {}), '([1, -4])\n', (1400, 1409), True, 'import numpy as np\n'), ((1437, 14... |
# Generated by Django 2.0.7 on 2018-09-19 18:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('hivs_administrative', '0005_set_extras_default_value_to_callable'),
]
operations = [
migrations.CreateModel... | [
"django.db.models.OneToOneField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((1460, 1626), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'related_name': '"""areas"""', 'to': '"""hivs_administrative.AreaType"""', 'verbose_name': '"""area type"""'}), "(null=True, on_delete=django.db.models.deletion.SET_NULL,\n r... |
from pygears import gear, datagear, alternative, module
from pygears.typing.qround import get_out_type, get_cut_bits
from pygears.typing import Uint, code, Bool, Int, Fixp, Ufixp
@datagear
def qround(din,
*,
fract=0,
cut_bits=b'get_cut_bits(din, fract)',
signed=b'din.signed... | [
"pygears.typing.Bool",
"pygears.module",
"pygears.typing.code"
] | [((366, 400), 'pygears.typing.code', 'code', (['din', '(Int if signed else Uint)'], {}), '(din, Int if signed else Uint)\n', (370, 400), False, 'from pygears.typing import Uint, code, Bool, Int, Fixp, Ufixp\n'), ((404, 411), 'pygears.typing.Bool', 'Bool', (['(1)'], {}), '(1)\n', (408, 411), False, 'from pygears.typing ... |
"""Main module."""
__authors__ = '<NAME>, <NAME>'
__version__ = '1.0'
__date__ = '9/10/2017'
import json
import os.path
import pickle
import random
import urllib
from bs4 import BeautifulSoup
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extracti... | [
"numpy.convolve",
"numpy.polyfit",
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.poly1d",
"textblob.TextBlob",
"numpy.mean",
"nltk.corpus.stopwords.words",
"sklearn.feature_extraction.text.CountVectorizer",
"matplotlib.pyplot.xlabel",
"numpy.max",
"sklearn.naive_bayes.MultinomialNB",
"ma... | [((4568, 4670), 'sklearn.feature_extraction.text.CountVectorizer', 'CountVectorizer', ([], {'lowercase': '(True)', 'strip_accents': '"""ascii"""', 'stop_words': 'stopset', 'decode_error': '"""replace"""'}), "(lowercase=True, strip_accents='ascii', stop_words=stopset,\n decode_error='replace')\n", (4583, 4670), False... |
# -*- coding: utf-8 -*-
# Copyright (c) 2022, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class SalesInvoice(Document):
def validate (self):
if(self.posting_date > self.due_date):
frapp... | [
"frappe.throw",
"frappe.db.commit",
"frappe.new_doc"
] | [((441, 479), 'frappe.new_doc', 'frappe.new_doc', (['"""General Ledger Entry"""'], {}), "('General Ledger Entry')\n", (455, 479), False, 'import frappe\n'), ((700, 718), 'frappe.db.commit', 'frappe.db.commit', ([], {}), '()\n', (716, 718), False, 'import frappe\n'), ((743, 781), 'frappe.new_doc', 'frappe.new_doc', (['"... |
from datetime import datetime
from email.message import EmailMessage
from email.headerregistry import Address
from jinja2 import Markup
from premailer import transform
import smtplib
from kpireport.output import OutputDriver
class SMTPOutputDriver(OutputDriver):
"""Email a report's contents via SMTP to one or m... | [
"smtplib.SMTP",
"email.headerregistry.Address",
"datetime.datetime.now",
"jinja2.Markup",
"email.message.EmailMessage"
] | [((3012, 3053), 'email.headerregistry.Address', 'Address', ([], {'username': 'username', 'domain': 'domain'}), '(username=username, domain=domain)\n', (3019, 3053), False, 'from email.headerregistry import Address\n'), ((3555, 3569), 'email.message.EmailMessage', 'EmailMessage', ([], {}), '()\n', (3567, 3569), False, '... |
from tortoise import Tortoise
from tortoise.contrib import test
from tortoise.exceptions import ConfigurationError
from tortoise.tests.testmodels import Tournament
class TestInitErrors(test.SimpleTestCase):
async def setUp(self):
self.apps = Tortoise.apps
self.inited = Tortoise._inited
Tor... | [
"tortoise.Tortoise.register_model",
"tortoise.Tortoise._client_routing",
"tortoise.Tortoise.init"
] | [((770, 829), 'tortoise.Tortoise.register_model', 'Tortoise.register_model', (['"""models"""', '"""Tournament"""', 'Tournament'], {}), "('models', 'Tournament', Tournament)\n", (793, 829), False, 'from tortoise import Tortoise\n'), ((842, 901), 'tortoise.Tortoise.register_model', 'Tortoise.register_model', (['"""models... |
import torch
import argparse
import os
import glob
from torch.utils.data import DataLoader, SequentialSampler
from tqdm import tqdm
from nsmc_modeling import RobertaForSequenceClassification
from bert.tokenizer import Tokenizer
from dataset import NSMCDataSet
def _get_parser():
parser = argparse.ArgumentParser(... | [
"argparse.ArgumentParser",
"tqdm.tqdm",
"torch.utils.data.SequentialSampler",
"os.path.join",
"nsmc_modeling.RobertaForSequenceClassification",
"torch.tensor",
"dataset.NSMCDataSet",
"torch.utils.data.DataLoader",
"torch.no_grad",
"glob.glob",
"torch.device"
] | [((296, 321), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (319, 321), False, 'import argparse\n'), ((966, 1032), 'dataset.NSMCDataSet', 'NSMCDataSet', (['"""test"""', 'tokenizer'], {'max_seq_length': 'args.max_seq_length'}), "('test', tokenizer, max_seq_length=args.max_seq_length)\n", (977, ... |
import numpy as np
from numpy.testing import assert_allclose
import pytest
from mne._ola import _COLA, _Interp2, _Storer
def test_interp_2pt():
"""Test our two-point interpolator."""
n_pts = 200
assert n_pts % 50 == 0
feeds = [ # test a bunch of feeds to make sure they don't break things
[n_... | [
"numpy.hanning",
"mne._ola._COLA",
"numpy.arange",
"numpy.testing.assert_allclose",
"mne._ola._Interp2",
"pytest.mark.parametrize",
"numpy.array",
"numpy.linspace",
"mne._ola._Storer",
"numpy.concatenate",
"numpy.full",
"numpy.random.RandomState"
] | [((2880, 2922), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ndim"""', '(1, 2, 3)'], {}), "('ndim', (1, 2, 3))\n", (2903, 2922), False, 'import pytest\n'), ((493, 512), 'numpy.array', 'np.array', (['[10, -10]'], {}), '([10, -10])\n', (501, 512), True, 'import numpy as np\n'), ((528, 546), 'numpy.full', '... |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | [
"tinctest.logger.info",
"gppylib.db.dbconn.execSQL",
"gppylib.db.dbconn.DbURL",
"mpp.gpdb.tests.storage.lib.dbstate.DbStateClass"
] | [((1008, 1055), 'tinctest.logger.info', 'tinctest.logger.info', (['"""Running Verification..."""'], {}), "('Running Verification...')\n", (1028, 1055), False, 'import tinctest\n'), ((2096, 2151), 'tinctest.logger.info', 'tinctest.logger.info', (['"""No PANIC messages found in logs"""'], {}), "('No PANIC messages found ... |
# encoding: utf-8
import pygame
from assets import constants as C
class Decor(pygame.sprite.Sprite):
def __init__(self, name, pos_tuple):
pygame.sprite.Sprite.__init__(self)
self.name = name
self.image = pygame.image.load(
self.full_path(C.IMAGES[name])
).convert()
... | [
"pygame.sprite.Sprite.__init__",
"pygame.key.get_pressed",
"pygame.key.name"
] | [((152, 187), 'pygame.sprite.Sprite.__init__', 'pygame.sprite.Sprite.__init__', (['self'], {}), '(self)\n', (181, 187), False, 'import pygame\n'), ((1399, 1423), 'pygame.key.get_pressed', 'pygame.key.get_pressed', ([], {}), '()\n', (1421, 1423), False, 'import pygame\n'), ((1590, 1616), 'pygame.key.name', 'pygame.key.n... |
import argparse
import csv
from skyfield import api
from skyfield.api import EarthSatellite
from skyfield.constants import AU_KM, AU_M
from skyfield.sgp4lib import TEME_to_ITRF
from skyfield.api import Topos, load
# Read TLE file and write key parameters in CSV format
def readTLE(tleFilename):
# Open... | [
"csv.DictWriter",
"skyfield.api.EarthSatellite",
"skyfield.api.load.timescale",
"skyfield.api.Topos",
"skyfield.api.load"
] | [((3204, 3220), 'skyfield.api.load.timescale', 'load.timescale', ([], {}), '()\n', (3218, 3220), False, 'from skyfield.api import Topos, load\n'), ((3288, 3310), 'skyfield.api.Topos', 'Topos', (['(21.0)', '(16.5)', '(100)'], {}), '(21.0, 16.5, 100)\n', (3293, 3310), False, 'from skyfield.api import Topos, load\n'), ((3... |
from django.contrib import admin
from django.urls import path, include
from Blog import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', include('home.urls'), name='home'),
path('aboutus/', include('aboutus.urls'), name='aboutus'),
path('accounts... | [
"django.conf.urls.static.static",
"django.urls.path",
"django.urls.include"
] | [((794, 855), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), '(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n', (800, 855), False, 'from django.conf.urls.static import static\n'), ((372, 403), 'django.urls.path', 'path', (['"""admin/"""', 'admin... |
#!/usr/bin/env python3
#
# aimap.py
#
# This code is part of the aimap package, and is governed by its licence.
# Please see the LICENSE file that should have been included as part of
# this package.
import json
import logging
import logging.handlers
import os
import subprocess
import pandas as pd
import gffutils
imp... | [
"logging.StreamHandler",
"sys.exc_info",
"sys.exit",
"os.path.exists",
"argparse.ArgumentParser",
"aimap.aimap_tools.construct_bwa_mem_paired_cmdline",
"os.path.split",
"aimap.aimap_tools.construct_samtools_mpileup_cmdline",
"aimap.aimap_tools.construct_bwa_mem_single_cmdline",
"aimap.aimap_tools.... | [((644, 675), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'prog': '"""aimap.py"""'}), "(prog='aimap.py')\n", (658, 675), False, 'from argparse import ArgumentParser\n'), ((3623, 3637), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (3635, 3637), False, 'import sys\n'), ((4419, 4450), 'os.path.exists', 'os.pat... |
import csv
from _tkinter import TclError
import os.path as ospath
from enum import Enum
class Errors(Enum):
SUCCESS = 'Successfully completed the action.'
FILE_NOT_FOUND = "The file, {}, couldn't be found."
FILE_MADE = "The file, {}, didn't exist and so it has been created."
FILE_CURRENTLY_OPEN = 'The ... | [
"os.path.isfile",
"csv.DictWriter",
"csv.DictReader"
] | [((2135, 2154), 'os.path.isfile', 'ospath.isfile', (['path'], {}), '(path)\n', (2148, 2154), True, 'import os.path as ospath\n'), ((2377, 2400), 'csv.DictReader', 'csv.DictReader', (['csvfile'], {}), '(csvfile)\n', (2391, 2400), False, 'import csv\n'), ((2886, 2929), 'csv.DictWriter', 'csv.DictWriter', (['csvfile'], {'... |
from collections import deque
from functools import reduce
from inspect import getmembers, isfunction, signature
from typing import Any, Iterable, List
from deepmerge import always_merger
def _constructor(self, *parts: List[Iterable[Any]]) -> None:
self._parts = parts
def _make_iterator(cls):
def _iterator... | [
"inspect.signature",
"inspect.getmembers",
"collections.deque"
] | [((620, 638), 'collections.deque', 'deque', (['self._parts'], {}), '(self._parts)\n', (625, 638), False, 'from collections import deque\n'), ((2078, 2093), 'inspect.signature', 'signature', (['func'], {}), '(func)\n', (2087, 2093), False, 'from inspect import getmembers, isfunction, signature\n'), ((2809, 2846), 'inspe... |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2020 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... | [
"click.argument",
"renku.core.errors.UsageError",
"click.secho",
"click.group",
"click.option",
"renku.core.commands.config.update_config",
"renku.core.commands.config.read_config"
] | [((3652, 3665), 'click.group', 'click.group', ([], {}), '()\n', (3663, 3665), False, 'import click\n'), ((3755, 3806), 'click.argument', 'click.argument', (['"""key"""'], {'required': '(False)', 'default': 'None'}), "('key', required=False, default=None)\n", (3769, 3806), False, 'import click\n'), ((3808, 3908), 'click... |
# -*- coding: utf-8 -*-
__author__ = 'mateusz'
__date__ = '13.11.14 / 08:59'
__git__ = 'https://github.com/mateuszdargacz'
from django.db import models
from django.utils.translation import gettext_lazy as _
class HouseType(models.Model):
name = models.CharField(_('Nazwa'), max_length=56)
description = models... | [
"django.utils.translation.gettext_lazy",
"django.db.models.CharField"
] | [((1928, 2004), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)', 'blank': '(True)', 'null': '(True)', 'choices': 'ETAP_CHOICES'}), '(max_length=20, blank=True, null=True, choices=ETAP_CHOICES)\n', (1944, 2004), False, 'from django.db import models\n'), ((269, 279), 'django.utils.translation... |
#!/bin/usr/python
#
# This class imports search results from
# DUDEN website and stores in a pickle for
# later use.
#
#############################################
import pprint, pickle
from bs4 import BeautifulSoup
import requests
import re
class Dictionary:
dict_pickle = "german_dict.pickle"
#meaning = list()
... | [
"pickle.dump",
"re.compile",
"pickle.load",
"requests.get",
"bs4.BeautifulSoup"
] | [((730, 757), 'requests.get', 'requests.get', (['self.url_word'], {}), '(self.url_word)\n', (742, 757), False, 'import requests\n'), ((768, 804), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.text', '"""html.parser"""'], {}), "(r.text, 'html.parser')\n", (781, 804), False, 'from bs4 import BeautifulSoup\n'), ((816, 852), ... |
import sys
import os
import numpy as np
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from torchvision.models.detection import FasterRCNN
from torchvision.models.detection.rpn import AnchorGenerator
import wandb
import json
from cs329s_waymo_object_detection.utils.gcp_util... | [
"wandb.log",
"torchvision.models.detection.rpn.AnchorGenerator",
"torchvision.models.detection.faster_rcnn.FastRCNNPredictor",
"torchvision.models.detection.fasterrcnn_resnet50_fpn",
"cs329s_waymo_object_detection.utils.gcp_utils.upload_blob",
"torchvision.models.mobilenet_v2",
"json.load",
"torchvisi... | [((466, 535), 'torchvision.models.detection.fasterrcnn_resnet50_fpn', 'torchvision.models.detection.fasterrcnn_resnet50_fpn', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (518, 535), False, 'import torchvision\n'), ((642, 685), 'torchvision.models.detection.faster_rcnn.FastRCNNPredictor', 'FastRCNNPredictor',... |
import re
import subprocess
import getpass
# for testing purposes only.
EDITOR="gedit"
class Project:
"""
Used to model Project objects.
Attributes
-----------
project_path : Path
Used to indicate the path of the project folder.
number : int
Project number.
py_paths : li... | [
"getpass.getuser",
"re.findall",
"re.search"
] | [((7043, 7060), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (7058, 7060), False, 'import getpass\n'), ((1357, 1386), 're.search', 're.search', (['pattern', 'path.name'], {}), '(pattern, path.name)\n', (1366, 1386), False, 'import re\n'), ((4332, 4361), 're.findall', 're.findall', (['"""_+\\\\d+_+"""', 'line... |
from reaction import *
import rospy
class ReactionPublishRosOutNode(Reaction):
"""A reaction that is able to publish a message on rosout."""
def __init__(self, autonomy_level, message, loglevel):
super(ReactionPublishRosOutNode, self).__init__(None, autonomy_level)
#: The message to publish... | [
"rospy.logwarn"
] | [((774, 922), 'rospy.logwarn', 'rospy.logwarn', (['(\'A reaction wants to log on loglevel\' + \n " \'%s\', but that loglevel does not exist." % loglevel +\n \' Setting loglevel to info.\')'], {}), '(\'A reaction wants to log on loglevel\' + \n " \'%s\', but that loglevel does not exist." % loglevel +\n \' S... |
#!/usr/bin/env python3
"""
Lints the chart's yaml files without any cluster interaction. For this script to
function, you must install yamllint and kubeval.
- https://github.com/adrienverge/yamllint
- https://github.com/garethr/kubeval
"""
import argparse
import glob
import subprocess
def lint(config, values, kuber... | [
"argparse.ArgumentParser",
"glob.iglob",
"subprocess.check_call"
] | [((457, 533), 'subprocess.check_call', 'subprocess.check_call', (["['helm', 'lint', '../jupyterhub', '--values', values]"], {}), "(['helm', 'lint', '../jupyterhub', '--values', values])\n", (478, 533), False, 'import subprocess\n'), ((593, 701), 'subprocess.check_call', 'subprocess.check_call', (["['helm', 'template', ... |
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from io import BytesIO
import PyPDF2
def new_pdf(details, name, width=216, height=280):
"""Creates a new empty PDF file"""
pdfobj = PyPDF2.PdfFileWriter()
pdfobj.addMetadata(details)
pdfobj.addBlankPage(... | [
"PyPDF2.PdfFileWriter",
"email.mime.application.MIMEApplication",
"email.mime.multipart.MIMEMultipart",
"io.BytesIO"
] | [((241, 263), 'PyPDF2.PdfFileWriter', 'PyPDF2.PdfFileWriter', ([], {}), '()\n', (261, 263), False, 'import PyPDF2\n'), ((347, 356), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (354, 356), False, 'from io import BytesIO\n'), ((485, 500), 'email.mime.multipart.MIMEMultipart', 'MIMEMultipart', ([], {}), '()\n', (498, 500),... |
import numpy as np
import sys
import string
M=4
N=5
# grille rempli par sequence
s_grille=np.full((M+N,M+N),0)
# grille remplit par 0 -1 1
grille=np.full((M,N), -1)
#grille[1][0]=0
sequence1=[1,1]
sequence2=[2,1]
# non-colore -1
# blanche 0
# noire 1
def lire_fichier(s_grille):
#file=sys.argv[1:]
try:
... | [
"numpy.full",
"sys.exit"
] | [((92, 118), 'numpy.full', 'np.full', (['(M + N, M + N)', '(0)'], {}), '((M + N, M + N), 0)\n', (99, 118), True, 'import numpy as np\n'), ((148, 167), 'numpy.full', 'np.full', (['(M, N)', '(-1)'], {}), '((M, N), -1)\n', (155, 167), True, 'import numpy as np\n'), ((13363, 13382), 'numpy.full', 'np.full', (['(M, N)', '(-... |
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class Tox(TestCommand):
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.tox_args = None
... | [
"shlex.split",
"setuptools.find_packages",
"setuptools.command.test.test.finalize_options",
"setuptools.command.test.test.initialize_options",
"sys.exit",
"tox.cmdline"
] | [((249, 285), 'setuptools.command.test.test.initialize_options', 'TestCommand.initialize_options', (['self'], {}), '(self)\n', (279, 285), True, 'from setuptools.command.test import test as TestCommand\n'), ((356, 390), 'setuptools.command.test.test.finalize_options', 'TestCommand.finalize_options', (['self'], {}), '(s... |
#!/usr/bin/env python3
# -*- coding: future_fstrings -*-
import argparse, sys, os
from collections import defaultdict
from db_sync_tool.utility import helper
# Workaround for ModuleNotFoundError
sys.path.append(os.getcwd())
from file_sync_tool import sync
def main(args={}):
"""
Main entry point for the comma... | [
"argparse.ArgumentParser",
"db_sync_tool.utility.helper.dict_to_args",
"file_sync_tool.sync.Sync",
"os.getcwd",
"collections.defaultdict"
] | [((212, 223), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (221, 223), False, 'import argparse, sys, os\n'), ((484, 607), 'file_sync_tool.sync.Sync', 'sync.Sync', ([], {'config_file': 'args.config_file', 'verbose': 'args.verbose', 'mute': 'args.mute', 'host_file': 'args.host_file', 'config': 'config'}), '(config_file=ar... |