repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
yk/jina
tests/unit/peapods/runtimes/remote/ssh/test_ssh_remote.py
ab66e233e74b956390f266881ff5dc4e0110d3ff
import pytest from jina.enums import RemoteAccessType from jina.flow import Flow from jina.parser import set_pea_parser, set_pod_parser from jina.peapods.pods import BasePod from jina.peapods.runtimes.remote.ssh import SSHRuntime from jina.proto import jina_pb2 @pytest.mark.skip('works locally, but until I findout h...
[((266, 370), 'pytest.mark.skip', 'pytest.mark.skip', (['"""works locally, but until I findout how to mock ssh, this has to be skipped"""'], {}), "(\n 'works locally, but until I findout how to mock ssh, this has to be skipped'\n )\n", (282, 370), False, 'import pytest\n'), ((621, 726), 'pytest.mark.skip', 'pytes...
dotX12/waio
waio/factory/models/basic.py
6bc41df2d650f31fdb11a1a2b67c6149afa0e11a
from dataclasses import dataclass @dataclass class PayloadSender: phone: int name: str @dataclass class PayloadBaseModel: sender: PayloadSender payload_id: str
[]
Nithanaroy/random_scripts
Uber/validExpression.py
908e539e2b7050a09e03b4fc0d2621b23733d65a
def main(expr): openingParams = '({[' closingParams = ')}]' stack = [] for c in expr: if c in openingParams: stack.append(c) elif c in closingParams: topOfStack = stack.pop() openingIndex = openingParams.find(topOfStack) closingIndex = clos...
[]
KrasnitzLab/sgains
sgains/tool.py
501c42bfdad4542725f00ca8199983eccf8c0b3f
import os import sys from copy import deepcopy import traceback import functools from collections import defaultdict import yaml from argparse import ArgumentParser,\ RawDescriptionHelpFormatter, ArgumentDefaultsHelpFormatter from sgains.configuration.parser import SgainsValidator, Config from sgains.configurat...
[((4403, 4414), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (4412, 4414), False, 'import os\n'), ((6285, 6302), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (6296, 6302), False, 'from collections import defaultdict\n'), ((6322, 6333), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (6331, 6333), Fa...
rsumner31/Detectron
lib/modeling/VGG16.py
021685d42f7e8ac097e2bcf79fecb645f211378e
# Copyright (c) 2017-present, Facebook, Inc. # # 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...
[]
yangjing1127/xmind2testcase
setup.py
49a581159a0d8e028f89939777399493662df111
#!/usr/env/bin python # -*- coding: utf-8 -*- import io import os import sys from shutil import rmtree from setuptools import setup, find_packages, Command about = {} here = os.path.abspath(os.path.dirname(__file__)) with io.open(os.path.join(here, 'xmind2testcase', '__about__.py'), encoding='utf-8') as f: # custom ...
[((191, 216), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (206, 216), False, 'import os\n'), ((351, 389), 'io.open', 'io.open', (['"""README.md"""'], {'encoding': '"""utf-8"""'}), "('README.md', encoding='utf-8')\n", (358, 389), False, 'import io\n'), ((231, 283), 'os.path.join', 'os.path....
Tillsten/skultrafast
skultrafast/styles.py
778eaf1539b6d85f21ac53b011472605673ef7e8
# -*- coding: utf-8 -*- """ Created on Thu Sep 17 21:33:24 2015 @author: Tillsten """ import matplotlib import matplotlib.pyplot as plt import numpy as np tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120), (44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 15...
[((1415, 1441), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 4)'}), '(figsize=(6, 4))\n', (1425, 1441), True, 'import matplotlib.pyplot as plt\n'), ((2658, 2668), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2666, 2668), True, 'import matplotlib.pyplot as plt\n'), ((1449, 1477), 'matplotl...
ezequielramos/oci-python-sdk
src/oci/devops/models/github_build_run_source.py
cc4235cf217beaf9feed75760e9ce82610222762
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
[((3416, 3441), 'oci.util.formatted_flat_dict', 'formatted_flat_dict', (['self'], {}), '(self)\n', (3435, 3441), False, 'from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel\n')]
anoopkcn/aiida-fleur
aiida_fleur/tests/tools/test_common_fleur_wf.py
5d4cc2092b7c3ce5402f1d4b89787eae53b2e60f
from __future__ import absolute_import import pytest import os # is_code def test_is_code_interface(fixture_code): from aiida_fleur.tools.common_fleur_wf import is_code assert is_code('random_string') is None assert is_code('fleur.inpGUT') is None assert is_code(99999) is None code = fixture_cod...
[((3424, 3474), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Test is not implemented"""'}), "(reason='Test is not implemented')\n", (3440, 3474), False, 'import pytest\n'), ((5167, 5217), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Test is not implemented"""'}), "(reason='Test is not impl...
admdev8/probnum
src/probnum/random_variables/_random_variable.py
792b6299bac247cf8b1b5056756f0f078855d83a
""" Random Variables. This module implements random variables. Random variables are the main in- and outputs of probabilistic numerical methods. """ from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union import numpy as np from probnum import utils as _utils from probnum.type import ( ...
[((658, 678), 'typing.TypeVar', 'TypeVar', (['"""ValueType"""'], {}), "('ValueType')\n", (665, 678), False, 'from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union\n'), ((4355, 4377), 'probnum.utils.as_shape', '_utils.as_shape', (['shape'], {}), '(shape)\n', (4370, 4377), True, 'from probnum i...
IsaacHuang/google-cloud-sdk
platform/gcutil/lib/google_compute_engine/gcutil_lib/address_cmds_test.py
52afa5d1a75dff08f4f5380c5cccc015bf796ca5
# Copyright 2012 Google Inc. 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 applicable law or a...
[((674, 704), 'path_initializer.InitSysPath', 'path_initializer.InitSysPath', ([], {}), '()\n', (702, 704), False, 'import path_initializer\n'), ((1023, 1055), 'gcutil_lib.mock_api.CreateApi', 'mock_api.CreateApi', (['self.version'], {}), '(self.version)\n', (1041, 1055), False, 'from gcutil_lib import mock_api\n'), ((...
jnegrete2005/JuradoFMS
vote/migrations/0005_auto_20210204_1900.py
25848037e51de1781c419155615d0fb41edc07ec
# Generated by Django 3.1.5 on 2021-02-05 00:00 import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('vote', '0004_auto_20210131_1621'), ] operations = [ migrations.AlterField( model_name='com...
[((426, 460), 'django.db.models.PositiveSmallIntegerField', 'models.PositiveSmallIntegerField', ([], {}), '()\n', (458, 460), False, 'from django.db import migrations, models\n'), ((694, 728), 'django.db.models.PositiveSmallIntegerField', 'models.PositiveSmallIntegerField', ([], {}), '()\n', (726, 728), False, 'from dj...
ngzhian/emscripten
tools/wasm-sourcemap.py
94b1555a09f869d65354a2033da724ce77a43106
#!/usr/bin/env python # Copyright 2018 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """Utility tools that extracts DWARF informatio...
[((838, 873), 'logging.getLogger', 'logging.getLogger', (['"""wasm-sourcemap"""'], {}), "('wasm-sourcemap')\n", (855, 873), False, 'import logging\n'), ((2912, 2960), 'collections.namedtuple', 'namedtuple', (['"""SourceMapPrefixes"""', '"""sources, load"""'], {}), "('SourceMapPrefixes', 'sources, load')\n", (2922, 2960...
agustinhenze/mibs.snmplabs.com
pysnmp-with-texts/ENTERASYS-NAC-APPLIANCE-MIB.py
1fc5c07860542b89212f4c8ab807057d9a9206c7
# # PySNMP MIB module ENTERASYS-NAC-APPLIANCE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ENTERASYS-NAC-APPLIANCE-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:04:09 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python versio...
[]
Kebniss/AutoDetect
Unsupervised/pix2pixHD/extract_frames.py
44ca4d6930ef5fbf044ebeed5c9fd925f04bc1a8
import os import cv2 import argparse from utils import * from tqdm import tqdm from glob import glob from pathlib import Path def _extract_frames(video_path, parent, start=0, sampling_f=1): vidcap = cv2.VideoCapture(video_path) success, image = success, image = vidcap.read() count = -1 saved = 0 p...
[((785, 871), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""build a "frame dataset" from a given video"""'}), '(description=\n \'build a "frame dataset" from a given video\')\n', (808, 871), False, 'import argparse\n'), ((2342, 2367), 'os.path.isdir', 'os.path.isdir', (['args.input']...
parsiya/Parsia-Code
burp-filter-options/filter-options.py
e75bd9f7f295e6d8e584de67f90dd02cb75ae915
# modified "example traffic redirector" # https://raw.githubusercontent.com/PortSwigger/example-traffic-redirector/master/python/TrafficRedirector.py # Idea: https://github.com/pajswigger/filter-options/blob/master/src/filter-options.kt # Usage: Put both files in a directory and add filter-options.py to Burp. Nees ...
[]
loftwah/appscale
AppServer/google/appengine/tools/devappserver2/login.py
586fc1347ebc743d7a632de698f4dbfb09ae38d6
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # 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...
[((11072, 11127), 'webapp2.WSGIApplication', 'webapp2.WSGIApplication', (["[('/.*', Handler)]"], {'debug': '(True)'}), "([('/.*', Handler)], debug=True)\n", (11095, 11127), False, 'import webapp2\n'), ((4895, 4916), 'Cookie.SimpleCookie', 'Cookie.SimpleCookie', ([], {}), '()\n', (4914, 4916), False, 'import Cookie\n'),...
noah-goodrich/beam
sdks/python/apache_beam/runners/portability/job_server.py
5a851b734f53206c20efe08d93d15760bbc15b0c
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
[((3638, 3680), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.apache_beam/cache"""'], {}), "('~/.apache_beam/cache')\n", (3656, 3680), False, 'import os\n'), ((1631, 1668), 'grpc.insecure_channel', 'grpc.insecure_channel', (['self._endpoint'], {}), '(self._endpoint)\n', (1652, 1668), False, 'import grpc\n'), ((1...
tachycline/sympy
sympy/printing/pycode.py
abf6fec12012852c7e6fae38461da9723cadc8b9
from collections import defaultdict from functools import wraps from itertools import chain from sympy.core import sympify from .precedence import precedence from .codeprinter import CodePrinter _kw_py2and3 = { 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finall...
[((2720, 2736), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (2731, 2736), False, 'from collections import defaultdict\n')]
Projectoy/ml_framework
arguments_setting.py
f3d37d632a1aec314eb186a3da6d174a5dc4beee
import argparse, os class ArgumentManager: def __init__(self, model_list): self.model_list = model_list self.args = self.get_input_arguments() self.validate_arguments() def get_input_arguments(self): parser = argparse.ArgumentParser(description='Process some integers.') ...
[((251, 312), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Process some integers."""'}), "(description='Process some integers.')\n", (274, 312), False, 'import argparse, os\n'), ((1183, 1210), 'os.path.exists', 'os.path.exists', (['config_path'], {}), '(config_path)\n', (1197, 1210), F...
Omer-Sella/ldpc
fileHandler.py
955c0bc32236e171365cbbb88f00574302771610
# -*- coding: utf-8 -*- """ Created on Thu Nov 28 12:10:11 2019 @author: Omer """ ## File handler ## This file was initially intended purely to generate the matrices for the near earth code found in: https://public.ccsds.org/Pubs/131x1o2e2s.pdf ## The values from the above pdf were copied manually to a txt file, and ...
[((694, 716), 'os.environ.get', 'os.environ.get', (['"""LDPC"""'], {}), "('LDPC')\n", (708, 716), False, 'import os\n'), ((911, 941), 'sys.path.insert', 'sys.path.insert', (['(1)', 'projectDir'], {}), '(1, projectDir)\n', (926, 941), False, 'import sys\n'), ((1042, 1101), 'numpy.array', 'np.array', (['[8, 4, 2, 1]'], {...
Sentienz/datacollector-tests
stage/configuration/test_amazon_s3_origin.py
ca27988351dc3366488098b5db6c85a8be2f7b85
import logging import pytest from streamsets.testframework.markers import aws, sdc_min_version from streamsets.testframework.utils import get_random_string logger = logging.getLogger(__name__) S3_SANDBOX_PREFIX = 'sandbox' LOG_FIELD_MAPPING = [{'fieldPath': '/date', 'group': 1}, {'fieldPath': '/...
[((167, 194), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (184, 194), False, 'import logging\n'), ((4949, 4988), 'pytest.mark.skip', 'pytest.mark.skip', (['"""Not yet implemented"""'], {}), "('Not yet implemented')\n", (4965, 4988), False, 'import pytest\n'), ((5066, 5105), 'pytest.mar...
eubr-atmosphere/a-MLLibrary
model_building/svr_experiment_configuration.py
b6ba472baacea6d793ab4f03275cdfa874e83bc3
""" Copyright 2019 Marco Lattuada Copyright 2019 Danilo Ardagna 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...
[((1803, 2010), 'sklearn.svm.SVR', 'svm.SVR', ([], {'C': "self._hyperparameters['C']", 'epsilon': "self._hyperparameters['epsilon']", 'gamma': "self._hyperparameters['gamma']", 'kernel': "self._hyperparameters['kernel']", 'degree': "self._hyperparameters['degree']"}), "(C=self._hyperparameters['C'], epsilon=self._hyper...
south-coast-science/scs_host_rpi
src/scs_host/sys/host_gpi.py
a02afde3fd2e1f2b8c6dc08beef8c74039108a64
""" Created on 12 May 2017 @author: Bruno Beloff ([email protected]) """ from scs_host.sys.host_gpio import HostGPIO # -------------------------------------------------------------------------------------------------------------------- # noinspection PyUnusedLocal,PyAbstractClass class HostGPI(Hos...
[]
dcragusa/PythonMorsels
30-39/35. final_class/final_class.py
5f75b51a68769036e4004e9ccdada6b220124ab6
class Unsubclassable: def __init_subclass__(cls, **kwargs): raise TypeError('Unacceptable base type') def prevent_subclassing(): raise TypeError('Unacceptable base type') def final_class(cls): setattr(cls, '__init_subclass__', prevent_subclassing) return cls class UnsubclassableType(type)...
[]
victor-estrade/SystGradDescent
benchmark/AMS/HIGGSTES/TP.py
822e7094290301ec47a99433381a8d6406798aff
#!/usr/bin/env python # coding: utf-8 from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals # Command line : # python -m benchmark.VAR.GG.TP import os import logging from config import SEED from config import _ERROR from co...
[((420, 437), 'visual.misc.set_plot_config', 'set_plot_config', ([], {}), '()\n', (435, 437), False, 'from visual.misc import set_plot_config\n'), ((2527, 2570), 'archi.classic.L4', 'ARCHI', ([], {'n_in': '(29)', 'n_out': '(2)', 'n_unit': 'args.n_unit'}), '(n_in=29, n_out=2, n_unit=args.n_unit)\n', (2532, 2570), True, ...
dmartinpro/papermill
papermill/tests/test_adl.py
fbb0a60c97cde70e3b278f778cbd366cf54f83f0
import unittest from ..adl import ADL import six if six.PY3: from unittest.mock import Mock, MagicMock else: from mock import Mock, MagicMock class ADLTest(unittest.TestCase): """ Tests for `ADL` """ def setUp(self): self.ls = Mock(return_value=["foo", "bar", "baz"]) self.fak...
[((263, 303), 'mock.Mock', 'Mock', ([], {'return_value': "['foo', 'bar', 'baz']"}), "(return_value=['foo', 'bar', 'baz'])\n", (267, 303), False, 'from mock import Mock, MagicMock\n'), ((328, 339), 'mock.MagicMock', 'MagicMock', ([], {}), '()\n', (337, 339), False, 'from mock import Mock, MagicMock\n'), ((486, 518), 'mo...
AnvarKhan/django-python
users/views.py
bd54e44deb290f43ea5982c2ca9f37cd6c946879
from django.views.generic import CreateView from django.urls import reverse_lazy from .forms import CustomUserCreationForm class SignUpView(CreateView): form_class = CustomUserCreationForm success_url = reverse_lazy('login') template_name = 'signup.html'
[((206, 227), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""login"""'], {}), "('login')\n", (218, 227), False, 'from django.urls import reverse_lazy\n')]
Thom1729/package_util
st3/package_util/compat/typing.py
3ddec00d8ab4a52f0f5ce3fe8b09247c1518547f
try: from typing import * # noqa: F401, F403 except ImportError: from .typing_stubs import * # type: ignore # noqa: F401, F403
[]
rasimuvaikas/stanza
stanza/models/common/dropout.py
21793519a531b0e9d7151e42d180d97785c9a5b8
import torch import torch.nn as nn class WordDropout(nn.Module): """ A word dropout layer that's designed for embedded inputs (e.g., any inputs to an LSTM layer). Given a batch of embedded inputs, this layer randomly set some of them to be a replacement state. Note that this layer assumes the last dimensio...
[((679, 717), 'torch.rand', 'torch.rand', (['*masksize'], {'device': 'x.device'}), '(*masksize, device=x.device)\n', (689, 717), False, 'import torch\n'), ((2609, 2647), 'torch.rand', 'torch.rand', (['*masksize'], {'device': 'x.device'}), '(*masksize, device=x.device)\n', (2619, 2647), False, 'import torch\n')]
bdfd/Python_Zero2Hero_DS
Day01-15/code/Day15/pdf2.py
9dafe90b8112fdc3d07e1aa02e41ed3f019f733c
""" 读取PDF文件 Version: 0.1 Author: BDFD Date: 2018-03-26 """ from PyPDF2 import PdfFileReader with open('./res/Python课程大纲.pdf', 'rb') as f: reader = PdfFileReader(f, strict=False) print(reader.numPages) if reader.isEncrypted: reader.decrypt('') current_page = reader.getPage(5) print(current...
[((154, 184), 'PyPDF2.PdfFileReader', 'PdfFileReader', (['f'], {'strict': '(False)'}), '(f, strict=False)\n', (167, 184), False, 'from PyPDF2 import PdfFileReader\n')]
DazEB2/SimplePyScripts
qt__pyqt__pyside__pyqode/qt__class_tree__parse_and_print__recursively__from__doc_qt_io/gui.py
1dde0a42ba93fe89609855d6db8af1c63b1ab7cc
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' from PyQt5 import QtWidgets as qtw from PyQt5.QtTest import QTest import time import requests from bs4 import BeautifulSoup from console import get_inherited_children, ROOT_URL class MainWindow(qtw.QMainWindow): def __init__(self): ...
[((2221, 2241), 'PyQt5.QtWidgets.QApplication', 'qtw.QApplication', (['[]'], {}), '([])\n', (2237, 2241), True, 'from PyQt5 import QtWidgets as qtw\n'), ((456, 473), 'PyQt5.QtWidgets.QTreeWidget', 'qtw.QTreeWidget', ([], {}), '()\n', (471, 473), True, 'from PyQt5 import QtWidgets as qtw\n'), ((845, 862), 'PyQt5.QtTest....
kyle-ibm/op-test
common/OpTestASM.py
df8dbf8cbff1390668c22632052adb46ebf277c1
#!/usr/bin/env python3 # encoding=utf8 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: op-test-framework/common/OpTestASM.py $ # # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # Licensed under the Apache ...
[((1747, 1775), 'ssl.create_default_context', 'ssl.create_default_context', ([], {}), '()\n', (1773, 1775), False, 'import ssl\n'), ((4191, 4205), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (4201, 4205), False, 'import time\n'), ((2895, 2938), 're.findall', 're.findall', (['"""CSRF_TOKEN.*value=\'(.*)\'"""',...
jrabasco/PyPasser
test/test_storage.py
3cc6ecdfa9b5fe22f5a88c221517fe09d2df9db6
#!/usr/bin/python3.4 __author__ = "Jeremy Rabasco" import sys import os sys.path.append("..") import unittest from modules import storage from modules.service import Service from modules.database import Database class TestStorage(unittest.TestCase): def setUp(self): self.service = Service() self...
[((73, 94), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (88, 94), False, 'import sys\n'), ((1809, 1824), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1822, 1824), False, 'import unittest\n'), ((298, 307), 'modules.service.Service', 'Service', ([], {}), '()\n', (305, 307), False, 'from ...
lakhlaifi/RedHat-Ansible
virt/ansible-latest/lib/python2.7/site-packages/ansible/plugins/lookup/template.py
27c5077cced9d416081fcd5d69ea44bca0317fa4
# Copyright: (c) 2012, Michael DeHaan <[email protected]> # Copyright: (c) 2012-17, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup...
[((1893, 1902), 'ansible.utils.display.Display', 'Display', ([], {}), '()\n', (1900, 1902), False, 'from ansible.utils.display import Display\n'), ((2658, 2712), 'ansible.module_utils._text.to_text', 'to_text', (['b_template_data'], {'errors': '"""surrogate_or_strict"""'}), "(b_template_data, errors='surrogate_or_stric...
ripiuk/fant_sizer
setup.py
dcc0908c79ed76af3f4189ebd2a75cecf7a89e34
from setuptools import setup, find_packages from os.path import join, dirname setup( name="fant_sizer", version="0.7", author="Rypiuk Oleksandr", author_email="[email protected]", description="fant_sizer command-line file-information", url="https://github.com/ripiuk/fan...
[((861, 876), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (874, 876), False, 'from setuptools import setup, find_packages\n'), ((913, 930), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (920, 930), False, 'from os.path import join, dirname\n')]
elvisyjlin/google-code-jam
2018/Round 1A/A.py
7fe8244c5ae07a9896acf9c48f3a06b306b393b1
def solve(): # Read input R, C, H, V = map(int, input().split()) choco = [] for _ in range(R): choco.append([0] * C) choco_row, choco_col = [0]*R, [0]*C num_choco = 0 for i in range(R): row = input() for j in range(C): if row[j] == '@': cho...
[]
vinaymundada27/Hue
desktop/libs/liboozie/src/liboozie/submittion_tests.py
7bffb33bbe7cfa34d340241c4ba3b19476211b2a
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
[((1269, 1296), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1286, 1296), False, 'import logging\n'), ((1300, 1323), 'nose.plugins.attrib.attr', 'attr', (['"""requires_hadoop"""'], {}), "('requires_hadoop')\n", (1304, 1323), False, 'from nose.plugins.attrib import attr\n'), ((1359, 138...
Wenyuan-Vincent-Li/SSL_Seg_GAN
Training/train_baseHD.py
8f6c45fd000ea12468dccf211b376fadbf4759c6
import torch.nn as nn import torch.optim as optim import torch.utils.data from Training import functions from Training.imresize import imresize import matplotlib.pyplot as plt from Models.pix2pixHD_base import GANLoss, VGGLoss from Models.pix2pixHD2 import mask2onehot class Losses(): def __init__(self, opt): ...
[((10379, 10425), 'Training.functions.save_networks', 'functions.save_networks', (['netG', 'netD', 'netS', 'opt'], {}), '(netG, netD, netS, opt)\n', (10402, 10425), False, 'from Training import functions\n'), ((343, 368), 'Models.pix2pixHD_base.GANLoss', 'GANLoss', (['(not opt.no_lsgan)'], {}), '(not opt.no_lsgan)\n', ...
0xreza/tvm
tests/python/unittest/test_tir_pass_inject_double_buffer.py
f08d5d78ee000b2c113ac451f8d73817960eafd5
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[((893, 922), 'tvm.te.thread_axis', 'te.thread_axis', (['"""threadIdx.x"""'], {}), "('threadIdx.x')\n", (907, 922), False, 'from tvm import te\n'), ((932, 959), 'tvm.tir.ir_builder.create', 'tvm.tir.ir_builder.create', ([], {}), '()\n', (957, 959), False, 'import tvm\n'), ((1451, 1494), 'tvm.tir.ir_pass.InjectDoubleBuf...
shivupoojar/openfaas-pi
read_sensor.py
5eda501368a1ac321954cb2aaf58be617977bd58
import requests from sense_hat import SenseHat import smbus import time while True: try: pressure=0 sense = SenseHat() pressure = sense.get_pressure() data = {'pressure':pressure} print(pressure) #send http request to sense serverless function with pressure #data r=req...
[]
highfestiva/life
trabantsim/prototypes/space_invaders.py
b05b592502d72980ab55e13e84330b74a966f377
#!/usr/bin/env python3 # Space Invadersishkebab. from trabant import * # ASCII geometries. shipascii = r''' /\ /XXXXXXXX\ v v ''' invader = r''' /XXXXXX\ /XXXXXXXX\ XXXXXXXXXX XX XX XX \XXXXXXXX/ /XX XX\ /X/ \/ \X\ X/ \X ''' cam(distance=250) gravity((0,0,0)) ship = create_ascii_object(...
[]
Shang-XH/BAFTT
model/backbone/xception.py
62392325342f48b8a89f0c2bf71e48026dd90629
import math import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.model_zoo as model_zoo from model.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d def fixed_padding(inputs, kernel_size, dilation): kernel_size_effective = kernel_size + (kernel_size - 1) * (dilation - 1) ...
[((441, 492), 'torch.nn.functional.pad', 'F.pad', (['inputs', '(pad_beg, pad_end, pad_beg, pad_end)'], {}), '(inputs, (pad_beg, pad_end, pad_beg, pad_end))\n', (446, 492), True, 'import torch.nn.functional as F\n'), ((11424, 11450), 'torch.rand', 'torch.rand', (['(1)', '(3)', '(512)', '(512)'], {}), '(1, 3, 512, 512)\n...
IrinaMBejan/Autonom
Backend/autonomus/utils/mail.py
4a97da1b26ed22e3ec8bb939359148765392b692
from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail, Substitution API_KEY = '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' API_KEY_ID = 'egd1yywWRbeVF2gcGhTH2Q' ENCODING = "utf-8" DEFAULT_MAIL="[email protected]" def link(urlsafe): return "https://develop-...
[((604, 650), 'sendgrid.helpers.mail.Mail', 'Mail', ([], {'from_email': 'from_mail', 'to_emails': 'to_mails'}), '(from_email=from_mail, to_emails=to_mails)\n', (608, 650), False, 'from sendgrid.helpers.mail import Mail, Substitution\n'), ((1135, 1161), 'sendgrid.SendGridAPIClient', 'SendGridAPIClient', (['API_KEY'], {}...
percygautam/yellowbrick
yellowbrick/features/pca.py
1ba6774a257bc85768a990293790caf4c14a5653
# -*- coding: utf-8 -*- # yellowbrick.features.pca # Decomposition based feature visualization with PCA. # # Author: Carlo Morales # Author: Raúl Peralta Lozada # Author: Benjamin Bengfort # Created: Tue May 23 18:34:27 2017 -0400 # # Copyright (C) 2017 The scikit-yb developers # For license information, see LIC...
[((7537, 7626), 'yellowbrick.exceptions.YellowbrickValueError', 'YellowbrickValueError', (['"""heatmap and colorbar are not compatible with 3d projections"""'], {}), "(\n 'heatmap and colorbar are not compatible with 3d projections')\n", (7558, 7626), False, 'from yellowbrick.exceptions import YellowbrickValueError,...
Jarvan-Wang/k2
k2/python/host/k2host/properties.py
7f164ecb804d15006fd30e8564d80e0fa212f011
# Copyright (c) 2020 Xiaomi Corporation (author: Haowen Qiu) # See ../../../LICENSE for clarification regarding multiple authors import torch from torch.utils.dlpack import to_dlpack from .fsa import Fsa from _k2host import _is_valid from _k2host import _is_top_sorted from _k2host import _is_arc_sorted from _k2hos...
[]
cmd410/OrigamiBot
origamibot/core/teletypes/poll_option.py
03667d069f0c0b088671936ce36bf8f85a029b93
from .base import TelegramStructure, Field class PollOption(TelegramStructure): text = Field() voter_count = Field() def __init__(self, text: str, voter_count: int ): self.text = \ Field(text, [str]) self.voter_count = \ ...
[]
xiki-tempula/spack
var/spack/repos/builtin/packages/r-viridislite/package.py
9d66c05e93ab8a933fc59915040c0e0c86a4aac4
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RViridislite(RPackage): """viridisLite: Default Color Maps from 'matplotlib' (Lite Version...
[]
AnanyaRamanA/shiSock
shiSock-0.2.0/test_two/PySock/server.py
51efb0eba17eb106b9480598d278536ddd7732c3
from re import S import select import socket import queue import threading import sys import pickle import base64 import os from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.ciphers.aead import AESGCM from cryptography.hazmat.primitives.serialization import load_ssh_public_key...
[((2900, 2921), 'random.shuffle', 'random.shuffle', (['_all_'], {}), '(_all_)\n', (2914, 2921), False, 'import random\n'), ((4091, 4109), 'pickle.dumps', 'pickle.dumps', (['data'], {}), '(data)\n', (4103, 4109), False, 'import pickle\n'), ((4226, 4254), 'pickle.dumps', 'pickle.dumps', (['encrypted_data'], {}), '(encryp...
zhoulhb/teleport
server/www/packages/packages-windows/x86/ldap3/utils/asn1.py
54da194697898ef77537cfe7032d774555dc1335
""" """ # Created on 2015.08.19 # # Author: Giovanni Cannata # # Copyright 2015 - 2018 Giovanni Cannata # # This file is part of ldap3. # # ldap3 is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Founda...
[((3083, 3099), 'copy.deepcopy', 'deepcopy', (['tagMap'], {}), '(tagMap)\n', (3091, 3099), False, 'from copy import deepcopy\n'), ((3121, 3138), 'copy.deepcopy', 'deepcopy', (['typeMap'], {}), '(typeMap)\n', (3129, 3138), False, 'from copy import deepcopy\n'), ((3270, 3306), 'pyasn1.codec.ber.encoder.Encoder', 'Encoder...
SimeonZhang/detectron2_tensorflow
lib/utils/arg_scope.py
ca03f633111d540ea91b3de75dbfa1da813647be
import copy from contextlib import contextmanager from functools import wraps from collections import defaultdict import tensorflow as tf _ArgScopeStack = [] @contextmanager def arg_scope(layers, **kwargs): """ Args: layers (list or layer): layer or list of layers to apply the arguments. Returns...
[((2018, 2038), 'functools.wraps', 'wraps', (['original_init'], {}), '(original_init)\n', (2023, 2038), False, 'from functools import wraps\n'), ((1427, 1444), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (1438, 1444), False, 'from collections import defaultdict\n')]
AnkitDeshwal89/NETMIKO
CORN-TEST/textfsm_parse.py
81c164e9cff46d11b56612f6adc343b6bcdfe87a
import textfsm import subprocess import random res = subprocess.run('ifconfig',stdout=subprocess.PIPE) intstatus = res.stdout.decode('ascii') with open("datafile","w+") as a: a.write(intstatus) a.close() template_file= "ifconfig-template.template" template = open(template_file) with open("datafile") as ...
[((55, 105), 'subprocess.run', 'subprocess.run', (['"""ifconfig"""'], {'stdout': 'subprocess.PIPE'}), "('ifconfig', stdout=subprocess.PIPE)\n", (69, 105), False, 'import subprocess\n'), ((359, 384), 'textfsm.TextFSM', 'textfsm.TextFSM', (['template'], {}), '(template)\n', (374, 384), False, 'import textfsm\n'), ((645, ...
jared-jorgenson/mini_game
classes.py
ac73987ac4c32c0e9f521d7bcf8d4d9ee4ded85a
import pygame class Player(pygame.sprite.Sprite): death = [pygame.image.load('Images/death1.png'), pygame.image.load('Images/death2.png'), pygame.image.load('Images/death3.png'), pygame.image.load('Images/death4.png'), pygame.image.load('Images/death5.png'), pygame.im...
[((69, 107), 'pygame.image.load', 'pygame.image.load', (['"""Images/death1.png"""'], {}), "('Images/death1.png')\n", (86, 107), False, 'import pygame\n'), ((109, 147), 'pygame.image.load', 'pygame.image.load', (['"""Images/death2.png"""'], {}), "('Images/death2.png')\n", (126, 147), False, 'import pygame\n'), ((163, 20...
NSLS-II/installSynApps
installSynApps/data_model/install_config.py
0f8e978939715bbba1a064ead3044fa36215cb09
"""A file containing representations of install configurations. The core Data representation for installSynApps. An InstallConfiguration object is parsed from a configuration, and is then used throughout the build process. InjectorFile objects are used for representing text that need to be injected into configuration...
[((1937, 1970), 'os.path.abspath', 'os.path.abspath', (['install_location'], {}), '(install_location)\n', (1952, 1970), False, 'import os\n'), ((12720, 12806), 'installSynApps.data_model.install_module.InstallModule', 'IM', (['"""EPICS_BASE"""', '"""R7.0.3"""', '"""$(INSTALL)/base"""', 'gu', 'base_org', '"""epics-base"...
tarvitz/icu
apps/accounts/views.py
9a7cdac9d26ea224539f68f678b90bf70084374d
# Create your views here. # -*- coding: utf-8 -*- from apps.core.helpers import render_to, ajax_response, get_object_or_None from apps.core.decorators import lock, login_required_json from apps.accounts.models import Invite from apps.accounts.decorators import check_invite from apps.accounts.forms import ( LoginFor...
[((682, 714), 'apps.core.helpers.render_to', 'render_to', (['"""accounts/login.html"""'], {}), "('accounts/login.html')\n", (691, 714), False, 'from apps.core.helpers import render_to, ajax_response, get_object_or_None\n'), ((1011, 1034), 'apps.core.helpers.render_to', 'render_to', (['"""index.html"""'], {}), "('index....
LaudateCorpus1/oci-ansible-collection
plugins/modules/oci_blockstorage_volume_backup_policy_facts.py
2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7
#!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
[((11059, 11114), 'ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils.get_custom_class', 'get_custom_class', (['"""VolumeBackupPolicyFactsHelperCustom"""'], {}), "('VolumeBackupPolicyFactsHelperCustom')\n", (11075, 11114), False, 'from ansible_collections.oracle.oci.plugins.module_utils.oci_resource...
mhozza/pi-control
pi_control/server_stats/apps.py
0dce821b4702519fedc3950270ee0091ed484ef6
from django.apps import AppConfig class ServerStatsConfig(AppConfig): name = "server_stats"
[]
jackvz/mezzanine-cartridge-api
testproject/testproject/settings.py
c956afa672fcf1035ab60cd5eb6589a06ccaafa0
from __future__ import absolute_import, unicode_literals import os from django import VERSION as DJANGO_VERSION from django.utils.translation import ugettext_lazy as _ SECRET_KEY = '%29hnw7d-dy4n)!@1yi#ov#^@x0b=o*2o8^31oe!+(xw!!oc9a' ###################### # CARTRIDGE SETTINGS # ###################### # The follow...
[((8031, 8065), 'os.path.basename', 'os.path.basename', (['PROJECT_APP_PATH'], {}), '(PROJECT_APP_PATH)\n', (8047, 8065), False, 'import os\n'), ((8092, 8125), 'os.path.dirname', 'os.path.dirname', (['PROJECT_APP_PATH'], {}), '(PROJECT_APP_PATH)\n', (8107, 8125), False, 'import os\n'), ((13603, 13654), 'os.path.join', ...
ishaanbakhle/wordgen.us
wordgen/data_gen.py
45c5247ce04b13badd2e1b3164cedc9176a805c7
from wordgen import consts import numpy as np from sklearn import preprocessing def fill_matrix(dataset): assert type(dataset) == str assert len(dataset) > 0, print("Dataset must be > 0") matrix = [] for i in consts.rang: matrix.append([]) for o in consts.rang: matrix[i]...
[((833, 875), 'sklearn.preprocessing.normalize', 'preprocessing.normalize', (['matrix'], {'norm': '"""l1"""'}), "(matrix, norm='l1')\n", (856, 875), False, 'from sklearn import preprocessing\n'), ((707, 733), 'wordgen.consts.get_ord', 'consts.get_ord', (['dataset[i]'], {}), '(dataset[i])\n', (721, 733), False, 'from wo...
Cleptomania/arcade
arcade/gl/context.py
abb7f0a0229b7f3a7843856d4b0812a3a2b80468
from ctypes import c_int, c_char_p, cast, c_float from collections import deque import logging import weakref from typing import Any, Dict, List, Tuple, Union, Sequence, Set import pyglet from pyglet.window import Window from pyglet import gl from .buffer import Buffer from .program import Program from .vertex_array ...
[((563, 590), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (580, 590), False, 'import logging\n'), ((4798, 4817), 'weakref.ref', 'weakref.ref', (['window'], {}), '(window)\n', (4809, 4817), False, 'import weakref\n'), ((5661, 5705), 'pyglet.gl.glEnable', 'gl.glEnable', (['gl.GL_TEXTURE_...
pixelater/queue-management
api/app/models/bookings/exam.py
9881505d4af2b9860aeaf76b9572315dd016c7dc
'''Copyright 2018 Province of British Columbia Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,...
[((667, 742), 'qsystem.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)', 'autoincrement': '(True)', 'nullable': '(False)'}), '(db.Integer, primary_key=True, autoincrement=True, nullable=False)\n', (676, 742), False, 'from qsystem import db\n'), ((1232, 1269), 'qsystem.db.Column', 'db.Column', (['db.Da...
jaredliw/python-question-bank
leetcode/1672 Richest Customer Wealth.py
9c8c246623d8d171f875700b57772df0afcbdcdf
class Solution(object): def maximumWealth(self, accounts): """ :type accounts: List[List[int]] :rtype: int """ # Runtime: 36 ms # Memory: 13.5 MB return max(map(sum, accounts))
[]
gregneagle/sal
datatableview/tests/test_helpers.py
74c583fb1c1b33d3201b308b147376b3dcaca33f
# -*- encoding: utf-8 -*- from datetime import datetime from functools import partial from django import get_version from datatableview import helpers import six from .testcase import DatatableViewTestCase from .test_app.models import ExampleModel, RelatedM2MModel if get_version().split('.') < ['1', '7']: tes...
[((2514, 2528), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2526, 2528), False, 'from datetime import datetime\n'), ((274, 287), 'django.get_version', 'get_version', ([], {}), '()\n', (285, 287), False, 'from django import get_version\n')]
naari3/seibaribot
discordbot.py
3686206ed0b28b318a4032753350be8d9f2223fd
import traceback from os import getenv import discord from discord import Message from discord.ext import commands from discord.ext.commands import Context from asyncio import sleep import asyncio client = discord.Client() # botの接頭辞を!にする bot = commands.Bot(command_prefix='!') # ギラティナのチャンネルのID GIRATINA_CHANNEL_ID = 9...
[((207, 223), 'discord.Client', 'discord.Client', ([], {}), '()\n', (221, 223), False, 'import discord\n'), ((246, 278), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""!"""'}), "(command_prefix='!')\n", (258, 278), False, 'from discord.ext import commands\n'), ((3475, 3502), 'os.getenv', 'geten...
arghyadip01/grpc
test/cpp/naming/utils/dns_server.py
9e10bfc8a096ef91a327e22f84f10c0fabff4417
#!/usr/bin/env python2.7 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
[((4166, 4204), 'twisted.names.dns.Record_SOA', 'dns.Record_SOA', ([], {'mname': 'common_zone_name'}), '(mname=common_zone_name)\n', (4180, 4204), False, 'from twisted.names import client, server, common, authority, dns\n'), ((4336, 4415), 'twisted.names.server.DNSServerFactory', 'twisted.names.server.DNSServerFactory'...
BPearlstine/colour
colour/examples/models/examples_ictcp.py
40f0281295496774d2a19eee017d50fd0c265bd8
# -*- coding: utf-8 -*- """ Showcases *ICTCP* *colour encoding* computations. """ import numpy as np import colour from colour.utilities import message_box message_box('"ICTCP" Colour Encoding Computations') RGB = np.array([0.45620519, 0.03081071, 0.04091952]) message_box(('Converting from "ITU-R BT.2020" colourspa...
[((159, 210), 'colour.utilities.message_box', 'message_box', (['""""ICTCP" Colour Encoding Computations"""'], {}), '(\'"ICTCP" Colour Encoding Computations\')\n', (170, 210), False, 'from colour.utilities import message_box\n'), ((218, 264), 'numpy.array', 'np.array', (['[0.45620519, 0.03081071, 0.04091952]'], {}), '([...
MauricioAntonioMartinez/django-workout-tracker-api
app/core/model/routine.py
82f9499f172bd6d4b861f072948949dd6f8f6ec1
import os import uuid from django.conf import settings # this is how we can retrive variables # for the settings file from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager, PermissionsMixin) from django.core.validators import MaxValueValidator, MinValueVali...
[((791, 835), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'blank': '(True)'}), '(max_length=255, blank=True)\n', (807, 835), False, 'from django.db import models\n'), ((850, 929), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""Routine"""'], {'related_name': '"""routines"""'...
British-Oceanographic-Data-Centre/COAsT
example_scripts/transect_tutorial.py
4d3d57c9afb61a92063b665626c1828dd2998d2b
""" This is a demonstration script for using the Transect class in the COAsT package. This object has strict data formatting requirements, which are outlined in tranect.py. Transect subsetting (a vertical slice of data between two coordinates): Creating them and performing some custom diagnostics with them. --- In ...
[((1351, 1440), 'coast.Gridded', 'coast.Gridded', ([], {'fn_data': 'fn_nemo_dat_t', 'fn_domain': 'fn_nemo_dom', 'config': 'fn_config_t_grid'}), '(fn_data=fn_nemo_dat_t, fn_domain=fn_nemo_dom, config=\n fn_config_t_grid)\n', (1364, 1440), False, 'import coast\n'), ((1724, 1769), 'coast.TransectT', 'coast.TransectT', ...
skirpichev/diofant
diofant/logic/boolalg.py
16e280fdd6053be10c3b60fbb66fc26b52ede27a
""" Boolean algebra module for Diofant. """ from collections import defaultdict from itertools import combinations, product from ..core import Atom, cacheit from ..core.expr import Expr from ..core.function import Application from ..core.numbers import Number from ..core.operations import LatticeOp from ..core.single...
[((42099, 42116), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (42110, 42116), False, 'from collections import defaultdict\n'), ((17794, 17820), 'itertools.combinations', 'combinations', (['self.args', 'i'], {}), '(self.args, i)\n', (17806, 17820), False, 'from itertools import combinations, pr...
JoanLee0826/amazon
amazon/goods_review_thread.py
13fcbcb0e9e396af6d4b2287c2a1a06fd602ce98
import pandas as pd import requests from lxml import etree import re, time, random, datetime from queue import Queue import threading class Review: headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 \ (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36" ...
[((508, 515), 'queue.Queue', 'Queue', ([], {}), '()\n', (513, 515), False, 'from queue import Queue\n'), ((728, 746), 'requests.Session', 'requests.Session', ([], {}), '()\n', (744, 746), False, 'import requests\n'), ((1089, 1109), 'lxml.etree.HTML', 'etree.HTML', (['res.text'], {}), '(res.text)\n', (1099, 1109), False...
lumicks/pylake
lumicks/pylake/population/tests/conftest.py
b5875d156d6416793a371198f3f2590fca2be4cd
import pytest import numpy as np from pathlib import Path def extract_param(data, n_states): keys = ("initial_state_prob", "transition_prob", "means", "st_devs") param = {"n_states": n_states} for key in keys: param[key] = data[f"{key}_{n_states}"] return param @pytest.fixture(scope="session...
[((291, 340), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""', 'params': '[2, 3, 4]'}), "(scope='session', params=[2, 3, 4])\n", (305, 340), False, 'import pytest\n'), ((679, 710), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (693, 710), False, 'import ...
rafagarciac/ParallelProgrammingPython
Concurrent/PipelineDecomposingTask.py
bba91984018688f41049fd63961d3b8872876336
#!/usr/bin/env python """ Artesanal example Pipe without Pipe class. """ __author__ = "Rafael García Cuéllar" __email__ = "[email protected]" __copyright__ = "Copyright (c) 2018 Rafael García Cuéllar" __license__ = "MIT" from concurrent.futures import ProcessPoolExecutor import time import random def worker(arg):...
[((336, 351), 'random.random', 'random.random', ([], {}), '()\n', (349, 351), False, 'import random\n'), ((695, 717), 'concurrent.futures.ProcessPoolExecutor', 'ProcessPoolExecutor', (['(2)'], {}), '(2)\n', (714, 717), False, 'from concurrent.futures import ProcessPoolExecutor\n'), ((934, 949), 'random.random', 'random...
roaet/digibujogens
src/digibujogens/__main__.py
ab154edda69c091595902dd8b2e3fd273b2e7105
""" Main application entry point. python -m digibujogens ... """ def main(): """ Execute the application. """ raise NotImplementedError # Make the script executable. if __name__ == "__main__": raise SystemExit(main())
[]
mrkajetanp/lisa
lisa/target.py
15cfbc430f46b59f52a9d13769d0f6791ed6f154
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2018, ARM Limited and contributors. # # 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 # # ...
[((1739, 1775), 'lisa.utils.import_all_submodules', 'import_all_submodules', (['devlib.module'], {}), '(devlib.module)\n', (1760, 1775), False, 'from lisa.utils import Loggable, HideExekallID, resolve_dotted_name, get_subclasses, import_all_submodules, LISA_HOME, RESULT_DIR, LATEST_LINK, setup_logging, ArtifactPath, nu...
EasonC13/iota.py
iota/commands/core/get_node_info.py
f596c1ac0d9bcbceda1cf6109cd921943a6599b3
import filters as f from iota import TransactionHash, Address from iota.commands import FilterCommand, RequestFilter, ResponseFilter from iota.filters import Trytes __all__ = [ 'GetNodeInfoCommand', ] class GetNodeInfoCommand(FilterCommand): """ Executes `getNodeInfo` command. See :py:meth:`iota.ap...
[((1003, 1033), 'filters.ByteString', 'f.ByteString', ([], {'encoding': '"""ascii"""'}), "(encoding='ascii')\n", (1015, 1033), True, 'import filters as f\n'), ((1036, 1051), 'iota.filters.Trytes', 'Trytes', (['Address'], {}), '(Address)\n', (1042, 1051), False, 'from iota.filters import Trytes\n'), ((1100, 1130), 'filt...
Juandiegordp/TPI
Aplicacion/Presentacion/views.py
427266f00745e9d9678110c1d01d3be4febca673
from Negocio import controller import forms, functions from flask import Flask, render_template, request, redirect, url_for, flash def register(mysql, request): registerForm= forms.RegisterForm(request.form) if request.method == 'POST' and registerForm.validate(): return controller.registraUsuario(mysql...
[((182, 214), 'forms.RegisterForm', 'forms.RegisterForm', (['request.form'], {}), '(request.form)\n', (200, 214), False, 'import forms, functions\n'), ((355, 406), 'flask.render_template', 'render_template', (['"""register.html"""'], {'form': 'registerForm'}), "('register.html', form=registerForm)\n", (370, 406), False...
heartexlabs/label-studio-evalme
evalme/tests/test_old_format.py
48f7a5226346b6e074edb4717b84122cc089bc7a
from evalme.matcher import Matcher def test_old_format_agreement_matrix(): m = Matcher(new_format=False) m.load(r"./tests/test_data/test_old_format.json") matrix = m.get_annotations_agreement() assert matrix is not None assert matrix > 0 def test_old_format_load(): m = Matcher(new_format=Fa...
[((85, 110), 'evalme.matcher.Matcher', 'Matcher', ([], {'new_format': '(False)'}), '(new_format=False)\n', (92, 110), False, 'from evalme.matcher import Matcher\n'), ((299, 324), 'evalme.matcher.Matcher', 'Matcher', ([], {'new_format': '(False)'}), '(new_format=False)\n', (306, 324), False, 'from evalme.matcher import ...
wombat70/behave
behave/runner.py
c54493b0531795d946ac6754bfc643248cf3056a
# -*- coding: UTF-8 -*- """ This module provides Runner class to run behave feature files (or model elements). """ from __future__ import absolute_import, print_function, with_statement import contextlib import os.path import sys import warnings import weakref import six from behave._types import ExceptionUtil from...
[((5457, 5478), 'weakref.proxy', 'weakref.proxy', (['runner'], {}), '(runner)\n', (5470, 5478), False, 'import weakref\n'), ((6802, 6838), 'traceback.print_exc', 'traceback.print_exc', ([], {'file': 'sys.stdout'}), '(file=sys.stdout)\n', (6821, 6838), False, 'import traceback\n'), ((9702, 9798), 'warnings.warn', 'warni...
genfifth/generative-design_Code-Package-Python-Mode
01_P/P_2_1_1_02/main.py
93fc8435933aa2e9329de77a1177bb34e63dd1c4
add_library('pdf') import random from datetime import datetime tileCount = 20 def setup(): global savePDF, actStrokeCap, actRandomSeed, colorLeft, colorRight, alphaLeft, alphaRight savePDF = False actStrokeCap = ROUND actRandomSeed = 0 colorLeft = color(197, 0, 123) colorRight = color(87, 35,...
[((648, 674), 'random.seed', 'random.seed', (['actRandomSeed'], {}), '(actRandomSeed)\n', (659, 674), False, 'import random\n'), ((1487, 1512), 'random.randint', 'random.randint', (['(0)', '(100000)'], {}), '(0, 100000)\n', (1501, 1512), False, 'import random\n'), ((865, 885), 'random.randint', 'random.randint', (['(0)...
peiwangdb/dbt
core/dbt/contracts/graph/manifest.py
30e72bc5e2ae950ddf0a1230b0c6406b889bea1a
import enum from dataclasses import dataclass, field from itertools import chain, islice from mashumaro import DataClassMessagePackMixin from multiprocessing.synchronize import Lock from typing import ( Dict, List, Optional, Union, Mapping, MutableMapping, Any, Set, Tuple, TypeVar, Callable, Iterable, Generic, ...
[((11468, 11502), 'typing.TypeVar', 'TypeVar', (['"""M"""'], {'bound': 'MacroCandidate'}), "('M', bound=MacroCandidate)\n", (11475, 11502), False, 'from typing import Dict, List, Optional, Union, Mapping, MutableMapping, Any, Set, Tuple, TypeVar, Callable, Iterable, Generic, cast, AbstractSet, ClassVar\n'), ((12186, 12...
opengauss-mirror/Yat
openGaussBase/testcase/SQL/DCL/Alter_Default_Privileges/Opengauss_Function_Alter_Default_Privileges_Case0016.py
aef107a8304b94e5d99b4f1f36eb46755eb8919e
""" Copyright (c) 2022 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W...
[((1262, 1299), 'sys.path.append', 'sys.path.append', (["(sys.path[0] + '/../')"], {}), "(sys.path[0] + '/../')\n", (1277, 1299), False, 'import sys\n'), ((1440, 1448), 'testcase.utils.Logger.Logger', 'Logger', ([], {}), '()\n', (1446, 1448), False, 'from testcase.utils.Logger import Logger\n'), ((1460, 1478), 'testcas...
ryanbsaunders/phantom-apps
Apps/phdigitalshadows/dsapi/service/infrastructure_service.py
1befda793a08d366fbd443894f993efb1baf9635
# File: infrastructure_service.py # # Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) # from .ds_base_service import DSBaseService from .ds_find_service import DSFindService from ..model.infrastructure import Infrastructure class InfrastructureService(DSFindService): def __init__(se...
[]
NCBI-Codeathons/Identify-antiphage-defense-systems-in-the-bacterial-pangenome
src/find_genes_by_location/find_genes_by_location.py
b1eb83118268ada50e90f979347e47e055a51029
import argparse from collections import defaultdict import csv from dataclasses import dataclass, field from enum import Enum, unique, auto import os import sys import tempfile import yaml import zipfile import gffutils from google.protobuf import json_format from ncbi.datasets.v1alpha1 import dataset_catalog_pb2 from...
[((1509, 1526), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1520, 1526), False, 'from collections import defaultdict\n'), ((1916, 1948), 'os.path.join', 'os.path.join', (['path', 'f"""{acc}.zip"""'], {}), "(path, f'{acc}.zip')\n", (1928, 1948), False, 'import os\n'), ((1956, 1977), 'os.path.i...
tOverney/ADA-Project
web/backend/backend_django/apps/capacity/models.py
69221210b1f4f13f6979123c6a7a1a9813ea18e5
from django.db import models from multigtfs.models import ( Block, Fare, FareRule, Feed, Frequency, Route, Service, ServiceDate, Shape, ShapePoint, Stop, StopTime, Trip, Agency) class Path(models.Model): trip = models.ForeignKey(Trip) stop = models.ForeignKey(Stop) path = models.CharField(max_len...
[((226, 249), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Trip'], {}), '(Trip)\n', (243, 249), False, 'from django.db import models\n'), ((261, 284), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Stop'], {}), '(Stop)\n', (278, 284), False, 'from django.db import models\n'), ((296, 352), 'django.db.m...
rainydaygit/testtcloudserver
apps/interface/settings/config.py
8037603efe4502726a4d794fb1fc0a3f3cc80137
try: from public_config import * except ImportError: pass PORT = 9028 SERVICE_NAME = 'interface'
[]
farnswj1/PokemonAPI
api/api/pokemon/views.py
b6fc4dfe8c0fde6b4560455dd37e61b6a0d2ea27
from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_page from rest_framework.generics import ( ListAPIView, RetrieveAPIView, CreateAPIView, UpdateAPIView, DestroyAPIView ) from .models import Pokemon from .serializers import PokemonSerializer from .fi...
[((557, 573), 'django.views.decorators.cache.cache_page', 'cache_page', (['(7200)'], {}), '(7200)\n', (567, 573), False, 'from django.views.decorators.cache import cache_page\n'), ((821, 837), 'django.views.decorators.cache.cache_page', 'cache_page', (['(7200)'], {}), '(7200)\n', (831, 837), False, 'from django.views.d...
sma-de/ansible-collections-gitlab
plugins/action/normalize_gitlab_cfg.py
5da99b04722fc016d3e8589635fcbb3579dcfda2
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.errors import AnsibleOptionsError from ansible.module_utils.six import iteritems, string_types from ansible_collections.smabot.base.plugins.module_utils.plugins.config_normalizing.base import ConfigNormalizerBaseMer...
[((777, 818), 'ansible_collections.smabot.base.plugins.module_utils.utils.dicting.get_subdict', 'get_subdict', (['cfg', 'tmp'], {'default_empty': '(True)'}), '(cfg, tmp, default_empty=True)\n', (788, 818), False, 'from ansible_collections.smabot.base.plugins.module_utils.utils.dicting import setdefault_none, SUBDICT_ME...
clodonil/pipeline_aws_custom
microservices/validate/tools/dynamodb.py
8ca517d0bad48fe528461260093f0035f606f9be
""" Tools de integração com o Dynamodb """ import boto3 import botocore import logging import datetime import json import copy import time import os class DyConnect: def __init__(self, table, region): self.table = table self.region = region def connect(self): try: dydb = b...
[((319, 370), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {'region_name': 'self.region'}), "('dynamodb', region_name=self.region)\n", (333, 370), False, 'import boto3\n'), ((519, 571), 'logging.CRITICAL', 'logging.CRITICAL', (['"""Problema na conexao com DynamoDB"""'], {}), "('Problema na conexao com Dynam...
LZC6244/scrapy_ddiy
scrapy_ddiy/spiders/GlidedSky/glided_sky_001.py
1bf7cdd382afd471af0bf7069b377fb364dc4730
# -*- coding: utf-8 -*- from scrapy import Request from scrapy_ddiy.utils.spiders.ddiy_base import DdiyBaseSpider class GlidedSky001Spider(DdiyBaseSpider): name = 'glided_sky_001' description = 'GlidedSky 爬虫-基础1' start_url = 'http://www.glidedsky.com/level/web/crawler-basic-1' custom_settings = { ...
[((549, 597), 'scrapy.Request', 'Request', ([], {'url': 'self.start_url', 'callback': 'self.parse'}), '(url=self.start_url, callback=self.parse)\n', (556, 597), False, 'from scrapy import Request\n')]
google/joint_vae
datasets/celeba/celeba_dataset.py
984f456d1a38c6b27e23433aef241dea56f53384
# # Copyright 2017 Google Inc. # # 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 writin...
[((3721, 3774), 'os.path.join', 'os.path.join', (['dataset_dir', '"""attribute_label_map.json"""'], {}), "(dataset_dir, 'attribute_label_map.json')\n", (3733, 3774), False, 'import os\n'), ((3835, 3888), 'os.path.join', 'os.path.join', (['dataset_dir', '(_FILE_PATTERN % split_name)'], {}), '(dataset_dir, _FILE_PATTERN ...
kan-s0/JORLDY
jorldy/manager/log_manager.py
44989cf415196604a1ad0383b34085dee6bb1c51
import os import datetime, time import imageio from pygifsicle import optimize from torch.utils.tensorboard import SummaryWriter class LogManager: def __init__(self, env, id, experiment=None): self.id = id now = datetime.datetime.now().strftime("%Y%m%d%H%M%S%f") self.path = ( ...
[((464, 488), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', (['self.path'], {}), '(self.path)\n', (477, 488), False, 'from torch.utils.tensorboard import SummaryWriter\n'), ((510, 521), 'time.time', 'time.time', ([], {}), '()\n', (519, 521), False, 'import datetime, time\n'), ((1102, 1153), 'os.path.join', ...
multi-service-fabric/element-manager
lib/SeparateDriver/ASRDriverParts/UNIInterface.py
e550d1b5ec9419f1fb3eb6e058ce46b57c92ee2f
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2019 Nippon Telegraph and Telephone Corporation # Filename: ASRDriverParts/UNIInterface.py ''' Parts Module for ASR driver UNI interface configuraton ''' import GlobalModule from EmCommonLog import decorater_log from ASRDriverParts.InterfaceBase im...
[((1985, 2063), 'GlobalModule.EM_LOGGER.debug', 'GlobalModule.EM_LOGGER.debug', (["('uni if command = %s' % (self._tmp_add_command,))"], {}), "('uni if command = %s' % (self._tmp_add_command,))\n", (2013, 2063), False, 'import GlobalModule\n')]
AnthonyQuantum/open_model_zoo
tools/accuracy_checker/accuracy_checker/annotation_converters/mnist.py
7d235755e2d17f6186b11243a169966e4f05385a
""" Copyright (c) 2019 Intel Corporation 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,...
[((5319, 5337), 'numpy.zeros', 'np.zeros', (['(28, 28)'], {}), '((28, 28))\n', (5327, 5337), True, 'import numpy as np\n')]
davidbrownell/Common_EnvironmentEx
Libraries/Python/wxGlade/v0.9,5/wxGlade-0.9.5-py3.6.egg/wxglade/bugdialog.py
9e20b79b4de0cb472f65ac08b3de83f9ed8e2ca3
"""\ Dialog to show details of internal errors. @copyright: 2014-2016 Carsten Grohmann @copyright: 2017 Dietmar Schwertberger @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """ import bugdialog_ui import config import log import logging import sys import wx class BugReport(bugdialog_ui.UIBug...
[((550, 603), 'bugdialog_ui.UIBugDialog.__init__', 'bugdialog_ui.UIBugDialog.__init__', (['self', 'None', '(-1)', '""""""'], {}), "(self, None, -1, '')\n", (583, 603), False, 'import bugdialog_ui\n'), ((1059, 1085), 'log.exception_orig', 'log.exception_orig', (['header'], {}), '(header)\n', (1077, 1085), False, 'import...
Neelamegam2000/QRcode-for-license
core/views.py
a6d4c9655c5ba52b24c1ea737797557f06e0fcbf
from django.shortcuts import render, redirect from django.conf import settings from django.core.files.storage import FileSystemStorage,default_storage from django.core.mail import send_mail, EmailMessage from core.models import Document from core.forms import DocumentForm from django.contrib import messages import os...
[((475, 497), 'core.models.Document.objects.all', 'Document.objects.all', ([], {}), '()\n', (495, 497), False, 'from core.models import Document\n'), ((509, 563), 'django.shortcuts.render', 'render', (['request', '"""home.html"""', "{'documents': documents}"], {}), "(request, 'home.html', {'documents': documents})\n", ...
nonprofittechy/docassemble-MACourts
docassemble/MACourts/__init__.py
6035393a09cff3e8a371f19b79d1cde3a60691c1
__version__ = '0.0.58.2'
[]
Meat0Project/ChatBot
main.py
35ebadc71b100d861f9c9e211e1e751175f47c50
''' Made by - Aditya mangal Purpose - Python mini project Date - 18 october 2020 ''' from chatterbot import ChatBot from chatterbot.trainers import ChatterBotCorpusTrainer form termcolor import cprint import time chatbot = ChatBot('Bot') trainer = ChatterBotCorpusTrainer(chatbot) trainer.train('chatterbot.corpus.eng...
[]
Jeffreyo3/AdventOfCode2020
challenges/day14.py
8705847a04885d6489eb11acfddf2ff5702d8927
""" --- Day 14: Docking Data --- As your ferry approaches the sea port, the captain asks for your help again. The computer system that runs this port isn't compatible with the docking program on the ferry, so the docking parameters aren't being correctly initialized in the docking program's memory. After a brief inspe...
[]
Lovely-XPP/tkzgeom
src/Dialogs/RegularPolygonDialog.py
bf68e139dc05f759542d6611f4dc07f4f2727b92
from PyQt5 import QtWidgets, uic from Factory import Factory from Dialogs.DialogMacros import turn_into_free_point, free_point_checkbox from Fill.ListWidget import fill_listWidget_with_data, set_selected_id_in_listWidget import Constant as c class RegularPolygonDialog(QtWidgets.QDialog): def __init__(self, scene...
[((446, 483), 'PyQt5.uic.loadUi', 'uic.loadUi', (['"""regularpolygon.ui"""', 'self'], {}), "('regularpolygon.ui', self)\n", (456, 483), False, 'from PyQt5 import QtWidgets, uic\n'), ((1820, 1862), 'Factory.Factory.create_empty_item', 'Factory.create_empty_item', (['"""polygon"""', 'None'], {}), "('polygon', None)\n", (...
UCY-LINC-LAB/5G-Slicer
tests/test_networks.py
41e75a6709bc779cb4f3e08484b9ada3911646ed
import unittest from networks.QoS import QoS from networks.connections.mathematical_connections import FunctionalDegradation from networks.slicing import SliceConceptualGraph from utils.location import Location class TestBaseStationLinear(unittest.TestCase): def setUp(self): self.name = "network" ...
[((1054, 1144), 'networks.slicing.SliceConceptualGraph', 'SliceConceptualGraph', (['self.name', 'self.midhaul_qos', 'self.backhaul_qos', 'self.parameters'], {}), '(self.name, self.midhaul_qos, self.backhaul_qos, self.\n parameters)\n', (1074, 1144), False, 'from networks.slicing import SliceConceptualGraph\n'), ((54...