repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 680k |
|---|---|---|---|---|
xhchrn/open_lth | datasets/imagenet.py | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import concurrent.futures
import numpy as np
import os
from PIL import Image
import torchvision
from datasets import base
from platforms.platf... | [((397, 423), 'os.path.join', 'os.path.join', (['root', 'y_name'], {}), '(root, y_name)\n', (409, 423), False, 'import os\n'), ((489, 511), 'os.path.join', 'os.path.join', (['y_dir', 'f'], {}), '(y_dir, f)\n', (501, 511), False, 'import os\n'), ((1375, 1393), 'numpy.array', 'np.array', (['examples'], {}), '(examples)\n... |
ZelKnow/sm4 | sm4.py | 2bb232f46a5033b2d89ce097e004e53eb13d90d8 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : sm4.py
@Description : sm4加密算法的实现
@Date : 2021/10/28 15:59:51
@Author : ZelKnow
@Github : https://github.com/ZelKnow
"""
__author__ = "ZelKnow"
from argparse import ArgumentParser, ArgumentError
from binascii import hexlify, u... | [((6573, 6609), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""SM4加解密"""'}), "(description='SM4加解密')\n", (6587, 6609), False, 'from argparse import ArgumentParser, ArgumentError\n'), ((4261, 4293), 'utils.bytes_to_list', 'bytes_to_list', (['input', 'BLOCK_BYTE'], {}), '(input, BLOCK_BYTE)\n', (42... |
saadmk11/sendotp-python | sendotp/sendotp.py | b0cd5c3da969d00a753d9614c5bea0e2978859c9 | import json
import requests
from random import randint
class sendotp:
def __init__(self, key, msg):
self.baseUrl = "http://control.msg91.com"
self.authkey = key
try:
msg
except NameError:
self.msg = "Your otp is {{otp}}. Please do not share it with anybod... | [((587, 606), 'random.randint', 'randint', (['(1000)', '(9999)'], {}), '(1000, 9999)\n', (594, 606), False, 'from random import randint\n'), ((1637, 1683), 'requests.post', 'requests.post', (['url'], {'data': 'payload', 'verify': '(False)'}), '(url, data=payload, verify=False)\n', (1650, 1683), False, 'import requests\... |
tjeubaoit/algorithm | leetcode/1021-remove-outermost-parentheses.py | a1f2a30e0f736cc3d8b45ed845f724b9a4ed2e9a | class Solution:
def removeOuterParentheses(self, s: str) -> str:
ans = []
ct = 0
for ch in s:
if ch == '(':
ct += 1
if ct != 1:
ans.append(ch)
else:
ct -= 1
if ct != 0:
... | [] |
SamuelNunesDev/starting_point_in_python | venv/Scripts/ex049.py | 9a9e39cabb5f3526ee0037012e3943898c1d9dfa | n = int(input('Digite um número para ver sua tabuada: '))
for c in range(0, 11):
print(f'{n} * {c} = {n * c}')
| [] |
inprod/Js2Py | js2py/evaljs.py | 0af8cb100b7840e23358d220c685507163f2344e | # coding=utf-8
from .translators import translate_js, DEFAULT_HEADER
from .es6 import js6_to_js5
import sys
import time
import json
import six
import os
import hashlib
import codecs
__all__ = [
'EvalJs', 'translate_js', 'import_js', 'eval_js', 'translate_file',
'eval_js6', 'translate_js6', 'run_file', 'disable... | [((530, 549), 'os.path.isabs', 'os.path.isabs', (['path'], {}), '(path)\n', (543, 549), False, 'import os\n'), ((617, 628), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (626, 628), False, 'import os\n'), ((5416, 5438), 'six.iteritems', 'six.iteritems', (['context'], {}), '(context)\n', (5429, 5438), False, 'import six\n... |
mvduin/py-uio | setup.py | 1ad5eb6e1cfeae722535fd6ed7e485a0afd84683 | #!/usr/bin/python3
from setuptools import setup, find_packages
setup(
package_dir = { '': 'src' },
packages = find_packages( where='src' ),
)
| [((120, 146), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (133, 146), False, 'from setuptools import setup, find_packages\n')] |
FabriSC/Alioth-SC | tools/verity_utils.py | bbe9723401b351c2a34b09a30978373d456d20a2 | #!/usr/bin/env python
#
# Copyright (C) 2018 The Android Open Source Project
#
# 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 req... | [((794, 821), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (811, 821), False, 'import logging\n'), ((1215, 1259), 'common.RunAndCheckOutput', 'common.RunAndCheckOutput', (['cmd'], {'verbose': '(False)'}), '(cmd, verbose=False)\n', (1239, 1259), False, 'import common\n'), ((1382, 1426), ... |
tkf/orgviz | orgviz/dones.py | 81a436265daa1fb8294a0186f50df76d9599ae38 | #!/usr/bin/env python
"""org archive to html table converter"""
import os
import datetime
import itertools
from .utils.date import minutestr, total_minutes
def rootname_from_archive_olpath(node):
"""
Find rootname from ARCHIVE_OLPATH property.
Return None if not found.
"""
olpath = node.get_prop... | [((2029, 2051), 'os.path.basename', 'os.path.basename', (['path'], {}), '(path)\n', (2045, 2051), False, 'import os\n'), ((3920, 3974), 'itertools.islice', 'itertools.islice', (['(row for key, row in key_table)', 'num'], {}), '((row for key, row in key_table), num)\n', (3936, 3974), False, 'import itertools\n')] |
ravikumarvc/incubator-tvm | tests/python/unittest/test_lang_tag.py | 9826947ffce0ed40e9d47a0db2abb033e394279e | # 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... | [((810, 835), 'tvm.tag_scope', 'tvm.tag_scope', ([], {'tag': '"""conv"""'}), "(tag='conv')\n", (823, 835), False, 'import tvm\n'), ((981, 1016), 'tvm.reduce_axis', 'tvm.reduce_axis', (['(0, IC)'], {'name': '"""ic"""'}), "((0, IC), name='ic')\n", (996, 1016), False, 'import tvm\n'), ((1026, 1061), 'tvm.reduce_axis', 'tv... |
scwolof/doepy | doepy/case_studies/discrete_time/MSFB2014.py | acb2cad95428de2c14b28563cff1aa30679e1f39 | """
MIT License
Copyright (c) 2019 Simon Olofsson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish... | [((1520, 1547), 'numpy.linspace', 'np.linspace', (['(0)', 'self.dt', '(51)'], {}), '(0, self.dt, 51)\n', (1531, 1547), True, 'import numpy as np\n'), ((1554, 1569), 'scipy.integrate.odeint', 'odeint', (['f', 'x', 't'], {}), '(f, x, t)\n', (1560, 1569), False, 'from scipy.integrate import odeint\n'), ((2208, 2242), 'num... |
mukobi/Pozyx-Gabe | house_code/tutorials_altered/3D_positioning_and_orientation.py | a8b444c2013b1df5043cd25106b72562409b5130 | #!/usr/bin/env python
"""
The pozyx ranging demo (c) Pozyx Labs
please check out https://www.pozyx.io/Documentation/Tutorials/getting_started/Python
This demo requires one (or two) pozyx shields. It demonstrates the 3D orientation and the functionality
to remotely read register data from a pozyx device. Connect one of... | [((8855, 8877), 'modules.user_input_config_functions.UserInputConfigFunctions.use_remote', 'UserInput.use_remote', ([], {}), '()\n', (8875, 8877), True, 'from modules.user_input_config_functions import UserInputConfigFunctions as UserInput\n'), ((8894, 8925), 'modules.user_input_config_functions.UserInputConfigFunction... |
Jasper912/jupyter-hdfs-kernel | hdfs_kernel/exceptions.py | 4b933cab675cb908a1d2332f040c7fce697fce61 | #!/usr/bin/env python
# -*- coding=utf-8 -*-
#
# Author: huangnj
# Time: 2019/09/27
import traceback
from functools import wraps
from hdfs_kernel.constants import EXPECTED_ERROR_MSG, INTERNAL_ERROR_MSG
from hdfs.util import HdfsError
# == EXCEPTIONS ==
class SessionManagementException(Exception):
pass
class Comm... | [((1339, 1347), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (1344, 1347), False, 'from functools import wraps\n'), ((2314, 2322), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (2319, 2322), False, 'from functools import wraps\n'), ((1598, 1628), 'hdfs_kernel.constants.EXPECTED_ERROR_MSG.format', 'EXPECTED_ERR... |
vishalvvr/transtats | dashboard/tests/test_inventory.py | ec71f40b338cab36eb907f6faba262dfeb858b80 | # Copyright 2017 Red Hat, 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... | [((1094, 1112), 'dashboard.managers.inventory.InventoryManager', 'InventoryManager', ([], {}), '()\n', (1110, 1112), False, 'from dashboard.managers.inventory import InventoryManager\n'), ((1004, 1020), 'fixture.style.NamedDataStyle', 'NamedDataStyle', ([], {}), '()\n', (1018, 1020), False, 'from fixture.style import N... |
nolanliou/fedlearner | web_console_v2/api/fedlearner_webconsole/rpc/server.py | 54127c465b3b5d77ae41b823e42efbc1b707e826 | # Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [((3268, 3284), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (3282, 3284), False, 'import threading\n'), ((4173, 4214), 'logging.debug', 'logging.debug', (['"""auth_info: %s"""', 'auth_info'], {}), "('auth_info: %s', auth_info)\n", (4186, 4214), False, 'import logging\n'), ((4353, 4393), 'fedlearner_webconsole... |
haru-256/ExpertPython3_Source | chapter15/async_aiohttp.py | 5ef412ef217c6078248ff9546e23ed9b69aadcff | """
「非同期プログラミング」の節で登場するサンプルコード
aiohttpを使って非同期にHTTPのリクエストを送信する方法
"""
import asyncio
import time
import aiohttp
from asyncrates import get_rates
SYMBOLS = ('USD', 'EUR', 'PLN', 'NOK', 'CZK')
BASES = ('USD', 'EUR', 'PLN', 'NOK', 'CZK')
async def fetch_rates(session, place):
return await get_rates(session, place)... | [((788, 799), 'time.time', 'time.time', ([], {}), '()\n', (797, 799), False, 'import time\n'), ((811, 835), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (833, 835), False, 'import asyncio\n'), ((295, 320), 'asyncrates.get_rates', 'get_rates', (['session', 'place'], {}), '(session, place)\n', (3... |
OleksiiOleksenko/intel_mpx_explained | experiments/nginx/run.py | dd6da57e0fcf22df358d1a742079b414620a7c88 | #!/usr/bin/env python
from __future__ import print_function
import logging
import os
import signal
from time import sleep
from subprocess import Popen, PIPE
import socket
from core.common_functions import *
from core.run import Runner
class NginxPerf(Runner):
"""
Runs Nginx
"""
name = "nginx"
e... | [((1943, 1990), 'logging.debug', 'logging.debug', (["('Server command: %s' % servercmd)"], {}), "('Server command: %s' % servercmd)\n", (1956, 1990), False, 'import logging\n'), ((4304, 4356), 'logging.info', 'logging.info', (["('Total runs: %d' % self.num_benchmarks)"], {}), "('Total runs: %d' % self.num_benchmarks)\n... |
verdammelt/tavi | tavi/test/unit/base/document_no_fields_test.py | 3bb39a6e6ab936f6e9511a4058817697e3df098b | # -*- coding: utf-8 -*-
import unittest
from tavi.base.documents import BaseDocument
class BaseDocumentNoFieldsTest(unittest.TestCase):
class NoFieldsSample(BaseDocument):
pass
def setUp(self):
super(BaseDocumentNoFieldsTest, self).setUp()
self.no_fields_sample = self.NoFieldsSample()... | [] |
hoafaloaf/seqparse | seqparse/test/test_seqparse.py | 1d2446070c5627a5cb880d00ef327b892b4dedef | """Test file sequence discovery on disk."""
# "Future" Libraries
from __future__ import print_function
# Standard Libraries
import os
import unittest
# Third Party Libraries
import mock
from builtins import range
from future.utils import lrange
from . import (DirEntry, generate_entries, initialise_mock_scandir_data... | [((963, 1002), 'mock.patch', 'mock.patch', (['"""seqparse.seqparse.scandir"""'], {}), "('seqparse.seqparse.scandir')\n", (973, 1002), False, 'import mock\n'), ((2087, 2126), 'mock.patch', 'mock.patch', (['"""seqparse.seqparse.scandir"""'], {}), "('seqparse.seqparse.scandir')\n", (2097, 2126), False, 'import mock\n'), (... |
ragreener1/deliveroo-scraping | deliveroo_scraping.py | c8e3de2503a6198734904fb937a77dd38ef05581 | import urllib.request
import pandas as pd
import sqlite3
import re
from bs4 import BeautifulSoup
# Parameters
postcodes_list = ["W1F7EY"]
db_name = "scraped.db"
# This is so that Deliveroo think the scraper is Google Chrome
# as opposed to a web scraper
hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWeb... | [((9494, 9513), 'bs4.BeautifulSoup', 'BeautifulSoup', (['page'], {}), '(page)\n', (9507, 9513), False, 'from bs4 import BeautifulSoup\n'), ((10606, 10632), 'pandas.DataFrame', 'pd.DataFrame', (["{'name': []}"], {}), "({'name': []})\n", (10618, 10632), True, 'import pandas as pd\n'), ((11951, 11975), 'sqlite3.connect', ... |
AlexandruGhergut/wouso | wouso/core/security/admin.py | f26244ff58ae626808ae8c58ccc93d21f9f2666f | from django.contrib import admin
from wouso.core.security.models import Report
admin.site.register(Report)
| [((80, 107), 'django.contrib.admin.site.register', 'admin.site.register', (['Report'], {}), '(Report)\n', (99, 107), False, 'from django.contrib import admin\n')] |
diliprk/SmartCityVisualization | DataWrangling/TTNData2Gsheet_Auto.py | 618cd433c2f6bb55042c643ccaef12b5814ccb77 | #### Reading Data from The Things Network Data and Automatically Storing it to a Google Spreadsheet
# Author: Dilip Rajkumar
# Email: d.rajkumar@hbksaar.de
# Date: 19/01/2018
# Revision: version#1
# License: MIT License
import pandas as pd
import requests
from df2gspread import df2gspread as d2g
import time
## Set I... | [((1129, 1161), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['response'], {}), '(response)\n', (1151, 1161), True, 'import pandas as pd\n'), ((1477, 1511), 'pandas.to_datetime', 'pd.to_datetime', (["df['TTNTimeStamp']"], {}), "(df['TTNTimeStamp'])\n", (1491, 1511), True, 'import pandas as pd\n'), ((2074, 2... |
felliott/SHARE | tests/share/normalize/test_xml.py | 8fd60ff4749349c9b867f6188650d71f4f0a1a56 | import xmltodict
from share.transform.chain import * # noqa
EXAMPLE = '''
<entry>
<id>http://arxiv.org/abs/cond-mat/0102536v1</id>
<updated>2001-02-28T20:12:09Z</updated>
<published>2001-02-28T20:12:09Z</published>
<title>Impact of Electron-Electron Cusp
on Configuration Interaction Energies</t... | [((3939, 4087), 'xmltodict.parse', 'xmltodict.parse', (['EXAMPLE'], {'process_namespaces': '(True)', 'namespaces': "{'http://www.w3.org/2005/Atom': None, 'http://arxiv.org/schemas/atom': None}"}), "(EXAMPLE, process_namespaces=True, namespaces={\n 'http://www.w3.org/2005/Atom': None, 'http://arxiv.org/schemas/atom':... |
mysticfall/alleycat-reactive | alleycat/reactive/property.py | 69ff2f283627a6c613b084677be707234b29164c | from __future__ import annotations
from typing import TypeVar, Generic, Callable, Optional, Any, cast, Tuple
import rx
from returns import pipeline
from returns.functions import identity
from returns.maybe import Maybe, Nothing
from rx import Observable
from rx.subject import BehaviorSubject
from . import ReactiveVa... | [((371, 383), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (378, 383), False, 'from typing import TypeVar, Generic, Callable, Optional, Any, cast, Tuple\n'), ((2792, 2802), 'rx.empty', 'rx.empty', ([], {}), '()\n', (2800, 2802), False, 'import rx\n')] |
Siebjee/argo-workflows | sdks/python/client/openapi_client/model/github_com_argoproj_labs_argo_dataflow_api_v1alpha1_dedupe.py | 1a3b87bdf8edba02ba5e5aed20f3942be1d6f46c | """
Argo Server API
You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9` # noqa: E501
The version of the OpenAPI document: VERSION
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from ... | [((8994, 9207), 'openapi_client.model_utils.ApiTypeError', 'ApiTypeError', (["('Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments.'\n % (args, self.__class__.__name__))"], {'path_to_item': '_path_to_item', 'valid_classes': '(self.__class__,)'}), "(\n 'Invalid positional argu... |
csgcmai/cvat | utils/mask/converter.py | 074500de7bf638fdf66f3874b80df9e87d58a746 | #!/usr/bin/env python
#
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
from __future__ import absolute_import, division, print_function
import argparse
import os
import glog as log
import numpy as np
import cv2
from lxml import etree
from tqdm import tqdm
def parse_args():
"""Parse argu... | [((358, 466), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'fromfile_prefix_chars': '"""@"""', 'description': '"""Convert CVAT XML annotations to masks"""'}), "(fromfile_prefix_chars='@', description=\n 'Convert CVAT XML annotations to masks')\n", (381, 466), False, 'import argparse\n'), ((2382, 2437)... |
gkiar/pyAFQ | examples/plot_afq_callosal.py | fb6985c2a9715a378e1ca94dc89f6bc966c60ab5 | """
==========================
Callosal bundles using AFQ API
==========================
An example using the AFQ API to find callosal bundles using the templates from:
http://hdl.handle.net/1773/34926
"""
import os.path as op
import plotly
from AFQ import api
from AFQ.mask import RoiMask
import AFQ.data as afd
####... | [((523, 574), 'AFQ.data.organize_stanford_data', 'afd.organize_stanford_data', ([], {'clear_previous_afq': '(True)'}), '(clear_previous_afq=True)\n', (549, 574), True, 'import AFQ.data as afd\n'), ((2068, 2098), 'plotly.io.show', 'plotly.io.show', (['bundle_html[0]'], {}), '(bundle_html[0])\n', (2082, 2098), False, 'im... |
Soldie/Nscan-scanner-ip | latest/probe.py | 4a507ca97a9f8b7f3fa4766c835f108671dbbcd6 | import time
import Queue
import random
import socket
import struct
import logging
import threading
from convert import *
from protocol import ethernet, ip, tcp, udp
ETH_P_IP = 0x0800 # IP protocol
ETH_P_ALL = 0x0003 # Every packet
NSCRIPT_PATH = 'nscript' # NSCRIPT PATH
PAYLOAD = {
53:('\x5d\x0d\x01\x00\x00\x01\x00... | [] |
dstambler17/Parsy.io | parsy-backend/flaskApp/assignment/views.py | 14c4905809f79f191efbbbdfbd0e8d9e838478e7 | import sys
from flask import Blueprint, request, jsonify
from flaskApp import db
from flaskApp.assignment.utils import *
from flaskApp.error.error_handlers import *
import json
from flaskApp.helpers import getAssignmentData
assignment = Blueprint('assignment', __name__)
@assignment.route('/restoreAssignment/<calID>/<... | [((238, 271), 'flask.Blueprint', 'Blueprint', (['"""assignment"""', '__name__'], {}), "('assignment', __name__)\n", (247, 271), False, 'from flask import Blueprint, request, jsonify\n'), ((2024, 2051), 'flaskApp.helpers.getAssignmentData', 'getAssignmentData', (['courseID'], {}), '(courseID)\n', (2041, 2051), False, 'f... |
dharmik-thakkar/dsapatterns | python/patterns/slidingwindow/longest_substring_no_repeating_char.py | fc5890a86c5d49097b73b6afd14e1a4e81cff7a0 | #######################################################################################################################
# Given a string, find the length of the longest substring which has no repeating characters.
#
# Input: String="aabccbb"
# Output: 3
# Explanation: The longest substring without any repeating charact... | [] |
jrderek/Big_Data_Engineering_Portfolio | Apache Spark with Python - Big Data with PySpark and Spark/6-PairRDD/filter/AirportsNotInUsa.py | bf7a5efb24f2c6e860e5ead544dadc08f791814e | import sys
sys.path.insert(0, '.')
from pyspark import SparkContext, SparkConf
from commons.Utils import Utils
if __name__ == "__main__":
'''
Create a Spark program to read the airport data from in/airports.text;
generate a pair RDD with airport name being the key and country name being the v... | [((12, 35), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""."""'], {}), "(0, '.')\n", (27, 35), False, 'import sys\n'), ((918, 941), 'pyspark.SparkContext', 'SparkContext', ([], {'conf': 'conf'}), '(conf=conf)\n', (930, 941), False, 'from pyspark import SparkContext, SparkConf\n'), ((851, 862), 'pyspark.SparkConf',... |
srl295/keyman | linux/keyman-config/keyman_config/keyboard_details.py | 4dfd0f71f3f4ccf81d1badbd824900deee1bb6d1 | #!/usr/bin/python3
# Keyboard details window
import logging
import json
from os import path
import qrcode
import tempfile
import gi
from gi.repository import Gtk
from keyman_config import KeymanComUrl, _, secure_lookup
from keyman_config.accelerators import init_accel
from keyman_config.kmpmetadata import parsemeta... | [((326, 358), 'gi.require_version', 'gi.require_version', (['"""Gtk"""', '"""3.0"""'], {}), "('Gtk', '3.0')\n", (344, 358), False, 'import gi\n'), ((1169, 1212), 'gi.repository.Gtk.Dialog.__init__', 'Gtk.Dialog.__init__', (['self', 'wintitle', 'parent'], {}), '(self, wintitle, parent)\n', (1188, 1212), False, 'from gi.... |
ozsolarwind/SAM | build_osx/copy_runtime.py | 0967b0a4be8f8924ec1ad915a14575ac22c4ec3c | import os
import shutil
SOURCE_DIR = '../deploy/runtime'
TARGET_DIR = 'SAM.app/Contents/runtime'
if os.path.exists(TARGET_DIR):
shutil.rmtree(TARGET_DIR)
shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=shutil.ignore_patterns('.git'))
SOURCE_DIR = '../deploy/solar_resource'
TARGET_DIR = 'SAM.app/Contents/solar_re... | [((102, 128), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (116, 128), False, 'import os\n'), ((332, 358), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (346, 358), False, 'import os\n'), ((560, 586), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), ... |
kl-chou/codalab-worksheets | codalab/lib/path_util.py | 101d1d9f86d3f7b8dae3b4fc3e2335fcf8d7c3d7 | """
path_util contains helpers for working with local filesystem paths.
There are a few classes of methods provided here:
Functions to normalize paths and check that they are in normal form:
normalize, check_isvalid, check_isdir, check_isfile, path_is_url
Functions to list directories and to deal with subpath... | [((1180, 1213), 'codalab.common.UsageError', 'UsageError', (["(message + ': ' + path)"], {}), "(message + ': ' + path)\n", (1190, 1213), False, 'from codalab.common import precondition, UsageError, parse_linked_bundle_url\n'), ((2697, 2716), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (2710, 2716), Fa... |
aliavni/statsmodels | statsmodels/regression/tests/test_glsar_gretl.py | ef5d57a8d45de76a895e9401705280d558d688ad | # -*- coding: utf-8 -*-
"""Tests of GLSAR and diagnostics against Gretl
Created on Thu Feb 02 21:15:47 2012
Author: Josef Perktold
License: BSD-3
"""
import os
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal,
assert_allclose, assert_array_less)
from stats... | [((670, 740), 'numpy.testing.assert_almost_equal', 'assert_almost_equal', (['contrast_res.fvalue', 'other[0]'], {'decimal': 'decimal[0]'}), '(contrast_res.fvalue, other[0], decimal=decimal[0])\n', (689, 740), False, 'from numpy.testing import assert_almost_equal, assert_equal, assert_allclose, assert_array_less\n'), ((... |
tweeprint/api.tweeprint.com | core/views.py | 248525f2cffffb20765e7eca1e7a63f359adfc1b | import requests
import django.contrib.auth as auth
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse, JsonResponse, Http404
from django.contrib.auth.decorators import login_required
from django.core.serializers import serialize
from core.serializers import *
from core... | [((734, 789), 'django.http.HttpResponse', 'HttpResponse', (['category'], {'content_type': '"""application/json"""'}), "(category, content_type='application/json')\n", (746, 789), False, 'from django.http import HttpResponse, JsonResponse, Http404\n'), ((2534, 2563), 'django.http.HttpResponse', 'HttpResponse', (['"""POS... |
cdanielmachado/framed | src/framed/bioreactor/__init__.py | 36d56437685cbf5c7c3c8ee4f6d85b8f05f4d345 | from __future__ import absolute_import
__author__ = 'kaizhuang'
"""
Package implementing features for simulating bioreactor operation.
"""
from .base import Organism, Bioreactor
from .bioreactors import ANAEROBIC, AEROBIC, MICROAEROBIC
from .bioreactors import Bioreactor_ox, IdealBatch, IdealFedbatch
from framed.biore... | [] |
deperrone/content | shared/templates/coreos_kernel_option/template.py | caaff27f01a1d6c15da461f9fafe26090e8fdd18 | from ssg.utils import parse_template_boolean_value
def preprocess(data, lang):
data["arg_negate"] = parse_template_boolean_value(data, parameter="arg_negate", default_value=False)
data["arg_is_regex"] = parse_template_boolean_value(data, parameter="arg_is_regex", default_value=False)
return data
| [((106, 185), 'ssg.utils.parse_template_boolean_value', 'parse_template_boolean_value', (['data'], {'parameter': '"""arg_negate"""', 'default_value': '(False)'}), "(data, parameter='arg_negate', default_value=False)\n", (134, 185), False, 'from ssg.utils import parse_template_boolean_value\n'), ((213, 299), 'ssg.utils.... |
enicklas/pondus | pondus/backends/__init__.py | c94edce0351697c96f2ad046e8f602448d2e0df0 | # -*- coding: UTF-8 -*-
"""
This file is part of Pondus, a personal weight manager.
Copyright (C) 2011 Eike Nicklas <eike@ephys.de>
This program is free software licensed under the MIT license. For details
see LICENSE or http://www.opensource.org/licenses/mit-license.php
"""
__all__ = ['csv_backend', 'sportstracker... | [] |
specialprocedures/chpy | setup.py | 3bbe66da96abe95653722682754b4d48f9c8eba1 | import pathlib
from setuptools import find_packages, setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
# This call to setup() does all the work
setup(
name="chpy",
version="0.1.1",
descripti... | [((108, 130), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (120, 130), False, 'import pathlib\n'), ((789, 855), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['collections', 'time', 'math', 're', 'os']"}), "(exclude=['collections', 'time', 'math', 're', 'os'])\n", (802, 855), Fal... |
boblail/sentry | src/sentry/eventtypes/error.py | 71127331e58791d4651e480b65dd66f06cadc1c8 | from __future__ import absolute_import
import six
from sentry.utils.safe import get_path, trim
from sentry.utils.strings import truncatechars
from .base import BaseEvent
def get_crash_location(exception, platform=None):
default = None
for frame in reversed(get_path(exception, 'stacktrace', 'frames', filter... | [((901, 942), 'sentry.utils.safe.get_path', 'get_path', (['data', '"""exception"""', '"""values"""', '(-1)'], {}), "(data, 'exception', 'values', -1)\n", (909, 942), False, 'from sentry.utils.safe import get_path, trim\n'), ((1081, 1122), 'sentry.utils.safe.get_path', 'get_path', (['data', '"""exception"""', '"""values... |
Sultan91/keras-english-resume-parser-and-analyzer | keras_en_parser_and_analyzer/library/tests/test_detect_date.py | 221407cb0231e4c21f8edc61a2b19b74f9585d6a | from unittest import TestCase
from datetime import date
from keras_en_parser_and_analyzer.library.pipmp_my_cv_classify import detect_date
class DetectDate(TestCase):
def test_detect_date(self):
dates_to_test = ['10-1990', '09/12/2020', 'jan 1990', 'feb 2012', '9-12-2020']
res = detect_date(dates_t... | [((301, 330), 'keras_en_parser_and_analyzer.library.pipmp_my_cv_classify.detect_date', 'detect_date', (['dates_to_test[0]'], {}), '(dates_to_test[0])\n', (312, 330), False, 'from keras_en_parser_and_analyzer.library.pipmp_my_cv_classify import detect_date\n'), ((426, 455), 'keras_en_parser_and_analyzer.library.pipmp_my... |
google-admin/capirca | capirca/lib/ipset.py | 8c9e66456fedb3c0fc1c641dbefc41793e5c68d5 | # Copyright 2015 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... | [((1205, 1266), 'string.Template', 'string.Template', (['"""-A $filter -m comment --comment "$comment\\""""'], {}), '(\'-A $filter -m comment --comment "$comment"\')\n', (1220, 1266), False, 'import string\n'), ((1297, 1326), 'string.Template', 'string.Template', (['"""-A $filter"""'], {}), "('-A $filter')\n", (1312, 1... |
zhut19/straxen | straxen/analyses/records_matrix.py | 20dea986790ef168ba7052d652a7aa19ab836943 | import warnings
import numba
import numpy as np
import strax
import straxen
DEFAULT_MAX_SAMPLES = 20_000
@straxen.mini_analysis(requires=('records',),
warn_beyond_sec=10,
default_time_selection='touching')
def records_matrix(records, time_range, seconds_range, config, ... | [((111, 214), 'straxen.mini_analysis', 'straxen.mini_analysis', ([], {'requires': "('records',)", 'warn_beyond_sec': '(10)', 'default_time_selection': '"""touching"""'}), "(requires=('records',), warn_beyond_sec=10,\n default_time_selection='touching')\n", (132, 214), False, 'import straxen\n'), ((2754, 2864), 'stra... |
entropyx/fiduchain-blockchain-interface | bdbc/lib/python3.5/site-packages/bigchaindb_driver/crypto.py | 07336a5eebfaa9cddb148edb94461a8fd57562b1 | from collections import namedtuple
from cryptoconditions import crypto
CryptoKeypair = namedtuple('CryptoKeypair', ('signing_key', 'verifying_key'))
def generate_keypair():
"""Generates a cryptographic key pair.
Returns:
:class:`~bigchaindb_driver.crypto.CryptoKeypair`: A
:obj:`collections... | [((90, 151), 'collections.namedtuple', 'namedtuple', (['"""CryptoKeypair"""', "('signing_key', 'verifying_key')"], {}), "('CryptoKeypair', ('signing_key', 'verifying_key'))\n", (100, 151), False, 'from collections import namedtuple\n'), ((559, 593), 'cryptoconditions.crypto.ed25519_generate_key_pair', 'crypto.ed25519_g... |
mnoorenberghe/reviewboard | reviewboard/webapi/resources/change.py | b8ba9d662c250cb5ec704a50f619adbf3be8cbf0 | from __future__ import unicode_literals
from django.utils import six
from djblets.util.decorators import augment_method_from
from reviewboard.changedescs.models import ChangeDescription
from reviewboard.reviews.fields import get_review_request_field
from reviewboard.webapi.base import WebAPIResource
from reviewboard.... | [((3927, 3962), 'djblets.util.decorators.augment_method_from', 'augment_method_from', (['WebAPIResource'], {}), '(WebAPIResource)\n', (3946, 3962), False, 'from djblets.util.decorators import augment_method_from\n'), ((4118, 4153), 'djblets.util.decorators.augment_method_from', 'augment_method_from', (['WebAPIResource'... |
heminsatya/free_notes | controllers/notes/NewNote.py | 88272a34c48e60d1a82e28b0b2d56883fa724bb3 | # Dependencies
from aurora import Controller, View, Forms
from models import Users, Notes
from aurora.security import login_required, get_session
from flask import request
from datetime import datetime
# The controller class
class NewNote(Controller):
# POST Method
@login_required(app='users')
def post(se... | [((277, 304), 'aurora.security.login_required', 'login_required', ([], {'app': '"""users"""'}), "(app='users')\n", (291, 304), False, 'from aurora.security import login_required, get_session\n'), ((1662, 1689), 'aurora.security.login_required', 'login_required', ([], {'app': '"""users"""'}), "(app='users')\n", (1676, 1... |
udayraj-gupta/ga-learner-dsmp-repo | EDA-&-Data-Preprocessing/code.py | 90b16345fb3fd4f6f4f201012995eea7ff1e73e9 | # --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
data['Rating'].hist()
data = data[data['Rating']<=5]
data['Rating'].hist()
#Code ends here
# --------------
# code starts here
total_null = data.isnull().sum... | [((142, 159), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (153, 159), True, 'import pandas as pd\n'), ((392, 467), 'pandas.concat', 'pd.concat', (['[total_null, percent_null]'], {'axis': '(1)', 'keys': "['Total', 'Percentage']"}), "([total_null, percent_null], axis=1, keys=['Total', 'Percentage'])\n",... |
rguan-uoft/OpenPNM | openpnm/algorithms/ChargeConservation.py | b3873d35270b0acaad019264368d0055c677d159 | import numpy as np
from openpnm.algorithms import ReactiveTransport
from openpnm.models.physics import generic_source_term as gst
from openpnm.utils import logging
logger = logging.getLogger(__name__)
class ChargeConservation(ReactiveTransport):
r"""
A class to enforce charge conservation in ionic transport s... | [((173, 200), 'openpnm.utils.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (190, 200), False, 'from openpnm.utils import logging\n'), ((3600, 3630), 'numpy.isnan', 'np.isnan', (["self['pore.bc_rate']"], {}), "(self['pore.bc_rate'])\n", (3608, 3630), True, 'import numpy as np\n'), ((3552, ... |
Kosinkadink/jno | jno/commands/upload.py | 773806dd737c1ef0b0a89a7e4086da9c2c1260c1 | from jno.util import interpret_configs
from jno.util import run_arduino_process
from jno.util import create_build_directory
from jno.util import get_common_parameters
from jno.util import verify_arduino_dir
from jno.util import verify_and_get_port
from jno.util import JnoException
from jno.commands.command import Comma... | [((769, 788), 'jno.util.interpret_configs', 'interpret_configs', ([], {}), '()\n', (786, 788), False, 'from jno.util import interpret_configs\n'), ((791, 819), 'jno.util.verify_arduino_dir', 'verify_arduino_dir', (['jno_dict'], {}), '(jno_dict)\n', (809, 819), False, 'from jno.util import verify_arduino_dir\n'), ((822,... |
rizwan09/hydra-sum | modelling/inference_multi_attribute.py | 42088dde4e2b109fdb222ad4c329ca7bbfe9db2f | import argparse
import json
import logging
import os
import torch
from transformers.file_utils import ModelOutput
from typing import Dict, Optional, Tuple
from torch.utils.data import DataLoader, SequentialSampler
from transformers.modeling_outputs import Seq2SeqLMOutput
import train_seq2seq_utils
import single_head_ut... | [((564, 591), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (581, 591), False, 'import logging\n'), ((5969, 6000), 'torch.utils.data.SequentialSampler', 'SequentialSampler', (['eval_dataset'], {}), '(eval_dataset)\n', (5986, 6000), False, 'from torch.utils.data import DataLoader, Sequent... |
andkononykhin/plenum | stp_core/common/logging/handlers.py | 28dc1719f4b7e80d31dafbadb38cfec4da949886 | import logging
class CallbackHandler(logging.Handler):
def __init__(self, typestr, default_tags, callback, override_tags):
"""
Initialize the handler.
"""
super().__init__()
self.callback = callback
self.tags = default_tags
self.update_tags(override_tags or ... | [] |
Amohammadi2/django-SPA-blog | blog/migrations/__init__.py | 5dc10894ba360569b4849cfda0c3340ea5a15fb8 | # you just need to add some informations here
| [] |
iqtek/amocrn_asterisk_ng | amocrm_asterisk_ng/crm/amocrm/kernel/calls/call_records/file_converters/core/__init__.py | 429a8d0823b951c855a49c1d44ab0e05263c54dc | from .IFileConverter import IFileConverter
| [] |
cuenca-mx/agave | tests/blueprint/test_decorators.py | d4719bdbab8e200c98d206475df6adb275e9fdcc | from functools import wraps
from agave.blueprints.decorators import copy_attributes
def i_am_test(func):
@wraps(func)
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
wrapper.i_am_test = True
return wrapper
class TestResource:
@i_am_test
def retrieve(self) -> str:
... | [((113, 124), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (118, 124), False, 'from functools import wraps\n'), ((473, 502), 'agave.blueprints.decorators.copy_attributes', 'copy_attributes', (['TestResource'], {}), '(TestResource)\n', (488, 502), False, 'from agave.blueprints.decorators import copy_attribute... |
hanhan9449/mace | tools/python/utils/config_parser.py | 63feaf5055bab6a081d36edfab8f963a624899aa | # Copyright 2019 The MACE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [((2429, 2441), 'yaml.load', 'yaml.load', (['s'], {}), '(s)\n', (2438, 2441), False, 'import yaml\n'), ((4016, 4095), 'utils.util.mace_check', 'mace_check', (['(str in [e.name for e in DataFormat])', "('unknown data format %s' % str)"], {}), "(str in [e.name for e in DataFormat], 'unknown data format %s' % str)\n", (40... |
sami-ets/DeepNormalize | main_cross_testing_iseg.py | 5ed53280d98a201d45bb9973e79736136273eaea | # -*- coding: utf-8 -*-
# Copyright 2019 Pierre-Luc Delisle. All Rights Reserved.
#
# Licensed under the MIT License;
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed t... | [((1901, 1919), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (1915, 1919), True, 'import numpy as np\n'), ((1920, 1935), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (1931, 1935), False, 'import random\n'), ((1989, 2028), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'loggi... |
FaBoPlatform/RobotCarAI | docs/10.level3_demo_streaming/pc_server/server.py | c89d3330a2beda0f253733d3252b2b035b153b6b | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ClientからOpenCV画像データを受け取り、ライン検出して制御命令を送る
# Server: Jetson TX2
# Client: Jetson TX2/Raspberry Pi3 Docker
# 1. FFMPEG UDP StreamingをClientで実行する。AWS向け10FPS,Jetson TX2向け1FPS
# 2. Serverを起動する
# 3. Clientを起動する
# コード修正
# lib/camera.py: vid = cv2.VideoCapture()を環境に合わせて修正する必要がある
# ... | [((916, 1116), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""[%(levelname)s] time:%(created).8f pid:%(process)d pn:%(processName)-10s tid:%(thread)d tn:%(threadName)-10s fn:%(funcName)-10s %(message)s"""'}), "(level=logging.DEBUG, format=\n '[%(levelname)s] time:%(create... |
zackorndorff/revsync | client.py | 17255aebd281edffb3f3330c21cda00039bc51a3 | from collections import defaultdict
import json
import re
import redis
import threading
import time
import traceback
import uuid
import base64
import binascii
TTL = 2
hash_keys = ('cmd', 'user')
cmd_hash_keys = {
'comment': ('addr',),
'extra_comment': ('addr',),
'area_comment': ('addr',),
'rename': ('... | [((975, 1005), 're.compile', 're.compile', (['"""[^a-zA-Z0-9_\\\\-]"""'], {}), "('[^a-zA-Z0-9_\\\\-]')\n", (985, 1005), False, 'import re\n'), ((1033, 1049), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (1043, 1049), False, 'import json\n'), ((1250, 1261), 'time.time', 'time.time', ([], {}), '()\n', (1259, 1... |
pinheiroo27/ontask_b | ontask/condition/urls.py | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | # -*- coding: utf-8 -*-
"""URLs to manipulate columns."""
from django.urls import path
from ontask.condition import views
app_name = 'condition'
urlpatterns = [
#
# FILTERS
#
path(
'<int:pk>/create_filter/',
views.FilterCreateView.as_view(),
name='create_filter'),
path('<... | [((313, 381), 'django.urls.path', 'path', (['"""<int:pk>/edit_filter/"""', 'views.edit_filter'], {'name': '"""edit_filter"""'}), "('<int:pk>/edit_filter/', views.edit_filter, name='edit_filter')\n", (317, 381), False, 'from django.urls import path\n'), ((387, 461), 'django.urls.path', 'path', (['"""<int:pk>/delete_filt... |
googleinterns/via-content-understanding | VideoClassification/SegmentLevelClassifier/model.py | ca12ebe6aa4da16224a8ca86dc45aaaaa7cfda09 | """Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | [((2358, 2395), 'tensorflow.reshape', 'tf.reshape', (['frames', '(-1, feature_dim)'], {}), '(frames, (-1, feature_dim))\n', (2368, 2395), True, 'import tensorflow as tf\n'), ((2446, 2505), 'tensorflow.reshape', 'tf.reshape', (['activation', '(-1, max_frames, self.num_clusters)'], {}), '(activation, (-1, max_frames, sel... |
faruq2021/ivy | ivy/functional/backends/jax/old/math.py | 1b24beadbd673d6a9dd504e037c68547e5640627 | """
Collection of Jax math functions, wrapped to fit Ivy syntax and signature.
"""
# global
import jax as _jax
import jax.numpy as _jnp
tan = _jnp.tan
acos = _jnp.arccos
atan = _jnp.arctan
atan2 = _jnp.arctan2
cosh = _jnp.cosh
atanh = _jnp.arctanh
log = _jnp.log
exp = _jnp.exp
erf = _jax.scipy.special.erf
| [] |
Adoni/ZhihuCrawler | neaten_db.py | c275192ced3a344d7b93b7cfd3ebf87ed179400d | from pymongo import MongoClient
from pyltp import Segmentor
def insert_questions_from_answered_question():
in_db = MongoClient().zhihu.user_answered_questions
out_db = MongoClient().zhihu_network.questions
existed_question_id = set(map(lambda q: q['_id'], out_db.find()))
segmentor = Segmentor()
se... | [((302, 313), 'pyltp.Segmentor', 'Segmentor', ([], {}), '()\n', (311, 313), False, 'from pyltp import Segmentor\n'), ((1165, 1176), 'pyltp.Segmentor', 'Segmentor', ([], {}), '()\n', (1174, 1176), False, 'from pyltp import Segmentor\n'), ((1917, 1928), 'pyltp.Segmentor', 'Segmentor', ([], {}), '()\n', (1926, 1928), Fals... |
timgates42/netcdf4-python | test/tst_vlen.py | d8b1cb11454f9beec674a29904c91f48db608c2c | import sys
import unittest
import os
import tempfile
from netCDF4 import Dataset
import numpy as np
from numpy.testing import assert_array_equal
FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
VL_NAME = 'vlen_type'
VL_BASETYPE = np.int16
DIM1_NAME = 'lon'
DIM2_NAME = 'lat'
nlons = 5; nlats = 5... | [((451, 482), 'numpy.empty', 'np.empty', (['(nlats * nlons)', 'object'], {}), '(nlats * nlons, object)\n', (459, 482), True, 'import numpy as np\n'), ((488, 519), 'numpy.empty', 'np.empty', (['(nlats * nlons)', 'object'], {}), '(nlats * nlons, object)\n', (496, 519), True, 'import numpy as np\n'), ((682, 714), 'numpy.r... |
ScriptBox99/deepmind-sonnet | sonnet/src/once.py | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | # Copyright 2019 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [((1923, 1935), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1933, 1935), False, 'import uuid\n')] |
DGarciaMedina/PiArmDiego | env.py | cb4664796aa99b0717145f9e4889bfba5190059f | import piarm
import time
import numpy as np
import cv2
import random
class MyArm2D:
def __init__(self, move_robot = False):
self.move_robot = move_robot
if self.move_robot:
self.robot = piarm.PiArm()
self.open_connection()
self.DEFAULT = [500, 500, 500, 500, 5... | [((1377, 1423), 'numpy.zeros', 'np.zeros', (['(self.img_height, self.img_width, 3)'], {}), '((self.img_height, self.img_width, 3))\n', (1385, 1423), True, 'import numpy as np\n'), ((3900, 3944), 'random.uniform', 'random.uniform', (['(0.8 * max_length)', 'max_length'], {}), '(0.8 * max_length, max_length)\n', (3914, 39... |
jonywtf/grpc | src/python/src/grpc/_adapter/_links_test.py | 124f3c5a4b65bb88f13be7c68482eb83d945ad02 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | [((10089, 10104), 'unittest.main', 'unittest.main', ([], {}), '()\n', (10102, 10104), False, 'import unittest\n'), ((2039, 2060), 'grpc.framework.foundation.logging_pool.pool', 'logging_pool.pool', (['(80)'], {}), '(80)\n', (2056, 2060), False, 'from grpc.framework.foundation import logging_pool\n'), ((2087, 2108), 'gr... |
stjordanis/Hyperactive | tests/_test_progress_board.py | 5acf247d8023ff6761593b9d0954bdd912d20aed | import os, glob
import subprocess
from subprocess import DEVNULL, STDOUT
abspath = os.path.abspath(__file__)
dir_ = os.path.dirname(abspath)
files = glob.glob(dir_ + "/_progress_board_tests/_test_progress_board_*.py")
for file_path in files:
file_name = str(file_path.rsplit("/", maxsplit=1)[1])
try:
... | [((85, 110), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (100, 110), False, 'import os, glob\n'), ((118, 142), 'os.path.dirname', 'os.path.dirname', (['abspath'], {}), '(abspath)\n', (133, 142), False, 'import os, glob\n'), ((152, 220), 'glob.glob', 'glob.glob', (["(dir_ + '/_progress_boar... |
jhalljhall/beiwe-backend | pages/forest_pages.py | 06d28926a2830c7ad53c32ec41ff49320932aeed | import csv
import datetime
from collections import defaultdict
from django.contrib import messages
from django.http.response import FileResponse
from django.shortcuts import redirect, render
from django.utils import timezone
from django.views.decorators.http import require_GET, require_http_methods, require_POST
from... | [((3696, 3733), 'django.views.decorators.http.require_http_methods', 'require_http_methods', (["['GET', 'POST']"], {}), "(['GET', 'POST'])\n", (3716, 3733), False, 'from django.views.decorators.http import require_GET, require_http_methods, require_POST\n'), ((1295, 1325), 'database.study_models.Study.objects.get', 'St... |
janthiemen/data_scout | data_scout/transformations/math_custom.py | 6366eedfb20ed429bc96100de4dd2c7409e5dd88 | from __future__ import division
from .transformation import Transformation
from pyparsing import (Literal, CaselessLiteral, Word, Combine, Group, Optional,
ZeroOrMore, Forward, nums, alphas, oneOf)
import math
import re
import operator
__author__ = 'Paul McGuire'
__version__ = '$Revision: 0.0 $... | [((1943, 1955), 'pyparsing.Literal', 'Literal', (['"""."""'], {}), "('.')\n", (1950, 1955), False, 'from pyparsing import Literal, CaselessLiteral, Word, Combine, Group, Optional, ZeroOrMore, Forward, nums, alphas, oneOf\n'), ((1968, 1988), 'pyparsing.CaselessLiteral', 'CaselessLiteral', (['"""E"""'], {}), "('E')\n", (... |
cybertraining-dsc/fa19-516-171 | project/cloudmesh-storage/cloudmesh/vdir/api/manager.py | 1dba8cde09f7b05c80557ea7ae462161c590568b | #
# this manager stores directly into the db wit Database update
from cloudmesh.mongo.DataBaseDecorator import DatabaseUpdate
from cloudmesh.mongo.CmDatabase import CmDatabase
from cloudmesh.common.console import Console
from cloudmesh.storage.Provider import Provider
import os
from datetime import datetime
class Vd... | [((1435, 1451), 'cloudmesh.mongo.DataBaseDecorator.DatabaseUpdate', 'DatabaseUpdate', ([], {}), '()\n', (1449, 1451), False, 'from cloudmesh.mongo.DataBaseDecorator import DatabaseUpdate\n'), ((3491, 3507), 'cloudmesh.mongo.DataBaseDecorator.DatabaseUpdate', 'DatabaseUpdate', ([], {}), '()\n', (3505, 3507), False, 'fro... |
cjpit/redash | redash/query_runner/influx_db.py | 27aafdb07e3a427da8f88d55a0c0d7cc64379da2 | import json
import logging
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
from influxdb import InfluxDBClusterClient
enabled = True
except ImportError:
enabled = False
def _transform_result(results):
result_columns = []
result_r... | [((109, 136), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (126, 136), False, 'import logging\n'), ((1345, 1449), 'json.dumps', 'json.dumps', (["{'columns': [{'name': c} for c in result_columns], 'rows': result_rows}"], {'cls': 'JSONEncoder'}), "({'columns': [{'name': c} for c in result... |
victorfica/utils | ics/mergeGatingSets.py | b61935a860838a0e70afde7c9ecf2c68f51a2c4b | #!/usr/bin/env python
"""
Usage examples:
python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function functions --ncpus 4 --out functions_extract.csv
sbatch -n 1 -t 3-0 -c 4 -o functions_slurm.txt --wrap="python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function functions --ncpus 4 --out functio... | [((3651, 3673), 'os.listdir', 'os.listdir', (['dataFolder'], {}), '(dataFolder)\n', (3661, 3673), False, 'import os\n'), ((4013, 4035), 'pandas.concat', 'pd.concat', (['out'], {'axis': '(0)'}), '(out, axis=0)\n', (4022, 4035), True, 'import pandas as pd\n'), ((4097, 4189), 'argparse.ArgumentParser', 'argparse.ArgumentP... |
zoni/ulauncher-meet | meeting.py | 1b76627c69dfc539645acd27e30c9b8fd8fe08ae | from dataclasses import dataclass
@dataclass
class Meeting:
name: str
id: str
| [] |
uuosio/uuosio.gscdk | setup.py | a2e364d4499c1372567aa5933e2d8e02340a8385 |
import os
import shutil
import setuptools
# from skbuild import setup
from distutils.core import setup
from distutils.sysconfig import get_python_lib
import glob
# if os.path.exists('pysrc/tinygo'):
# shutil.rmtree('pysrc/tinygo')
# shutil.copytree('tinygo/build/release/tinygo', 'pysrc/tinygo')
release_files = ... | [((348, 371), 'os.walk', 'os.walk', (['"""pysrc/tinygo"""'], {}), "('pysrc/tinygo')\n", (355, 371), False, 'import os\n'), ((496, 813), 'distutils.core.setup', 'setup', ([], {'name': '"""gscdk"""', 'version': '"""0.3.5"""', 'description': '"""Go Smart Contract Development Kit"""', 'author': '"""The UUOSIO Team"""', 'li... |
michalurbanski/bkgames | tests/data_creator_action.py | 69b1d16ae27d3118dd78449ce7deecbd6e1b95e7 | from typing import Callable
class DataCreatorAction:
def __init__(self, func: Callable, priority_for_creation: int = 99, priority_for_removal: int = 99):
self.func = func
self.priority_for_creation = priority_for_creation
self.priority_for_removal = priority_for_removal
| [] |
brianchiang-tw/HackerRank | Python/Numpy/Min and Max/min_and_max.py | 02a30a0033b881206fa15b8d6b4ef99b2dc420c8 | import numpy as np
if __name__ == '__main__':
h, w = map( int, input().split() )
row_list = []
for i in range(h):
single_row = list( map(int, input().split() ) )
np_row = np.array( single_row )
row_list.append( np_row )
min_of_each_row = np.min( row_list, axis = 1)
... | [((288, 312), 'numpy.min', 'np.min', (['row_list'], {'axis': '(1)'}), '(row_list, axis=1)\n', (294, 312), True, 'import numpy as np\n'), ((334, 357), 'numpy.max', 'np.max', (['min_of_each_row'], {}), '(min_of_each_row)\n', (340, 357), True, 'import numpy as np\n'), ((206, 226), 'numpy.array', 'np.array', (['single_row'... |
allure-framework/allure-pytest | allure/pytest_plugin.py | d55180aaeb21233e7ca577ffc6f67a07837c63f2 | import uuid
import pickle
import pytest
import argparse
from collections import namedtuple
from six import text_type
from allure.common import AllureImpl, StepContext
from allure.constants import Status, AttachmentType, Severity, \
FAILED_STATUSES, Label, SKIPPED_STATUSES
from allure.utils import parent_module, p... | [((21294, 21348), 'collections.namedtuple', 'namedtuple', (['"""CollectFail"""', '"""name status message trace"""'], {}), "('CollectFail', 'name status message trace')\n", (21304, 21348), False, 'from collections import namedtuple\n'), ((3821, 3842), 'allure.common.AllureImpl', 'AllureImpl', (['reportdir'], {}), '(repo... |
domlysi/django-treenode | treenode/debug.py | 86e7c76e2b2d60c071cfce6ad1493b2b51f2d304 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.db import connection
import logging
import timeit
logger = logging.getLogger(__name__)
class debug_performance(object):
def __init__(self, message_prefix=''):
super(debug_performance, self).__init__()
self.__message_prefix =... | [((132, 159), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (149, 159), False, 'import logging\n'), ((474, 496), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (494, 496), False, 'import timeit\n')] |
vibhorvk/BlendString | String_tool.py | 3bf62083716b3b1f4976abeb3528771eeb79e2cf | bl_info = {
"name": "STRING",
"blender": (2, 80, 0),
"category": "Object",
'Author' : 'Vibhor Gupta'
}
import bpy
import bmesh
class STRING(bpy.types.Operator):
"""My Object Moving Script""" # Use this as a tooltip for menu items and buttons.
bl_idname = "object.stringtool_o... | [((554, 631), 'bpy.props.FloatProperty', 'bpy.props.FloatProperty', ([], {'name': '"""String Thickness"""', 'min': '(0.1)', 'max': '(5)', 'precision': '(2)'}), "(name='String Thickness', min=0.1, max=5, precision=2)\n", (577, 631), False, 'import bpy\n'), ((3413, 3445), 'bpy.utils.register_class', 'bpy.utils.register_c... |
aricsanders/pyMez3 | Code/DataHandlers/__init__.py | 13e2b9900af2287db0cc42a0190d31da165ce174 | """
The DataHandlers subpackage is designed to manipulate data, by allowing different data types to be opened,
created, saved and updated. The subpackage is further divided into modules grouped by a common theme. Classes for data
that are already on disk normally follows the following pattern:
`instance=ClassName(file_... | [] |
somenzz/djangomail | djangomail/backends/dummy.py | 7d4f833cd71289a51eb935757d8b628e9c9f8aa1 | """
Dummy email backend that does nothing.
"""
from djangomail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(list(email_messages))
| [] |
Avinesh/awx | awx/plugins/library/scan_services.py | 6310a2edd890d6062a9f6bcdeb2b46c4b876c2bf | #!/usr/bin/env python
import re
from ansible.module_utils.basic import * # noqa
DOCUMENTATION = '''
---
module: scan_services
short_description: Return service state information as fact data
description:
- Return service state information as fact data for various service management utilities
version_added: "1.9"... | [((2165, 2280), 're.compile', 're.compile', (['"""^\\\\s?(?P<name>.*)\\\\s(?P<goal>\\\\w+)\\\\/(?P<state>\\\\w+)(\\\\,\\\\sprocess\\\\s(?P<pid>[0-9]+))?\\\\s*$"""'], {}), "(\n '^\\\\s?(?P<name>.*)\\\\s(?P<goal>\\\\w+)\\\\/(?P<state>\\\\w+)(\\\\,\\\\sprocess\\\\s(?P<pid>[0-9]+))?\\\\s*$'\n )\n", (2175, 2280), Fals... |
duckm8795/runscope-circleci | app.py | 2fd42e64bddb4b8f34c437c2d834b92369c9a2bf | import requests
import sys
import time
import os
def main():
trigger_url = sys.argv[1]
trigger_resp = requests.get(trigger_url)
if trigger_resp.ok:
trigger_json = trigger_resp.json().get("data", {})
test_runs = trigger_json.get("runs", [])
print ("Started {} test runs.".format(l... | [((112, 137), 'requests.get', 'requests.get', (['trigger_url'], {}), '(trigger_url)\n', (124, 137), False, 'import requests\n'), ((1978, 2019), 'requests.get', 'requests.get', (['result_url'], {'headers': 'headers'}), '(result_url, headers=headers)\n', (1990, 2019), False, 'import requests\n'), ((422, 435), 'time.sleep... |
fabaff/spyse-python | spyse/client.py | f286514ac052ebe6fa98f877d251d8f3cd4db1c4 | import requests
from typing import List, Optional
from .models import AS, Domain, IP, CVE, Account, Certificate, Email, DNSHistoricalRecord, WHOISHistoricalRecord
from .response import Response
from .search_query import SearchQuery
from limiter import get_limiter, limit
class DomainsSearchResults:
def __init__(s... | [((2771, 2789), 'requests.Session', 'requests.Session', ([], {}), '()\n', (2787, 2789), False, 'import requests\n'), ((2992, 3054), 'limiter.get_limiter', 'get_limiter', ([], {'rate': 'self.RATE_LIMIT_FRAME_IN_SECONDS', 'capacity': '(1)'}), '(rate=self.RATE_LIMIT_FRAME_IN_SECONDS, capacity=1)\n', (3003, 3054), False, '... |
jfcaballero/Tutorial-sobre-scikit-learn-abreviado | talleres_inov_docente/figures/plot_helpers.py | 1e2aa1f9132c277162135a5463068801edab8d15 | from matplotlib.colors import ListedColormap
cm3 = ListedColormap(['#0000aa', '#ff2020', '#50ff50'])
cm2 = ListedColormap(['#0000aa', '#ff2020'])
| [((52, 101), 'matplotlib.colors.ListedColormap', 'ListedColormap', (["['#0000aa', '#ff2020', '#50ff50']"], {}), "(['#0000aa', '#ff2020', '#50ff50'])\n", (66, 101), False, 'from matplotlib.colors import ListedColormap\n'), ((108, 146), 'matplotlib.colors.ListedColormap', 'ListedColormap', (["['#0000aa', '#ff2020']"], {}... |
cemac-ccs/FlaskMWE | Applications/FlaskApp/errorpages.py | e8ce3cbca0d402bd9fdb1feb10290f2e7b11907b | from flask import render_template
# Error Pages ----------------------------------------------------------------
def page_not_found(e):
# note that we set the 404 status explicitly
return render_template('404.html.j2'), 404
def page_not_allowed(e):
# note that we set the 403 status explicitly
return ... | [((197, 227), 'flask.render_template', 'render_template', (['"""404.html.j2"""'], {}), "('404.html.j2')\n", (212, 227), False, 'from flask import render_template\n'), ((320, 350), 'flask.render_template', 'render_template', (['"""403.html.j2"""'], {}), "('403.html.j2')\n", (335, 350), False, 'from flask import render_t... |
anhydrous99/cppgym | cppgym/ToyText/BlackJack.py | 0b1009a74faebfe5a31bcfd6a86c74cf13464d56 | from .._BlackJack import BlackJackCPP
import gym
import ctypes
import numpy as np
from gym import spaces
class BlackJack(gym.Env):
def __init__(self, natural=False):
self.env = BlackJackCPP(natural)
self.action_space = spaces.Discrete(2)
self.observation_space = spaces.Tuple((
... | [((242, 260), 'gym.spaces.Discrete', 'spaces.Discrete', (['(2)'], {}), '(2)\n', (257, 260), False, 'from gym import spaces\n'), ((905, 920), 'numpy.array', 'np.array', (['state'], {}), '(state)\n', (913, 920), True, 'import numpy as np\n'), ((321, 340), 'gym.spaces.Discrete', 'spaces.Discrete', (['(32)'], {}), '(32)\n'... |
ajothomas/beam | sdks/python/apache_beam/runners/direct/consumer_tracking_pipeline_visitor_test.py | 4774c1caf3dac3b6a7dd161f82559a26fa380920 | #
# 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... | [((5811, 5826), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5824, 5826), False, 'import unittest\n'), ((1749, 1782), 'apache_beam.runners.direct.consumer_tracking_pipeline_visitor.ConsumerTrackingPipelineVisitor', 'ConsumerTrackingPipelineVisitor', ([], {}), '()\n', (1780, 1782), False, 'from apache_beam.runne... |
scudette/rekall-agent-server | gluon/main.py | e553f1ae5279f75a8f5b0c0c4847766b60ed86eb | #!/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The gluon wsgi application
---------------------------
"""
from __future__ import print_function
if Fals... | [((1713, 1737), 'gluon.admin.create_missing_folders', 'create_missing_folders', ([], {}), '()\n', (1735, 1737), False, 'from gluon.admin import add_path_first, create_missing_folders, create_missing_app_folders\n'), ((2129, 2167), 'locale.setlocale', 'locale.setlocale', (['locale.LC_CTYPE', '"""C"""'], {}), "(locale.LC... |
marc4gov/tokenspice2 | agents/EWPublisherAgent.py | 1993383674f35b20e11e54606b3dac8e4c05c0f9 | import logging
log = logging.getLogger('marketagents')
from enforce_typing import enforce_types # type: ignore[import]
import random
from agents.PublisherAgent import PublisherAgent
from agents.PoolAgent import PoolAgent
from util import constants
from util.constants import POOL_WEIGHT_DT, POOL_WEIGHT_OCEAN
from web3... | [((21, 54), 'logging.getLogger', 'logging.getLogger', (['"""marketagents"""'], {}), "('marketagents')\n", (38, 54), False, 'import logging\n'), ((1575, 1600), 'web3engine.globaltokens.OCEANtoken', 'globaltokens.OCEANtoken', ([], {}), '()\n', (1598, 1600), False, 'from web3engine import bfactory, bpool, datatoken, dtfac... |
slaclab/lcls-orbit | lcls_orbit/__init__.py | e2b8738c4af2dfed40fce4b898bf9b2a820d5f56 | import numpy as np
from . import _version
__version__ = _version.get_versions()['version']
HXR_COLORS = ("#000000", "#02004a", "#030069", "#04008f", "#0500b3", "#0700ff")
SXR_COLORS = ("#000000", "#330000", "#520000", "#850000", "#ad0000", "#ff0000")
HXR_AREAS = {
"GUN" : [2017.911, 2018.712],
"L0" : [2018.... | [((903, 917), 'numpy.mean', 'np.mean', (['value'], {}), '(value)\n', (910, 917), True, 'import numpy as np\n'), ((1569, 1583), 'numpy.mean', 'np.mean', (['value'], {}), '(value)\n', (1576, 1583), True, 'import numpy as np\n')] |
OverLordGoldDragon/dummy | tests/test_optimizers_v2/test_optimizers_v2.py | 5192b91c57721f37b906f670ad954a46f98bf5b5 | import os
import tempfile
import numpy as np
import tensorflow as tf
from time import time
from termcolor import cprint
from unittest import TestCase
from .. import K
from .. import Input, Dense, GRU, Bidirectional, Embedding
from .. import Model, load_model
from .. import l2
from .. import maxnorm
from .. import Ada... | [((591, 629), 'tensorflow.compat.v1.disable_eager_execution', 'tf.compat.v1.disable_eager_execution', ([], {}), '()\n', (627, 629), True, 'import tensorflow as tf\n'), ((2744, 2796), 'termcolor.cprint', 'cprint', (['"""\n<< ALL MAIN TESTS PASSED >>\n"""', '"""green"""'], {}), '("""\n<< ALL MAIN TESTS PASSED >>\n""", \'... |
Vasyka/koku | koku/reporting/migrations/0099_ocp_performance.py | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | # Generated by Django 2.2.10 on 2020-02-18 12:51
import django.contrib.postgres.indexes
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [("reporting", "0098_auto_20200221_2034")]
operations = [
migrations.RunSQL(
"""
dro... | [((282, 492), 'django.db.migrations.RunSQL', 'migrations.RunSQL', (['"""\ndrop materialized view if exists reporting_ocpallcostlineitem_daily_summary;\ndrop materialized view if exists reporting_ocpallcostlineitem_project_daily_summary;\n """'], {}), '(\n """\ndrop materialized view if exists reporting_oc... |
iamabhishek0/sympy | sympy/tensor/tests/test_functions.py | c461bd1ff9d178d1012b04fd0bf37ee3abb02cdd | from sympy.tensor.functions import TensorProduct
from sympy import MatrixSymbol, Matrix, Array
from sympy.abc import x, y, z
from sympy.abc import i, j, k, l
A = MatrixSymbol("A", 3, 3)
B = MatrixSymbol("B", 3, 3)
C = MatrixSymbol("C", 3, 3)
def test_TensorProduct_construction():
assert TensorProduct(3, 4) == 1... | [((164, 187), 'sympy.MatrixSymbol', 'MatrixSymbol', (['"""A"""', '(3)', '(3)'], {}), "('A', 3, 3)\n", (176, 187), False, 'from sympy import MatrixSymbol, Matrix, Array\n'), ((192, 215), 'sympy.MatrixSymbol', 'MatrixSymbol', (['"""B"""', '(3)', '(3)'], {}), "('B', 3, 3)\n", (204, 215), False, 'from sympy import MatrixSy... |
Kgermando/sem | app/views.py | c76e97e1d526d4e92a925adb6bceee426f999655 | from django.shortcuts import render
# Create your views here.
class MultipleProxyMiddleware:
FORWARDED_FOR_FIELDS = [
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED_HOST',
'HTTP_X_FORWARDED_SERVER',
]
def __init__(self, get_response):
self.get_response = get_response
def __... | [((853, 892), 'django.shortcuts.render', 'render', (['request', 'template_name', 'context'], {}), '(request, template_name, context)\n', (859, 892), False, 'from django.shortcuts import render\n')] |
HansZimmer5000/LensComparison | webcrawler/crawler/spiders/baselensspider.py | e4d9b68211604c4569c4ca9b1e1b4fce2a8c1ea8 | # This module is about my webcrawler with the use of scrapy.
# Its a generell web crawler, but the import and use of GhAdapter makes it usefull for geizhals.de sites.
from abc import ABC, abstractmethod
import scrapy
class BaseLensSpider(scrapy.Spider, ABC):
@property
@abstractmethod
def adapter(self):
raise No... | [] |
fjbriones/deep-text-recognition-benchmark | byol_train.py | c85d12aa56495fe221656bac4c8cb159a28456b1 | import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter, ... | [((1220, 1247), 'simclr_dataset.Batch_Balanced_Dataset', 'Batch_Balanced_Dataset', (['opt'], {}), '(opt)\n', (1242, 1247), False, 'from simclr_dataset import hierarchical_dataset, AlignCollate, Batch_Balanced_Dataset\n'), ((1328, 1338), 'imgaug.seed', 'ia.seed', (['(1)'], {}), '(1)\n', (1335, 1338), True, 'import imgau... |
dulin/tornado-test | app/__init__.py | 8ceeb9f2b50b4cd0f18baa9149140721feec1925 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python -*-
import aiopg
import psycopg2
import tornado.locks
from tornado.options import define, options
from tornado.web import Application
from app.application import Application
define('port', default=8080, help="listening port")
define('bind_address', def... | [((242, 293), 'tornado.options.define', 'define', (['"""port"""'], {'default': '(8080)', 'help': '"""listening port"""'}), "('port', default=8080, help='listening port')\n", (248, 293), False, 'from tornado.options import define, options\n'), ((294, 349), 'tornado.options.define', 'define', (['"""bind_address"""'], {'d... |
KarlTDebiec/PipeScaler | pipescaler/core/stage.py | b990ece8f3dd2c3506c226ed871871997fc57beb | #!/usr/bin/env python
# pipescaler/core/stage.py
#
# Copyright (C) 2020-2021 Karl T Debiec
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license.
from __future__ import annotations
from abc import ABC, abstractmethod
from importlib.util import module_fr... | [((1070, 1124), 'importlib.util.spec_from_file_location', 'spec_from_file_location', (['stage_cls_name', 'module_infile'], {}), '(stage_cls_name, module_infile)\n', (1093, 1124), False, 'from importlib.util import module_from_spec, spec_from_file_location\n'), ((1146, 1168), 'importlib.util.module_from_spec', 'module_f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.