repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 840k |
|---|---|---|---|---|
carpensa/dicom-harpooner | ImageSearcher/admin.py | 2d998c22c51e372fb9b5f3508c900af6f4405cd3 | from django.contrib import admin
from dicoms.models import Subject
from dicoms.models import Session
from dicoms.models import Series
admin.site.register(Session)
admin.site.register(Subject)
admin.site.register(Series)
| [((6, 0, 6, 28), 'django.contrib.admin.site.register', 'admin.site.register', ({(6, 20, 6, 27): 'Session'}, {}), '(Session)', False, 'from django.contrib import admin\n'), ((7, 0, 7, 28), 'django.contrib.admin.site.register', 'admin.site.register', ({(7, 20, 7, 27): 'Subject'}, {}), '(Subject)', False, 'from django.con... |
noscripter/django-react-redux-jwt-base | src/djangoreactredux/wsgi.py | 078fb86005db106365df51fa11d8602fa432e3c3 | """
WSGI config for django-react-redux-jwt-base project.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoreactredux.settings.dev")
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
application = get_wsgi_application()
application = DjangoWhiteNoise... | [((7, 0, 7, 80), 'os.environ.setdefault', 'os.environ.setdefault', ({(7, 22, 7, 46): '"""DJANGO_SETTINGS_MODULE"""', (7, 48, 7, 79): '"""djangoreactredux.settings.dev"""'}, {}), "('DJANGO_SETTINGS_MODULE', 'djangoreactredux.settings.dev'\n )", False, 'import os\n'), ((12, 14, 12, 36), 'django.core.wsgi.get_wsgi_appl... |
matthewh/simple-settings | simple_settings/dynamic_settings/base.py | dbddf8d5be7096ee7c4c3cc6d82824befa9b714f | # -*- coding: utf-8 -*-
import re
from copy import deepcopy
import jsonpickle
class BaseReader(object):
"""
Base class for dynamic readers
"""
_default_conf = {}
def __init__(self, conf):
self.conf = deepcopy(self._default_conf)
self.conf.update(conf)
self.key_pattern = s... | [((15, 20, 15, 48), 'copy.deepcopy', 'deepcopy', ({(15, 29, 15, 47): 'self._default_conf'}, {}), '(self._default_conf)', False, 'from copy import deepcopy\n'), ((26, 21, 26, 46), 'jsonpickle.decode', 'jsonpickle.decode', ({(26, 39, 26, 45): 'result'}, {}), '(result)', False, 'import jsonpickle\n'), ((33, 20, 33, 44), '... |
coincar-sim/lanelet2_interface_ros | scripts/map_frame_to_utm_tf_publisher.py | f1738766dd323ed64a4ebcc8254438920a587b80 | #!/usr/bin/env python
#
# Copyright (c) 2018
# FZI Forschungszentrum Informatik, Karlsruhe, Germany (www.fzi.de)
# KIT, Institute of Measurement and Control, Karlsruhe, Germany (www.mrt.kit.edu)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted p... | [((50, 36, 50, 52), 'rospy.Time.now', 'rospy.Time.now', ({}, {}), '()', False, 'import rospy\n'), ((75, 4, 75, 52), 'rospy.init_node', 'rospy.init_node', ({(75, 20, 75, 51): '"""map_frame_to_utm_tf_publisher"""'}, {}), "('map_frame_to_utm_tf_publisher')", False, 'import rospy\n'), ((81, 20, 81, 66), 'lanelet2.core.GPSP... |
mattmiller899/biosys-analytics | lectures/05-python-intro/examples/argv.py | ab24a4c7206ed9a865e896daa57cee3c4e62df1f | #!/usr/bin/env python3
import sys
print(sys.argv)
| [] |
easyas314159/cnftools | tests/fixtures.py | 67896cf3d17587accfc5ad7e30730fea2394f558 | from itertools import chain
def make_comparable(*clauses):
return set((frozenset(c) for c in chain(*clauses)))
def count_clauses(*clauses):
total = 0
for subclauses in clauses:
total += len(subclauses)
return total
def unique_literals(*clauses):
literals = set()
for clause in chain(*clauses):
literals.upda... | [((14, 15, 14, 30), 'itertools.chain', 'chain', ({(14, 21, 14, 29): '*clauses'}, {}), '(*clauses)', False, 'from itertools import chain\n'), ((4, 35, 4, 50), 'itertools.chain', 'chain', ({(4, 41, 4, 49): '*clauses'}, {}), '(*clauses)', False, 'from itertools import chain\n')] |
Rodrigo-Flo/Kratos | applications/FluidDynamicsApplication/tests/sod_shock_tube_test.py | f718cae5d1618e9c0e7ed1da9e95b7a853e62b1b | # Import kratos core and applications
import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics.kratos_utilities as KratosUtilities
from KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis import FluidDynamicsAnalysis
class SodShockTubeTest(KratosUni... | [((73, 30, 103, 13), 'KratosMultiphysics.Parameters', 'KratosMultiphysics.Parameters', ({(73, 60, 103, 12): '"""{\n "python_module" : "gid_output_process",\n "kratos_module" : "KratosMultiphysics",\n "process_name" : "GiDOutputProcess",\n "help" : "This process writ... |
TonghanWang/NDQ | src/controllers/__init__.py | 575f2e243bac1a567c072dbea8e093aaa4959511 | from .basic_controller import BasicMAC
from .cate_broadcast_comm_controller import CateBCommMAC
from .cate_broadcast_comm_controller_full import CateBCommFMAC
from .cate_broadcast_comm_controller_not_IB import CateBCommNIBMAC
from .tar_comm_controller import TarCommMAC
from .cate_pruned_broadcast_comm_controller import... | [] |
1999foxes/run-cmd-from-websocket | main.py | 0e2a080fe92b93c6cba63dfe5649ac2a3e745009 | import asyncio
import json
import logging
import websockets
logging.basicConfig()
async def counter(websocket, path):
try:
print("connect")
async for message in websocket:
print(message)
finally:
USERS.remove(websocket)
async def main():
async with websockets.serve(c... | [((6, 0, 6, 21), 'logging.basicConfig', 'logging.basicConfig', ({}, {}), '()', False, 'import logging\n'), ((19, 15, 19, 59), 'websockets.serve', 'websockets.serve', ({(19, 32, 19, 39): 'counter', (19, 41, 19, 52): '"""localhost"""', (19, 54, 19, 58): '(5000)'}, {}), "(counter, 'localhost', 5000)", False, 'import webso... |
GingerSpacetail/Brain-Tumor-Segmentation-and-Survival-Prediction-using-Deep-Neural-Networks | 3d_Vnet/3dvnet.py | f627ce48e44bcc7d295ee1cf4086bfdfd7705d44 | import random
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
import tensorflow as tf
import keras.backend as K
from keras.utils import to_categorical
from keras import metrics
from keras.models import Model, load_model
from keras.layers import Input, BatchNormalizat... | [((55, 6, 55, 24), 'keras.layers.merge.add', 'add', ({(55, 10, 55, 23): '[input_mat, X]'}, {}), '([input_mat, X])', False, 'from keras.layers.merge import concatenate, add\n'), ((86, 7, 86, 27), 'keras.layers.merge.concatenate', 'concatenate', ({(86, 19, 86, 26): '[u6, c5]'}, {}), '([u6, c5])', False, 'from keras.layer... |
Inzilkin/vk.py | vk/types/additional/active_offer.py | 969f01e666c877c1761c3629a100768f93de27eb | from ..base import BaseModel
# returned from https://vk.com/dev/account.getActiveOffers
class ActiveOffer(BaseModel):
id: str = None
title: str = None
instruction: str = None
instruction_html: str = None
short_description: str = None
description: str = None
img: str = None
tag: str = ... | [] |
yangxue0827/TF_Deformable_Net | lib/networks/Resnet50_train.py | 00c86380fd2725ebe7ae22f41d460ffc0bca378d | # --------------------------------------------------------
# TFFRCNN - Resnet50
# Copyright (c) 2016
# Licensed under The MIT License [see LICENSE for details]
# Written by miraclebiu
# --------------------------------------------------------
import tensorflow as tf
from .network import Network
from ..fast_rcnn.config... | [((16, 20, 16, 88), 'tensorflow.placeholder', 'tf.placeholder', (), '', True, 'import tensorflow as tf\n'), ((17, 23, 17, 82), 'tensorflow.placeholder', 'tf.placeholder', (), '', True, 'import tensorflow as tf\n'), ((18, 24, 18, 84), 'tensorflow.placeholder', 'tf.placeholder', (), '', True, 'import tensorflow as tf\n')... |
vdesjardins/aws-sso-util | lib/aws_sso_lib/assignments.py | bf092a21674e8286c4445df7f4aae8ad061444ca | import re
import numbers
import collections
import logging
from collections.abc import Iterable
import itertools
import aws_error_utils
from .lookup import Ids, lookup_accounts_for_ou
from .format import format_account_id
LOGGER = logging.getLogger(__name__)
_Context = collections.namedtuple("_Context", [
"sess... | [((13, 9, 13, 36), 'logging.getLogger', 'logging.getLogger', ({(13, 27, 13, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((15, 11, 30, 2), 'collections.namedtuple', 'collections.namedtuple', ({(15, 34, 15, 44): '"""_Context"""', (15, 46, 30, 1): "['session', 'ids', 'principal', 'principal_filter', '... |
naetimus/bootcamp | solutions/pic_search/webserver/src/service/theardpool.py | 0182992df7c54012944b51fe9b70532ab6a0059b | import threading
from concurrent.futures import ThreadPoolExecutor
from service.train import do_train
def thread_runner(thread_num, func, *args):
executor = ThreadPoolExecutor(thread_num)
f = executor.submit(do_train, *args)
| [((7, 15, 7, 45), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ({(7, 34, 7, 44): 'thread_num'}, {}), '(thread_num)', False, 'from concurrent.futures import ThreadPoolExecutor\n')] |
TediCreations/buildutils | buildutil/main.py | 49a35e0926baf65f7688f89e53f525812540101c | #!/usr/bin/env python3
import os
import argparse
import subprocess
if __name__ == '__main__':
from version import __version__
from configParser import ConfigParser
else:
from .version import __version__
from .configParser import ConfigParser
def command(cmd):
"""Run a shell command"""
subprocess.call(cmd, sh... | [((18, 1, 18, 33), 'subprocess.call', 'subprocess.call', (), '', False, 'import subprocess\n'), ((39, 10, 43, 28), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((111, 6, 111, 37), 'os.path.abspath', 'os.path.abspath', ({(111, 22, 111, 36): 'args.directory'}, {}), '(args.dir... |
quiddity-wp/mediawiki-api-demos | python/get_links.py | 98910dbd9c2cbbb13db790f3e8979419aeab34d4 | #This file is auto-generated. See modules.json and autogenerator.py for details
#!/usr/bin/python3
"""
get_links.py
MediaWiki API Demos
Demo of `Links` module: Get all links on the given page(s)
MIT License
"""
import requests
S = requests.Session()
URL = "https://en.wikipedia.org/w/api.php"
PAR... | [((16, 4, 16, 22), 'requests.Session', 'requests.Session', ({}, {}), '()', False, 'import requests\n')] |
thompcinnamon/QM-calc-scripts | gautools/submit_gaussian.py | 60b06e14b2efd307d419201079bb24152ab0bd3c | #! /usr/bin/env python3
########################################################################
# #
# This script was written by Thomas Heavey in 2015. #
# theavey@bu.edu thomasjheavey@gmail.com #
# ... | [((53, 4, 54, 28), 'warnings.warn', 'warn', ({(53, 9, 53, 65): '"""_dir_and_file is deprecated. Use os.path.split instead"""', (54, 9, 54, 27): 'DeprecationWarning'}, {}), "('_dir_and_file is deprecated. Use os.path.split instead',\n DeprecationWarning)", False, 'from warnings import warn\n'), ((121, 20, 121, 46), '... |
WeiChengTseng/maddpg | experiments/recorder.py | f2813ab8bc43e2acbcc69818672e2e2fd305a007 | import json
import copy
import pdb
import numpy as np
import pickle
def listify_mat(matrix):
matrix = np.array(matrix).astype(str)
if len(matrix.shape) > 1:
matrix_list = []
for row in matrix:
try:
matrix_list.append(list(row))
except:
pd... | [((70, 8, 70, 23), 'pdb.set_trace', 'pdb.set_trace', ({}, {}), '()', False, 'import pdb\n'), ((9, 13, 9, 29), 'numpy.array', 'np.array', ({(9, 22, 9, 28): 'matrix'}, {}), '(matrix)', True, 'import numpy as np\n'), ((29, 26, 29, 55), 'copy.deepcopy', 'copy.deepcopy', ({(29, 40, 29, 54): 'self._cur_traj'}, {}), '(self._c... |
ifekxp/data | generate/dummy_data/mvp/gen_csv.py | f3571223f51b3fcc3a708d9ac82e76e3cc1ee068 | from faker import Faker
import csv
# Reference: https://pypi.org/project/Faker/
output = open('data.CSV', 'w', newline='')
fake = Faker()
header = ['name', 'age', 'street', 'city', 'state', 'zip', 'lng', 'lat']
mywriter=csv.writer(output)
mywriter.writerow(header)
for r in range(1000):
mywriter... | [((8, 7, 8, 14), 'faker.Faker', 'Faker', ({}, {}), '()', False, 'from faker import Faker\n'), ((11, 9, 11, 27), 'csv.writer', 'csv.writer', ({(11, 20, 11, 26): 'output'}, {}), '(output)', False, 'import csv\n')] |
Brandon1625/subir | subir/ingreso/migrations/0004_auto_20191003_1509.py | b827a30e64219fdc9de07689d2fb32e2c4bd02b7 | # Generated by Django 2.2.4 on 2019-10-03 21:09
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ingreso', '0003_auto_20190907_2152'),
]
operations = [
migrations.AlterField(
model_name='detal... | [((17, 18, 17, 115), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import migrations, models\n')] |
mfkasim1/pyscf | pyscf/nao/test/test_0017_tddft_iter_nao.py | 7be5e015b2b40181755c71d888449db936604660 | from __future__ import print_function, division
import os,unittest
from pyscf.nao import tddft_iter
dname = os.path.dirname(os.path.abspath(__file__))
td = tddft_iter(label='water', cd=dname)
try:
from pyscf.lib import misc
libnao_gpu = misc.load_library("libnao_gpu")
td_gpu = tddft_iter(label='water', cd... | [((7, 5, 7, 40), 'pyscf.nao.tddft_iter', 'tddft_iter', (), '', False, 'from pyscf.nao import tddft_iter\n'), ((5, 24, 5, 49), 'os.path.abspath', 'os.path.abspath', ({(5, 40, 5, 48): '__file__'}, {}), '(__file__)', False, 'import os, unittest\n'), ((10, 17, 10, 48), 'pyscf.lib.misc.load_library', 'misc.load_library', ({... |
dimasciput/osm2geojson | setup.py | 7b5ba25e39d80838d41f342237161e0fdc5e64b6 | import io
from os import path
from setuptools import setup
dirname = path.abspath(path.dirname(__file__))
with io.open(path.join(dirname, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def parse_requirements(filename):
lines = (line.strip() for line in open(path.join(dirname, filename)))
... | [((5, 23, 5, 45), 'os.path.dirname', 'path.dirname', ({(5, 36, 5, 44): '__file__'}, {}), '(__file__)', False, 'from os import path\n'), ((6, 13, 6, 44), 'os.path.join', 'path.join', ({(6, 23, 6, 30): 'dirname', (6, 32, 6, 43): '"""README.md"""'}, {}), "(dirname, 'README.md')", False, 'from os import path\n'), ((10, 43,... |
gguilherme42/Livro-de-Python | Cap_11/ex11.6.py | 465a509d50476fd1a87239c71ed741639d58418b | import sqlite3
from contextlib import closing
nome = input('Nome do produto: ').lower().capitalize()
with sqlite3.connect('precos.db') as conexao:
with closing(conexao.cursor()) as cursor:
cursor.execute('SELECT * FROM Precos WHERE nome_produto = ?', (nome,))
registro = cursor.fetchone()
... | [((6, 5, 6, 33), 'sqlite3.connect', 'sqlite3.connect', ({(6, 21, 6, 32): '"""precos.db"""'}, {}), "('precos.db')", False, 'import sqlite3\n')] |
JTJL/jet20 | jet20/backend/solver.py | 2dc01ebf937f8501bcfb15c6641c569f8097ccf5 |
import torch
import time
import copy
from jet20.backend.constraints import *
from jet20.backend.obj import *
from jet20.backend.config import *
from jet20.backend.core import solve,OPTIMAL,SUB_OPTIMAL,USER_STOPPED
import logging
logger = logging.getLogger(__name__)
class Solution(object):
def __init__(self,x... | [((12, 9, 12, 36), 'logging.getLogger', 'logging.getLogger', ({(12, 27, 12, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((39, 61, 39, 80), 'torch.device', 'torch.device', ({(39, 74, 39, 79): '"""cpu"""'}, {}), "('cpu')", False, 'import torch\n'), ((136, 16, 136, 27), 'time.time', 'time.time', ({}, ... |
mengfu188/mmdetection.bak | tests/test_transforms.py | 0bc0ea591b5725468f83f9f48630a1e3ad599303 | import torch
from mmdet.datasets.pipelines.transforms import Pad
from mmdet.datasets.pipelines.transforms import FilterBox
import numpy as np
import cv2
def test_pad():
raw = dict(
img=np.zeros((200, 401, 3), dtype=np.uint8)
)
cv2.imshow('raw', raw['img'])
pad = Pad(square=True, pad_val=255)
... | [((12, 4, 12, 33), 'cv2.imshow', 'cv2.imshow', ({(12, 15, 12, 20): '"""raw"""', (12, 22, 12, 32): "raw['img']"}, {}), "('raw', raw['img'])", False, 'import cv2\n'), ((13, 10, 13, 39), 'mmdet.datasets.pipelines.transforms.Pad', 'Pad', (), '', False, 'from mmdet.datasets.pipelines.transforms import Pad\n'), ((17, 4, 17, ... |
akulamartin/lumberyard | dev/Tools/build/waf-1.7.13/lmbrwaflib/unit_test_lumberyard_modules.py | 2d4be458a02845179be098e40cdc0c48f28f3b5a | #
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | [((48, 1, 48, 17), 'pytest.fixture', 'pytest.fixture', ({}, {}), '()', False, 'import pytest\n'), ((65, 1, 65, 17), 'pytest.fixture', 'pytest.fixture', ({}, {}), '()', False, 'import pytest\n'), ((74, 4, 74, 44), 'lumberyard_modules.sanitize_kw_input', 'lumberyard_modules.sanitize_kw_input', ({(74, 41, 74, 43): 'kw'}, ... |
drofp/linprog_curvefit | linprog_curvefit.py | 96ba704edae7cea42d768d7cc6d4036da2ba313a | #!/usr/bin/env python3
"""Curve fitting with linear programming.
Minimizes the sum of error for each fit point to find the optimal coefficients
for a given polynomial.
Overview:
Objective: Sum of errors
Subject to: Bounds on coefficients
Credit: "Curve Fitting with Linear Programming", H. Swanson and R. E. ... | [((25, 18, 25, 29), 'enum.auto', 'enum.auto', ({}, {}), '()', False, 'import enum\n'), ((26, 24, 26, 35), 'enum.auto', 'enum.auto', ({}, {}), '()', False, 'import enum\n'), ((117, 17, 118, 73), 'ortools.linear_solver.pywraplp.Solver', 'pywraplp.Solver', ({(118, 12, 118, 31): '"""polynomial_solver"""', (118, 33, 118, 72... |
aciidb0mb3r/swift-stress-tester | build-script-helper.py | aad9df89d2aae4640e9f4e06c234818c6b3ed434 | #!/usr/bin/env python
"""
This source file is part of the Swift.org open source project
Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRI... | [((34, 11, 34, 65), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((51, 22, 51, 75), 'os.path.join', 'os.path.join', ({(51, 35, 51, 51): 'parsed.toolchain', (51, 53, 51, 58): '"""usr"""', (51, 60, 51, 65): '"""bin"""', (51, 67, 51, 74): '"""swift"""'}, {}), "(parsed.toolchai... |
pcaston/core | tests/components/deconz/test_scene.py | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | """deCONZ scene platform tests."""
from unittest.mock import patch
from openpeerpower.components.scene import DOMAIN as SCENE_DOMAIN, SERVICE_TURN_ON
from openpeerpower.const import ATTR_ENTITY_ID
from .test_gateway import (
DECONZ_WEB_REQUEST,
mock_deconz_put_request,
setup_deconz_integration,
)
async... | [((36, 9, 36, 45), 'unittest.mock.patch.dict', 'patch.dict', ({(36, 20, 36, 38): 'DECONZ_WEB_REQUEST', (36, 40, 36, 44): 'data'}, {}), '(DECONZ_WEB_REQUEST, data)', False, 'from unittest.mock import patch\n')] |
roscisz/TensorHive | tensorhive/config.py | 4a680f47a0ee1ce366dc82ad9964e229d9749c4e | from pathlib import PosixPath
import configparser
from typing import Dict, Optional, Any, List
from inspect import cleandoc
import shutil
import tensorhive
import os
import logging
log = logging.getLogger(__name__)
class CONFIG_FILES:
# Where to copy files
# (TensorHive tries to load these by default)
con... | [((9, 6, 9, 33), 'logging.getLogger', 'logging.getLogger', ({(9, 24, 9, 32): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((15, 17, 15, 33), 'pathlib.PosixPath.home', 'PosixPath.home', ({}, {}), '()', False, 'from pathlib import PosixPath\n'), ((22, 29, 22, 48), 'pathlib.PosixPath', 'PosixPath', ({(22, 3... |
iz2late/baseline-seq2seq | model.py | 2bfa8981083aed8d30befeb42e41fe78d8ec1641 | import random
from typing import Tuple
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch import Tensor
class Encoder(nn.Module):
def __init__(self, input_dim, emb_dim, enc_hid_dim, dec_hid_dim, dropout):
super().__init__()
self.input_dim = in... | [((19, 25, 19, 57), 'torch.nn.Embedding', 'nn.Embedding', ({(19, 38, 19, 47): 'input_dim', (19, 49, 19, 56): 'emb_dim'}, {}), '(input_dim, emb_dim)', True, 'import torch.nn as nn\n'), ((20, 19, 20, 69), 'torch.nn.GRU', 'nn.GRU', (), '', True, 'import torch.nn as nn\n'), ((21, 18, 21, 57), 'torch.nn.Linear', 'nn.Linear'... |
xuyannus/Machine-Learning-Collection | ML/Pytorch/more_advanced/Seq2Seq/seq2seq.py | 6d5dcd18d4e40f90e77355d56a2902e4c617ecbe | import torch
import torch.nn as nn
import torch.optim as optim
from torchtext.datasets import Multi30k
from torchtext.data import Field, BucketIterator
import numpy as np
import spacy
import random
from torch.utils.tensorboard import SummaryWriter # to print to tensorboard
from utils import translate_sentence, bleu, s... | [((12, 12, 12, 28), 'spacy.load', 'spacy.load', ({(12, 23, 12, 27): '"""de"""'}, {}), "('de')", False, 'import spacy\n'), ((13, 12, 13, 28), 'spacy.load', 'spacy.load', ({(13, 23, 13, 27): '"""en"""'}, {}), "('en')", False, 'import spacy\n'), ((24, 9, 24, 88), 'torchtext.data.Field', 'Field', (), '', False, 'from torch... |
eublefar/gail_chatbot | gail_chatbot/light/sqil/light_sentence_imitate_mixin.py | fcb7798515c0e2c031b5127803eb8a9f1fd4f0ab | from typing import Dict, Any, List
import string
from parlai.core.agents import Agent
from parlai.core.message import Message
from random import sample
import pathlib
path = pathlib.Path(__file__).parent.absolute()
class LightImitateMixin(Agent):
"""Abstract class that handles passing expert trajectories alo... | [((12, 7, 12, 29), 'pathlib.Path', 'pathlib.Path', ({(12, 20, 12, 28): '__file__'}, {}), '(__file__)', False, 'import pathlib\n')] |
TeoZosa/pytudes | pytudes/_2021/educative/grokking_the_coding_interview/fast_and_slow_pointers/_1__linked_list_cycle__easy.py | 4f01ab20f936bb4b3f42d1946180d4a20fd95fbf | """https://www.educative.io/courses/grokking-the-coding-interview/N7rwVyAZl6D
Categories:
- Binary
- Bit Manipulation
- Blind 75
See Also:
- pytudes/_2021/leetcode/blind_75/linked_list/_141__linked_list_cycle__easy.py
"""
from pytudes._2021.utils.linked_list import (
ListNode,
NodeType,
... | [((58, 11, 58, 58), 'pytudes._2021.utils.linked_list.convert_list_to_linked_list', 'convert_list_to_linked_list', ({(58, 39, 58, 57): '[1, 2, 3, 4, 5, 6]'}, {}), '([1, 2, 3, 4, 5, 6])', False, 'from pytudes._2021.utils.linked_list import ListNode, NodeType, convert_list_to_linked_list\n')] |
whtt8888/TritonHTTPserver | httpd.py | 99adf3f1e6c3867bb870cda8434605c59409ea19 | import sys
import os
import socket
import time
import threading
class MyServer:
def __init__(self, port, doc_root):
self.port = port
self.doc_root = doc_root
self.host = '127.0.0.1'
self.res_200 = "HTTP/1.1 200 OK\r\nServer: Myserver 1.0\r\n"
self.res_404 = "HTTP/1.1 404 N... | [((64, 22, 64, 60), 'os.path.realpath', 'os.path.realpath', ({(64, 39, 64, 59): 'self.doc_root + path'}, {}), '(self.doc_root + path)', False, 'import os\n'), ((129, 9, 129, 58), 'socket.socket', 'socket.socket', ({(129, 23, 129, 37): 'socket.AF_INET', (129, 39, 129, 57): 'socket.SOCK_STREAM'}, {}), '(socket.AF_INET, s... |
riven314/ENetDepth_TimeAnlysis_Tmp | metric/metric.py | 29bd864adf91700799d87b449d0c4e389f7028bc | class Metric(object):
"""Base class for all metrics.
From: https://github.com/pytorch/tnt/blob/master/torchnet/meter/meter.py
"""
def reset(self):
pass
def add(self):
pass
def value(self):
pass
| [] |
problemfighter/pf-pweb-sourceman | pf_pweb_sourceman/task/git_repo_man.py | 827b1d92ac992ec1495b128e99137aab1cfa09a0 | from git import Repo
from pf_pweb_sourceman.common.console import console
from pf_py_file.pfpf_file_util import PFPFFileUtil
class GitRepoMan:
def get_repo_name_from_url(self, url: str):
if not url:
return None
last_slash_index = url.rfind("/")
last_suffix_index = url.rfind("... | [((26, 15, 26, 42), 'pf_py_file.pfpf_file_util.PFPFFileUtil.is_exist', 'PFPFFileUtil.is_exist', ({(26, 37, 26, 41): 'path'}, {}), '(path)', False, 'from pf_py_file.pfpf_file_util import PFPFFileUtil\n'), ((27, 12, 27, 84), 'pf_pweb_sourceman.common.console.console.success', 'console.success', ({(27, 28, 27, 83): "('Clo... |
shanmukmichael/Asset-Discovery-Tool | tool/remote_info.py | 82c3f2f5cecb394a1ad87b2e504fbef219a466fd | import socket
import paramiko
import json
Hostname = '34.224.2.243'
Username = 'ec2-user'
key = 'G:/Projects/Python/Asset-Discovery-Tool/tool/s.pem'
def is_connected():
try:
# connect to the host -- tells us if the host is actually
# reachable
socket.create_connection(("8.8.8.8", 53))
... | [((23, 10, 23, 30), 'paramiko.SSHClient', 'paramiko.SSHClient', ({}, {}), '()', False, 'import paramiko\n'), ((67, 11, 67, 46), 'json.dumps', 'json.dumps', (), '', False, 'import json\n'), ((14, 8, 14, 49), 'socket.create_connection', 'socket.create_connection', ({(14, 33, 14, 48): "('8.8.8.8', 53)"}, {}), "(('8.8.8.8'... |
Famoco/hvac | hvac/api/secrets_engines/kv_v2.py | cdc1854385dd981de38bcb6350f222a52bcf3923 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""KvV2 methods module."""
from hvac import exceptions, utils
from hvac.api.vault_api_base import VaultApiBase
DEFAULT_MOUNT_POINT = 'secret'
class KvV2(VaultApiBase):
"""KV Secrets Engine - Version 2 (API).
Reference: https://www.vaultproject.io/api/secret/kv/k... | [((39, 19, 39, 88), 'hvac.utils.format_url', 'utils.format_url', (), '', False, 'from hvac import exceptions, utils\n'), ((57, 19, 60, 9), 'hvac.utils.format_url', 'utils.format_url', (), '', False, 'from hvac import exceptions, utils\n'), ((83, 19, 83, 104), 'hvac.utils.format_url', 'utils.format_url', (), '', False, ... |
SaschaWillems/vulkan_slim | android/install-all.py | 642bcf1eaba8bbcb94a8bec61f3454c597af72f9 | # Install all examples to connected device(s)
import subprocess
import sys
answer = input("Install all vulkan examples to attached device, this may take some time! (Y/N)").lower() == 'y'
if answer:
BUILD_ARGUMENTS = ""
for arg in sys.argv[1:]:
if arg == "-validation":
BUILD_ARGUMENTS += "-v... | [((13, 8, 13, 20), 'sys.exit', 'sys.exit', ({(13, 17, 13, 19): '(-1)'}, {}), '(-1)', False, 'import sys\n')] |
juangallostra/moonboard | main.py | d4a35857d480ee4bed06faee44e0347e1070b6b8 | from generators.ahoughton import AhoughtonGenerator
from render_config import RendererConfig
from problem_renderer import ProblemRenderer
from moonboard import get_moonboard
from adapters.default import DefaultProblemAdapter
from adapters.crg import CRGProblemAdapter
from adapters.ahoughton import AhoughtonAdapter
impo... | [((13, 13, 13, 29), 'render_config.RendererConfig', 'RendererConfig', ({}, {}), '()', False, 'from render_config import RendererConfig\n'), ((30, 31, 30, 113), 'generators.ahoughton.AhoughtonGenerator', 'AhoughtonGenerator', (), '', False, 'from generators.ahoughton import AhoughtonGenerator\n'), ((37, 31, 37, 113), 'g... |
JohnyTheCarrot/GearBot | GearBot/Util/Pages.py | 8a32bfc79f997a154c9abccbf6742a79fc5257b0 | import discord
from Util import Utils, Emoji, Translator
page_handlers = dict()
known_messages = dict()
def on_ready(bot):
load_from_disc()
def register(type, init, update, sender_only=False):
page_handlers[type] = {
"init": init,
"update": update,
"sender_only": sender_only
}... | [((151, 4, 151, 54), 'Util.Utils.saveToDisk', 'Utils.saveToDisk', ({(151, 21, 151, 37): '"""known_messages"""', (151, 39, 151, 53): 'known_messages'}, {}), "('known_messages', known_messages)", False, 'from Util import Utils, Emoji, Translator\n'), ((156, 21, 156, 60), 'Util.Utils.fetch_from_disk', 'Utils.fetch_from_di... |
msc-acse/acse-9-independent-research-project-Wade003 | software/Opal/spud/diamond/build/lib.linux-x86_64-2.7/diamond/dialogs.py | cfcba990d52ccf535171cf54c0a91b184db6f276 | #!/usr/bin/env python
# This file is part of Diamond.
#
# Diamond is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | [] |
tim-fi/pyxel_games | src/mazes.py | 3df9d7e1f3d5436d2051db3f5783bdeab916c054 | from __future__ import annotations
from dataclasses import dataclass, field, InitVar
from typing import List, Tuple, Iterator, Iterable, Optional
from random import choice
import pyxel
# -------------------------------------------------------
# Types
# -------------------------------------------------------
Maze = T... | [((51, 26, 51, 54), 'dataclasses.field', 'field', (), '', False, 'from dataclasses import dataclass, field, InitVar\n'), ((52, 36, 52, 75), 'dataclasses.field', 'field', (), '', False, 'from dataclasses import dataclass, field, InitVar\n'), ((53, 23, 53, 40), 'dataclasses.field', 'field', (), '', False, 'from dataclass... |
bobjiangps/django-blog | bobjiang/settings.py | 6afd36fa96c5a027546575b362b0a481c5d7c1a5 | """
Django settings for bobjiang project.
Generated by 'django-admin startproject' using Django 2.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
i... | [((154, 13, 154, 44), 'os.path.join', 'os.path.join', ({(154, 26, 154, 34): 'BASE_DIR', (154, 36, 154, 43): '"""media"""'}, {}), "(BASE_DIR, 'media')", False, 'import os\n'), ((19, 13, 19, 34), 'json.load', 'json.load', ({(19, 23, 19, 33): 'store_file'}, {}), '(store_file)', False, 'import json\n'), ((150, 4, 150, 36),... |
titusnjuguna/FreeDom | Users/models.py | 204b3d06ba66e6e8a04af976a25c3c1b7c070f75 | from django.db import models
from django.contrib.auth.models import User
from PIL import Image
class Profile(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
image = models.ImageField(default='default.jpg',
upload_to='profile_pic/')
... | [((6, 11, 6, 60), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import models\n'), ((7, 12, 8, 55), 'django.db.models.ImageField', 'models.ImageField', (), '', False, 'from django.db import models\n'), ((16, 14, 16, 39), 'PIL.Image', 'Image', ({(16, 20, 16, 38): 'self.prof_pic.path'... |
zjj2wry/dvc | dvc/__init__.py | c9df567938eefd7b1f5b094c15f04e5ce704aa36 | """
DVC
----
Make your data science projects reproducible and shareable.
"""
import os
import warnings
VERSION_BASE = '0.23.2'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
HOMEPATH = os.path.dirname(PACKAGEPATH)
VERSIONPATH = os.path.join(PACKAGEPATH, 'version.py')
def _updat... | [((14, 11, 14, 39), 'os.path.dirname', 'os.path.dirname', ({(14, 27, 14, 38): 'PACKAGEPATH'}, {}), '(PACKAGEPATH)', False, 'import os\n'), ((15, 14, 15, 53), 'os.path.join', 'os.path.join', ({(15, 27, 15, 38): 'PACKAGEPATH', (15, 40, 15, 52): '"""version.py"""'}, {}), "(PACKAGEPATH, 'version.py')", False, 'import os\n'... |
robperch/robase_datalysis | pkg_dir/src/utils/notion_utils.py | 343cb59b16630ca776bd941897ab8da63f20bfe1 | ## MODULE WITH UTIL FUNCTIONS - NOTION
"----------------------------------------------------------------------------------------------------------------------"
####################################################### Imports ########################################################
"---------------------------------... | [((61, 10, 65, 5), 'requests.request', 'requests.request', (), '', False, 'import requests\n'), ((86, 16, 86, 35), 'pkg_dir.src.utils.general_utils.read_yaml', 'read_yaml', ({(86, 26, 86, 34): 'crds_loc'}, {}), '(crds_loc)', False, 'from pkg_dir.src.utils.general_utils import read_yaml\n'), ((255, 11, 255, 58), 'pandas... |
velezd/permian | libpermian/issueanalyzer/test_baseissue.py | b52189f44c3112ad933a6b1e303a6b30c272651a | import unittest
import logging
import contextlib
from libpermian.settings import Settings
from .proxy import IssueAnalyzerProxy
from .base import BaseAnalyzer, BaseIssue
from .issueset import IssueSet
LOGGER = logging.getLogger('test')
class NewIssue(BaseIssue):
def submit(self):
LOGGER.info('submit was... | [((11, 9, 11, 34), 'logging.getLogger', 'logging.getLogger', ({(11, 27, 11, 33): '"""test"""'}, {}), "('test')", False, 'import logging\n'), ((96, 15, 106, 5), 'libpermian.settings.Settings', 'Settings', ({(97, 8, 103, 9): "{'issueAnalyzer': {'create_issues': False, 'update_issues': False,\n 'create_issues_instead_o... |
gavinmischler/naplib-python | naplib/alignment/prosodylab_aligner/__main__.py | 8cd7a0fc700f1c07243169ec42fc087955885adc | # Copyright (c) 2011-2014 Kyle Gorman and Michael Wagner
#
# 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,... | [((87, 0, 87, 55), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((159, 0, 159, 24), 'logging.info', 'logging.info', ({(159, 13, 159, 23): '"""Success!"""'}, {}), "('Success!')", False, 'import logging\n'), ((95, 11, 95, 29), 'utilities.resolve_opts', 'resolve_opts', ({(95, 24, 95, 2... |
andgein/sis-2017-winter-olymp | init/build_statements.py | e6cf290ab2c24a22ca76949895e2a6cc6d818dc0 | #!/usr/bin/env python3
import codecs
import os
import os.path
import shutil
import subprocess
import logging
import glob
import json
CONTEST_DIR = 'polygon-contest'
INIT_FILE = 'init.txt'
BUILD_DIR = 'build'
LANGUAGE = 'russian'
FILES_DIR = 'files-' + LANGUAGE
def time_limit_from_int(tl):
tl //= 1000
return... | [((32, 10, 32, 21), 'os.getcwd', 'os.getcwd', ({}, {}), '()', False, 'import os\n'), ((33, 4, 33, 23), 'os.chdir', 'os.chdir', ({(33, 13, 33, 22): 'BUILD_DIR'}, {}), '(BUILD_DIR)', False, 'import os\n'), ((34, 4, 34, 53), 'logging.info', 'logging.info', ({(34, 17, 34, 52): "('Compile problem %s' % problem_name)"}, {}),... |
mmurooka/mc_rtc_data | conanfile.py | bf45279cc59f9d85915cb2a01a84c23e5ce45958 | # -*- coding: utf-8 -*-
#
from conans import python_requires
import conans.tools as tools
import os
base = python_requires("Eigen3ToPython/latest@multi-contact/dev")
class MCRTCDataConan(base.Eigen3ToPythonConan):
name = "mc_rtc_data"
version = "1.0.4"
description = "Environments/Robots description for m... | [((8, 7, 8, 65), 'conans.python_requires', 'python_requires', ({(8, 23, 8, 64): '"""Eigen3ToPython/latest@multi-contact/dev"""'}, {}), "('Eigen3ToPython/latest@multi-contact/dev')", False, 'from conans import python_requires\n'), ((35, 20, 35, 73), 'os.path.join', 'os.path.join', ({(35, 33, 35, 52): 'self.package_folde... |
ExiaSR/hyperion | hyperion/migrations/0006_auto_20190218_2251.py | 0b14ef55ed00b964f1966c722f4162c475aa4895 | # Generated by Django 2.1.5 on 2019-02-18 22:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('hyperion', '0005_auto_20190212_2116'),
]
operations = [
migrations.RenameField(
model_name='pos... | [((14, 8, 18, 9), 'django.db.migrations.RenameField', 'migrations.RenameField', (), '', False, 'from django.db import migrations, models\n'), ((22, 18, 22, 200), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import migrations, models\n'), ((27, 18, 27, 160), 'django.db.models.CharFiel... |
nithyadurai87/pottan-ocr-tamil | pottan_ocr/utils.py | e455891dc0ddd508d1318abf84fc59cc548873f7 | import torch
import json
import numpy as np
from torch.autograd import Variable
import gzip
import yaml
from re import split
from matplotlib import pyplot
def showImg( im ):
pyplot.imshow( im )
pyplot.show()
def myOpen( fname, mode ):
return open( fname, mode, encoding="utf-8" )
def readFile( fname ):
... | [((12, 4, 12, 23), 'matplotlib.pyplot.imshow', 'pyplot.imshow', ({(12, 19, 12, 21): 'im'}, {}), '(im)', False, 'from matplotlib import pyplot\n'), ((13, 4, 13, 17), 'matplotlib.pyplot.show', 'pyplot.show', ({}, {}), '()', False, 'from matplotlib import pyplot\n'), ((29, 15, 29, 29), 'json.load', 'json.load', ({(29, 26,... |
kleisauke/pyvips | pyvips/error.py | ae3b0c09669cfb662e773e8ae69cf589ac15e320 | # errors from libvips
import sys
import logging
from pyvips import ffi, vips_lib
logger = logging.getLogger(__name__)
_is_PY3 = sys.version_info[0] == 3
if _is_PY3:
text_type = str
else:
text_type = unicode
ffi.cdef('''
const char* vips_error_buffer (void);
void vips_error_clear (void);
''')
de... | [((8, 9, 8, 36), 'logging.getLogger', 'logging.getLogger', ({(8, 27, 8, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((17, 0, 21, 4), 'pyvips.ffi.cdef', 'ffi.cdef', ({(17, 9, 21, 3): '"""\n const char* vips_error_buffer (void);\n void vips_error_clear (void);\n\n"""'}, {}), '(\n """\n co... |
cruzanta/population-estimator | population_estimator/curses_io.py | cb56c551b615726543d8b1643302be2d30fd593c | #!/usr/bin/env python
"""
Module for painting output on and obtaining input from a text-based terminal
window using the curses library.
"""
import curses
import textwrap
def display_string(screen, a_string, output_line):
# Paints a string on a text-based terminal window.
_, width = screen.getmaxyx()
tr... | [((17, 38, 17, 72), 'textwrap.fill', 'textwrap.fill', ({(17, 52, 17, 60): 'a_string', (17, 62, 17, 71): '(width - 1)'}, {}), '(a_string, width - 1)', False, 'import textwrap\n'), ((19, 28, 20, 79), 'textwrap.fill', 'textwrap.fill', ({(20, 12, 20, 67): '"""Terminal window too small for output! Please resize. """', (20, ... |
hwinther/lanot | tools/micropython-mockup/urandom.py | f6700cacb3946535081624467b746fdfd38e021d | def randrange(n, y):
pass
| [] |
botisko/personal_programs | SAP/released_tr_email_sender/ui.py | 2e234271db438e228b9028b8180a6e833f482104 | import json
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from tr_data import TRData, NO_DATA_MEETS_CRITERIA
from email_text import email_body_template
from helpers import send_email
RECIPIENT = <email_address>
EXCEPTION_FILE = "tr_number_exceptions.json"
class TrEmailSender:
def... | [] |
foochane/Tensorflow-Learning | AI-Practice-Tensorflow-Notes-master/opt/opt4_8_backward.py | 54d210a1286051e9d60c98a62bd63eb070bc0a11 | #coding:utf-8
#0导入模块 ,生成模拟数据集
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import opt4_8_generateds
import opt4_8_forward
STEPS = 40000
BATCH_SIZE = 30
LEARNING_RATE_BASE = 0.001
LEARNING_RATE_DECAY = 0.999
REGULARIZER = 0.01
def backward():
x = tf.placeholder(tf.float32, shape=(None, ... | [((16, 5, 16, 48), 'tensorflow.placeholder', 'tf.placeholder', (), '', True, 'import tensorflow as tf\n'), ((17, 6, 17, 49), 'tensorflow.placeholder', 'tf.placeholder', (), '', True, 'import tensorflow as tf\n'), ((19, 14, 19, 44), 'opt4_8_generateds.generateds', 'opt4_8_generateds.generateds', ({}, {}), '()', False, '... |
rodrigomelo9/uvm-python | test/examples/integrated/codec/vip/vip_agent.py | e3127eba2cc1519a61dc6f736d862a8dcd6fce20 | #//
#// -------------------------------------------------------------
#// Copyright 2011 Synopsys, Inc.
#// Copyright 2019-2020 Tuomas Poikela (tpoikela)
#// All Rights Reserved Worldwide
#//
#// Licensed under the Apache License, Version 2.0 (the
#// "License"); you may not use this file except in
#//... | [] |
abosoar/camel_tools | tests/test_transliterate.py | 0a92c06f6dde0063e26df5cbe4d74c2f99b418e0 | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright 2018-2020 New York University Abu Dhabi
#
# 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 limitatio... | [((44, 14, 44, 40), 'camel_tools.utils.charmap.CharMapper', 'CharMapper', ({(44, 25, 44, 33): 'TEST_MAP', (44, 35, 44, 39): 'None'}, {}), '(TEST_MAP, None)', False, 'from camel_tools.utils.charmap import CharMapper\n'), ((70, 15, 70, 42), 'camel_tools.utils.transliterate.Transliterator', 'Transliterator', ({(70, 30, 70... |
liangruibupt/aws-instance-scheduler | source/code/build-instance-scheduler-template.py | a4e46eec9f39c2e3b95c5bcbe32c036e239d6066 | ######################################################################################################################
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | [((31, 15, 31, 71), 'json.loads', 'json.loads', (), '', False, 'import json\n'), ((36, 10, 36, 40), 'json.dumps', 'json.dumps', (), '', False, 'import json\n')] |
StanfordAHA/Configuration | src/parse.py | a5d404433d32b0ac20544d5bafa9422c979afc16 | ###############################################################################
# file -- parse.py --
# Top contributors (to current version):
# Nestan Tsiskaridze
# This file is part of the configuration finder for the Stanford AHA project.
# Copyright (c) 2021 by the authors listed in the file AUTHORS
# in th... | [] |
omerfarukbaysal/neyesem | neyesem/main.py | f69bf4446ce902f00389c8d71f68e1b7db05f86d | from flask import Blueprint, render_template, redirect, url_for, request, flash, make_response
from werkzeug.security import generate_password_hash
from flask_login import login_required, current_user
from . import db
import datetime
from .models import Visitor, User
main = Blueprint('main', __name__)
@main.route('/... | [((8, 7, 8, 34), 'flask.Blueprint', 'Blueprint', ({(8, 17, 8, 23): '"""main"""', (8, 25, 8, 33): '__name__'}, {}), "('main', __name__)", False, 'from flask import Blueprint, render_template, redirect, url_for, request, flash, make_response\n'), ((14, 13, 14, 45), 'flask.request.cookies.get', 'request.cookies.get', ({(1... |
AmandaRH07/Python_Entra21 | 00-Aulas/Aula007_2.py | 4084962508f1597c0498d8b329e0f45e2ac55302 | # Funções
cabecalho = "SISTEMA DE CADASTRO DE FUNCIONARIO\n\n\n"
rodape = "\n\n\n Obrigada pela preferencia"
def imprimir_tela(conteudo):
print(cabecalho)
#print(opcao_menu)
print(conteudo)
print(rodape)
def ler_opcoes():
opcao = int(input("Insira a opção: "))
return opcao
def carregar_o... | [] |
lucassa3/CCompiler | ast_version/src/binop.py | ad788f692dc2863da9111b4a42f54277ac29d5ae | from node import Node
class BinOp(Node):
def eval(self, st):
a = self.children[0].eval(st)
b = self.children[1].eval(st)
if self.value == "MINUS":
return a - b
elif self.value == "PLUS":
return a + b
elif self.value == "MULT":
return a * b
elif self.value == "DIV":
return a // b... | [] |
pylipp/aqtinstall | aqt/installer.py | e08667cb5c9ced27994c4cde16d0c1b4a4386455 | #!/usr/bin/env python3
#
# Copyright (C) 2018 Linus Jahn <lnj@kaidan.im>
# Copyright (C) 2019,2020 Hiroshi Miura <miurahr@linux.com>
# Copyright (C) 2020, Aurélien Gâteau
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software... | [((62, 24, 62, 34), 'aqt.settings.Settings', 'Settings', ({}, {}), '()', False, 'from aqt.settings import Settings\n'), ((68, 21, 68, 40), 'time.perf_counter', 'time.perf_counter', ({}, {}), '()', False, 'import time\n'), ((71, 18, 71, 36), 'requests.Session', 'requests.Session', ({}, {}), '()', False, 'import requests... |
MiCHiLU/google_appengine_sdk | lib/django-0.96/django/views/generic/list_detail.py | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | from django.template import loader, RequestContext
from django.http import Http404, HttpResponse
from django.core.xheaders import populate_xheaders
from django.core.paginator import ObjectPaginator, InvalidPage
from django.core.exceptions import ObjectDoesNotExist
def object_list(request, queryset, paginate_by=None, p... | [] |
NTT123/pax | pax/_src/core/utility_modules.py | b80e1e4b6bfb763afd6b4fdefa31a051ca8a3335 | """Utility Modules."""
from typing import Any, Callable, Dict, List, Optional, Sequence, TypeVar, Union
import jax
import jax.numpy as jnp
from .module import Module, parameters_method
T = TypeVar("T", bound=Module)
O = TypeVar("O")
class ParameterModule(Module):
"""A PAX module that registers attributes as ... | [((11, 4, 11, 30), 'typing.TypeVar', 'TypeVar', (), '', False, 'from typing import Any, Callable, Dict, List, Optional, Sequence, TypeVar, Union\n'), ((12, 4, 12, 16), 'typing.TypeVar', 'TypeVar', ({(12, 12, 12, 15): '"""O"""'}, {}), "('O')", False, 'from typing import Any, Callable, Dict, List, Optional, Sequence, Typ... |
kernicPanel/richie | src/richie/apps/courses/lms/edx.py | 803deda3e29383ce85593e1836a3cf4efc6b847e | """
Backend to connect Open edX richie with an LMS
"""
import logging
import re
import requests
from requests.auth import AuthBase
from ..serializers import SyncCourseRunSerializer
from .base import BaseLMSBackend
logger = logging.getLogger(__name__)
def split_course_key(key):
"""Split an OpenEdX course key by... | [((13, 9, 13, 36), 'logging.getLogger', 'logging.getLogger', ({(13, 27, 13, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((70, 15, 70, 64), 're.match', 're.match', ({(70, 24, 70, 58): "self.configuration['COURSE_REGEX']", (70, 60, 70, 63): 'url'}, {}), "(self.configuration['COURSE_REGEX'], url)", Fa... |
jpabb7/p2pScrapper | BitTorrent-5.2.2/BTL/brpclib.py | 0fd57049606864223eb45f956a58adda1231af88 | # by Greg Hazel
import xmlrpclib
from xmlrpclib2 import *
from BTL import brpc
old_PyCurlTransport = PyCurlTransport
class PyCurlTransport(old_PyCurlTransport):
def set_connection_params(self, h):
h.add_header('User-Agent', "brpclib.py/1.0")
h.add_header('Connection', "Keep-Alive")
h.add_... | [] |
den-gts/django-database-files-3000 | database_files/views.py | 0a135004427c021944b30ef8aace844ab20b9cfb | import base64
import mimetypes
import os
from django.conf import settings
from django.http import Http404, HttpResponse
from django.shortcuts import get_object_or_404
from django.views.decorators.cache import cache_control
from django.views.static import serve as django_serve
from database_files.models import File
... | [((14, 1, 14, 29), 'django.views.decorators.cache.cache_control', 'cache_control', (), '', False, 'from django.views.decorators.cache import cache_control\n'), ((19, 8, 19, 42), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (), '', False, 'from django.shortcuts import get_object_or_404\n'), ((22, 15, 22, 6... |
TVect/NoiseFiltersPy | NoiseFiltersPy/Injector.py | fff1f3113cf9b3e7b8de65421ab9951fd3cb11e5 | import numpy as np
import pandas as pd
from abc import ABC
class Injector(ABC):
"""Base class for the injectors of artificial noise.
Attributes
----------
rem_indx : :obj:`List`
Removed indexes (rows) from the dataset after the filtering.
parameters : :obj:`Dict`
Parameters used ... | [((63, 14, 63, 41), 'numpy.random.default_rng', 'np.random.default_rng', ({(63, 36, 63, 40): 'seed'}, {}), '(seed)', True, 'import numpy as np\n'), ((25, 26, 25, 50), 'pandas.DataFrame', 'pd.DataFrame', ({(25, 39, 25, 49): 'attributes'}, {}), '(attributes)', True, 'import pandas as pd\n'), ((30, 27, 30, 47), 'pandas.Da... |
hackBCA/hackbcafour | application/mod_user/forms.py | 971120ff88423cc660f92985790cddf9939838bf | from wtforms import Form, TextField, PasswordField, SelectField, TextAreaField, BooleanField, validators, ValidationError, RadioField
import re
phone_regex = "(\+\d+-?)?((\(?\d{3}\)?)|(\d{3}))-?\d{3}-?\d{4}$"
gender_choices = [
("", "Gender"),
("male", "Male"),
("female", "Female"),
("other", "Other"... | [((130, 23, 130, 119), 'wtforms.PasswordField', 'PasswordField', (), '', False, 'from wtforms import Form, TextField, PasswordField, SelectField, TextAreaField, BooleanField, validators, ValidationError, RadioField\n'), ((229, 23, 229, 119), 'wtforms.PasswordField', 'PasswordField', (), '', False, 'from wtforms import ... |
gh640/coding-challenge | src/app.py | 3be31d643ac081bfec3495cb8f705c400be82553 | # coding: utf-8
'''フロントコントローラを提供する
'''
from math import ceil
import os
from flask import json
from flask import Flask
from flask import request
from flask import send_from_directory
from flask import render_template
# from json_loader import load_locations
# from json_loader import prepare_locations
from models imp... | [((24, 6, 24, 21), 'flask.Flask', 'Flask', ({(24, 12, 24, 20): '__name__'}, {}), '(__name__)', False, 'from flask import Flask\n'), ((32, 11, 32, 46), 'flask.send_from_directory', 'send_from_directory', ({(32, 31, 32, 39): '"""static"""', (32, 41, 32, 45): 'path'}, {}), "('static', path)", False, 'from flask import sen... |
MrBartusek/corkus.py | corkus/objects/dungeon.py | 031c11e3e251f0bddbcb67415564357460fe7fea | from __future__ import annotations
from .base import CorkusBase
from enum import Enum
class DungeonType(Enum):
REMOVED = "REMOVED"
"""Dungeons that were removed from the game in version ``1.14.1`` like ``Skeleton`` or ``Spider``"""
REMOVED_MINI = "REMOVED_MINI"
"""Minidungeons that were reworked in ve... | [] |
chaoer/brisk-descriptor | src/brisk.py | 140b08539768b8038680fd86d7fda9688dd5b908 |
import pybrisk
class Brisk:
def __init__(self, thresh=60, octaves=4):
self.thresh = thresh
self.octaves = octaves
self.descriptor_extractor = pybrisk.create()
def __del__(self):
pybrisk.destroy(self.descriptor_extractor)
def detect(self, img):
return pybrisk.detec... | [((8, 36, 8, 52), 'pybrisk.create', 'pybrisk.create', ({}, {}), '()', False, 'import pybrisk\n'), ((11, 8, 11, 50), 'pybrisk.destroy', 'pybrisk.destroy', ({(11, 24, 11, 49): 'self.descriptor_extractor'}, {}), '(self.descriptor_extractor)', False, 'import pybrisk\n'), ((14, 15, 15, 47), 'pybrisk.detect', 'pybrisk.detect... |
tantinlala/hale-hub | hale_hub/outlet_interface.py | da2e6d24e3869ee533d2e272ce87b9e7eede9a79 | import serial
import serial.tools.list_ports
from hale_hub.constants import STARTING_OUTLET_COMMAND, SERIAL_BAUD_RATE, SERIAL_TIMEOUT
from hale_hub.ifttt_logger import send_ifttt_log
class _Outlet:
def __init__(self, name):
self.state = 0
self.name = name
class _OutletInterface:
def __init__... | [((28, 36, 28, 101), 'serial.Serial', 'serial.Serial', (), '', False, 'import serial\n'), ((30, 12, 30, 70), 'hale_hub.ifttt_logger.send_ifttt_log', 'send_ifttt_log', ({(30, 27, 30, 35): '__name__', (30, 37, 30, 69): '"""No serial ports could be upon!"""'}, {}), "(__name__, 'No serial ports could be upon!')", False, 'f... |
carbonscott/helix | helix/core.py | e2ee6e1293cae4f0bd1220ed5a41268d20a095db | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
def remove_nan(xyzs): return xyzs[~np.isnan(xyzs).any(axis = 1)]
def measure_twocores(core_xyz_ref, core_xyz_tar):
''' Measure the following aspects of two helical cores.
- Interhelical distance vector between the centers.
- Inte... | [((16, 17, 16, 51), 'numpy.nanmean', 'np.nanmean', (), '', True, 'import numpy as np\n'), ((17, 17, 17, 51), 'numpy.nanmean', 'np.nanmean', (), '', True, 'import numpy as np\n'), ((23, 19, 23, 42), 'numpy.linalg.norm', 'np.linalg.norm', ({(23, 34, 23, 41): 'ih_dvec'}, {}), '(ih_dvec)', True, 'import numpy as np\n'), ((... |
bartekpacia/informatyka-frycz | matury/2011/6.py | 6fdbbdea0c6b6a710378f22e90d467c9f91e64aa | from typing import List
with open("dane/liczby.txt") as f:
nums: List[int] = []
nums_9_chars: List[int] = []
for line in f:
sline = line.strip()
num = int(sline, 2)
if len(sline) == 9:
nums_9_chars.append(num)
nums.append(num)
count_even = 0
max_num = 0
for n... | [] |
familug/FAMILUG | Python/fibs.py | ef8c11d92f4038d80f3f1a24cbab022c19791acf | def fib(n):
if n < 2:
return n
else:
return fib(n-1) + fib(n-2)
def fib_fast(n):
from math import sqrt
s5 = sqrt(5)
x = (1 + s5) ** n
y = (1 - s5) ** n
return int((x - y)/(s5 * 2**n))
def print_fib(n):
for i in range(n):
print fib(i),
print
for i i... | [] |
slavi010/polyhash-2020 | src/model/ParseInput.py | a11aa694fbf901be4f4db565cb09800f8f57eae7 | import os
from typing import List
from src.model.Etape import Etape
from src.model.Grille import Grille
from src.model.ItemCase import ItemCase
from src.model.PointMontage import PointMontage
from src.model.Robot import Robot
from src.model.Tache import Tache
class ParseInput:
"""Parser qui permet de lire le fic... | [((29, 15, 29, 40), 'os.path.isfile', 'os.path.isfile', ({(29, 30, 29, 39): 'file_path'}, {}), '(file_path)', False, 'import os\n'), ((44, 21, 44, 53), 'src.model.Grille.Grille', 'Grille', ({(44, 28, 44, 39): 'lines[0][0]', (44, 41, 44, 52): 'lines[0][1]'}, {}), '(lines[0][0], lines[0][1])', False, 'from src.model.Gril... |
UnKafkaesque/Sentiment-Analysis | test.py | bd8517420534bcfe76f2f60a4f178d1dac540075 | import os
import sys
import time
import traceback
import project1_Copy as p1
import numpy as np
verbose = False
def green(s):
return '\033[1;32m%s\033[m' % s
def yellow(s):
return '\033[1;33m%s\033[m' % s
def red(s):
return '\033[1;31m%s\033[m' % s
def log(*m):
print(" ".join(map(str, m)))
def log... | [((113, 21, 113, 37), 'numpy.array', 'np.array', ({(113, 30, 113, 36): '[1, 2]'}, {}), '([1, 2])', True, 'import numpy as np\n'), ((126, 21, 126, 47), 'numpy.array', 'np.array', ({(126, 30, 126, 46): '[[1, 2], [1, 2]]'}, {}), '([[1, 2], [1, 2]])', True, 'import numpy as np\n'), ((140, 21, 140, 37), 'numpy.array', 'np.a... |
mag-id/epam_python_autumn_2020 | homework_1/tests/test_3.py | 2488817ba039f5722030a23edc97abe9f70a9a30 | """
Unit tests for module `homework_1.tasks.task_3`.
"""
from tempfile import NamedTemporaryFile
from typing import Tuple
import pytest
from homework_1.tasks.task_3 import find_maximum_and_minimum
@pytest.mark.parametrize(
["file_content", "expected_result"],
[
pytest.param(
"0\n",
... | [((51, 9, 51, 38), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', (), '', False, 'from tempfile import NamedTemporaryFile\n'), ((16, 8, 20, 9), 'pytest.param', 'pytest.param', (), '', False, 'import pytest\n'), ((21, 8, 25, 9), 'pytest.param', 'pytest.param', (), '', False, 'import pytest\n'), ((26, 8, 30, 9), 'p... |
sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/storage/v20181101/blob_container.py | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | [((41, 5, 41, 38), 'pulumi.getter', 'pulumi.getter', (), '', False, 'import pulumi\n'), ((53, 5, 53, 44), 'pulumi.getter', 'pulumi.getter', (), '', False, 'import pulumi\n'), ((65, 5, 65, 40), 'pulumi.getter', 'pulumi.getter', (), '', False, 'import pulumi\n'), ((89, 5, 89, 39), 'pulumi.getter', 'pulumi.getter', (), ''... |
CAUCHY2932/Northern_Hemisphere | app/admin/views/__init__.py | 06e5b3e3f0b47940d5b4549899d062373b019579 | # coding:utf-8
import app.admin.views.start
import app.admin.views.book
import app.admin.views.user
import app.admin.views.site
| [] |
aidiary/chainer-siamese | test_mnist.py | 6abce9192298e14682a7c766e2a5cdd10f519193 | import os
import chainer
import chainer.links as L
from net import SiameseNetwork
import numpy as np
import matplotlib.pyplot as plt
# 訓練済みモデルをロード
model = SiameseNetwork()
chainer.serializers.load_npz(os.path.join('result', 'model.npz'), model)
# テストデータをロード
_, test = chainer.datasets.get_mnist(ndim=3)
test_data, te... | [((11, 8, 11, 24), 'net.SiameseNetwork', 'SiameseNetwork', ({}, {}), '()', False, 'from net import SiameseNetwork\n'), ((15, 10, 15, 44), 'chainer.datasets.get_mnist', 'chainer.datasets.get_mnist', (), '', False, 'import chainer\n'), ((32, 0, 32, 62), 'matplotlib.pyplot.legend', 'plt.legend', ({(32, 11, 32, 61): "['0',... |
b0nz0/TwisterTempo | TwoFeetTempoMove.py | fc975af4095509d8ec4fe2f84313fe152577bed2 | from random import randrange, random
from time import time
import logging
from TwisterTempoGUI import TwisterTempoGUI
class TwoFeetTempoMove(object):
COLORS_ALPHA = {0: 'RED', 1: 'BLUE', 2: 'YELLOW', 3: 'GREEN'}
COLORS_RGB = {0: (255, 0, 0), 1: (0, 0, 255), 2: (255, 255, 0), 3: (0, 255, 0)}
FOOT_CHANGE_... | [((27, 8, 29, 72), 'logging.info', 'logging.info', ({(27, 21, 29, 71): "('Starting with LEFT: %s, RIGHT: %s' % (TwoFeetTempoMove.COLORS_ALPHA[self.\n _left_color], TwoFeetTempoMove.COLORS_ALPHA[self._right_color]))"}, {}), "('Starting with LEFT: %s, RIGHT: %s' % (TwoFeetTempoMove.\n COLORS_ALPHA[self._left_color]... |
mohnjahoney/website_source | plugins/panorama/panorama/__init__.py | edc86a869b90ae604f32e736d9d5ecd918088e6a | # -*- coding: utf-8 -*-
"""
Panorama is a Pelican plugin to generate statistics from blog posts
(number of posts per month, categories and so on) display them as beautiful charts.
Project location: https://github.com/romainx/panorama
"""
__version__ = "0.2.0"
__author__ = "romainx"
from .panorama import *
| [] |
cclauss/transitfeed | transitfeed/transfer.py | 54a4081b59bfa015d5f0405b68203e61762d4a52 | #!/usr/bin/python2.5
# Copyright (C) 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 la... | [((62, 7, 62, 38), 'util.IsEmpty', 'util.IsEmpty', ({(62, 20, 62, 37): 'self.from_stop_id'}, {}), '(self.from_stop_id)', False, 'import util\n'), ((68, 7, 68, 36), 'util.IsEmpty', 'util.IsEmpty', ({(68, 20, 68, 35): 'self.to_stop_id'}, {}), '(self.to_stop_id)', False, 'import util\n'), ((118, 15, 118, 71), 'util.Approx... |
Kizito-Alberrt/insta-social | social/urls.py | c632e901cd81b0b139f88ad55236efd6c7ddbef1 | from django.urls import path
from . import views
from . views import UserPostListView, PostDetailView, PostDeleteview, PostCreateView, PostUpdateView,CommentUpdateView, VideoCreateView, video_update
urlpatterns = [
path('',views.base, name='base'),
path('login',views.login, name='login'),
path('register',v... | [((6, 4, 6, 36), 'django.urls.path', 'path', (), '', False, 'from django.urls import path\n'), ((7, 4, 7, 43), 'django.urls.path', 'path', (), '', False, 'from django.urls import path\n'), ((8, 4, 8, 52), 'django.urls.path', 'path', (), '', False, 'from django.urls import path\n'), ((9, 4, 9, 43), 'django.urls.path', '... |
ismarou/vtkplotter-examples | vtkplotter_examples/other/dolfin/collisions.py | 1eefcc026be169ab7a77a5bce6dec8044c33b554 | '''
compute_collision() will compute the collision of all the entities with
a Point while compute_first_collision() will always return its first entry.
Especially if a point is on an element edge this can be tricky.
You may also want to compare with the Cell.contains(Point) tool.
'''
# Script by Rudy at https://fenicsp... | [((15, 7, 15, 34), 'dolfin.UnitSquareMesh', 'dolfin.UnitSquareMesh', ({(15, 29, 15, 30): 'n', (15, 32, 15, 33): 'n'}, {}), '(n, n)', False, 'import dolfin\n'), ((19, 0, 19, 38), 'vtkplotter.dolfin.printc', 'printc', ({(19, 7, 19, 25): '"""collisions : """', (19, 27, 19, 37): 'collisions'}, {}), "('collisions : ',... |
AsciiShell/Alice-Check-Train | alice_check_train/__main__.py | 49d5804d28a237756a7cf27e451ff56166fbee5c | import datetime
import os
from alice_check_train.main import rasp_to_text
from alice_check_train.rasp_api import get_rasp, filter_rasp
def main():
key = os.getenv('RASP_KEY')
station_from = os.getenv('STATION_FROM')
station_to = os.getenv('STATION_TO')
date = datetime.date.today().strftime('%Y-%m-%d'... | [((9, 10, 9, 31), 'os.getenv', 'os.getenv', ({(9, 20, 9, 30): '"""RASP_KEY"""'}, {}), "('RASP_KEY')", False, 'import os\n'), ((10, 19, 10, 44), 'os.getenv', 'os.getenv', ({(10, 29, 10, 43): '"""STATION_FROM"""'}, {}), "('STATION_FROM')", False, 'import os\n'), ((11, 17, 11, 40), 'os.getenv', 'os.getenv', ({(11, 27, 11,... |
cakebytheoceanLuo/k-NN | aws-KNN-RESTful.py | 52c66b5e38490431b3079c2baaad38785802f4e5 | # https://medium.com/@kumon/how-to-realize-similarity-search-with-elasticsearch-3dd5641b9adb
# https://docs.aws.amazon.com/opensearch-service/latest/developerguide/knn.html
import sys
import requests
import h5py
import numpy as np
import json
import aiohttp
import asyncio
import time
import httpx
from requests.auth imp... | [((29, 7, 29, 43), 'requests.auth.HTTPBasicAuth', 'HTTPBasicAuth', ({(29, 21, 29, 28): '"""admin"""', (29, 30, 29, 42): '"""I#vu7bTAHB"""'}, {}), "('admin', 'I#vu7bTAHB')", False, 'from requests.auth import HTTPBasicAuth\n'), ((77, 5, 77, 25), 'h5py.File', 'h5py.File', ({(77, 15, 77, 19): 'path', (77, 21, 77, 24): '"""... |
bauerj/cibuildwheel | test/test_docker_images.py | b4addbf4a94daa76769d4f779e169406b0ef99ae | import platform
import textwrap
import pytest
from . import test_projects, utils
dockcross_only_project = test_projects.new_c_project(
setup_py_add=textwrap.dedent(r'''
import os, sys
# check that we're running in the correct docker image as specified in the
# environment options CIBW_MA... | [((9, 17, 18, 8), 'textwrap.dedent', 'textwrap.dedent', ({(9, 33, 18, 7): '"""\n import os, sys\n\n # check that we\'re running in the correct docker image as specified in the\n # environment options CIBW_MANYLINUX1_*_IMAGE\n if "linux" in sys.platform and not os.path.exists("/dockcross"):\n... |
taka-mochi/cryptocurrency-autotrading | real_trade/MoveAverageTradePosition.py | 16677018c793d7bd3fffdcd3575aecb3535dbd04 | # coding: utf-8
import math
import dateutil
import dateutil.parser
import json
from ChartBars import Chart
from ChartUpdaterByCCWebsocket import ChartUpdaterByCoincheckWS
from Util import BitcoinUtil
def adjust_price_to_tick(price, tick):
return price - math.fmod(price, tick)
def adjust_amount_to_tick(amount, t... | [((13, 19, 13, 41), 'math.fmod', 'math.fmod', ({(13, 29, 13, 34): 'price', (13, 36, 13, 40): 'tick'}, {}), '(price, tick)', False, 'import math\n'), ((16, 20, 16, 43), 'math.fmod', 'math.fmod', ({(16, 30, 16, 36): 'amount', (16, 38, 16, 42): 'tick'}, {}), '(amount, tick)', False, 'import math\n'), ((310, 27, 310, 75), ... |
sbcshop/PiRelay-8 | test.py | 4d881f259c07cd4fdf3c57431feb1587aaa0e861 | from PiRelay8 import Relay
import time
r1 = Relay("RELAY1")
r2 = Relay("RELAY2")
r3 = Relay("RELAY3")
r4 = Relay("RELAY4")
r5 = Relay("RELAY5")
r6 = Relay("RELAY6")
r7 = Relay("RELAY7")
r8 = Relay("RELAY8")
r1.off()
r2.off()
r3.off()
r4.off()
r5.off()
r6.off()
r7.off()
r8.off()
r1.on()
time.s... | [((4, 5, 4, 20), 'PiRelay8.Relay', 'Relay', ({(4, 11, 4, 19): '"""RELAY1"""'}, {}), "('RELAY1')", False, 'from PiRelay8 import Relay\n'), ((5, 5, 5, 20), 'PiRelay8.Relay', 'Relay', ({(5, 11, 5, 19): '"""RELAY2"""'}, {}), "('RELAY2')", False, 'from PiRelay8 import Relay\n'), ((6, 5, 6, 20), 'PiRelay8.Relay', 'Relay', ({... |
johnvictorfs/atlantisbot-rewrite | bot/cogs/clan.py | ac6887f91438206ba926be59d8fd2bedd07923ad | import rs3clans
import discord
from discord.ext import commands
from bot.bot_client import Bot
from bot.utils.tools import separator
from bot.utils.context import Context
class Clan(commands.Cog):
def __init__(self, bot: Bot):
self.bot = bot
@commands.cooldown(1, 5, commands.BucketTyp... | [((15, 5, 15, 54), 'discord.ext.commands.cooldown', 'commands.cooldown', ({(15, 23, 15, 24): '(1)', (15, 26, 15, 27): '(5)', (15, 29, 15, 53): 'commands.BucketType.user'}, {}), '(1, 5, commands.BucketType.user)', False, 'from discord.ext import commands\n'), ((16, 5, 16, 51), 'discord.ext.commands.bot_has_permissions',... |
zsoltn/python-otcextensions | otcextensions/tests/functional/osclient/vpc/v2/common.py | 4c0fa22f095ebd5f9636ae72acbae5048096822c | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | [((25, 16, 25, 30), 'datetime.datetime.now', 'datetime.now', ({}, {}), '()', False, 'from datetime import datetime\n'), ((29, 15, 29, 27), 'uuid.uuid4', 'uuid.uuid4', ({}, {}), '()', False, 'import uuid\n')] |
Robinson04/StructNoSQL | tests/test_nested_structures_inside_structure_values.py | 335c63593025582336bb67ad0b0ed39d30800b74 | import unittest
from typing import Set, Optional, Dict, List
from uuid import uuid4
from StructNoSQL import BaseField, MapModel, TableDataModel
from tests.components.playground_table_clients import PlaygroundDynamoDBBasicTable, TEST_ACCOUNT_ID
class TableModel(TableDataModel):
accountId = BaseField(field_type=st... | [((10, 16, 10, 56), 'StructNoSQL.BaseField', 'BaseField', (), '', False, 'from StructNoSQL import BaseField, MapModel, TableDataModel\n'), ((11, 30, 11, 114), 'StructNoSQL.BaseField', 'BaseField', (), '', False, 'from StructNoSQL import BaseField, MapModel, TableDataModel\n'), ((67, 4, 67, 19), 'unittest.main', 'unitte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.