repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
goubertbrent/oca-backend
src/add_2_zip_imports.py
b9f59cc02568aecb55d4b54aec05245790ea25fd
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
[((1919, 1966), 'mcfw.restapi.register_postcall_hook', 'register_postcall_hook', (['log_restapi_call_result'], {}), '(log_restapi_call_result)\n', (1941, 1966), False, 'from mcfw.restapi import register_postcall_hook, INJECTED_FUNCTIONS\n'), ((2135, 2173), 'rogerthat.utils.transactions.on_trans_committed', 'on_trans_co...
Galaxyinternship/Galaxy
lib/galaxy/model/migrate/versions/0026_cloud_tables.py
204be086a8c16d6684584cefa9053ed7c86a1784
""" This script adds tables needed for Galaxy cloud functionality. """ from __future__ import print_function import datetime import logging from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT now = datetime.datetime.utcnow log = logging.getLogger( __name__ ) metadata = MetaDa...
[((273, 300), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (290, 300), False, 'import logging\n'), ((314, 324), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (322, 324), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((40...
mrf-foundation/ckios_v1
apps/user/urls.py
3556a99ba5e01f00e137fd124903ace77d2cba28
# -*- encoding: utf-8 -*- """ Copyright (c) 2021 ronyman.com """ from django.contrib import admin from django.contrib.auth import views as auth_views from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from apps.user import views as user_views from.views im...
[((373, 404), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (377, 404), False, 'from django.urls import path, include\n'), ((410, 465), 'django.urls.path', 'path', (['"""register/"""', 'user_views.register'], {'name': '"""register"""'}), "('register/', user_view...
tflati/ncbi-search
sra_django_api/user/migrations/0003_auto_20180914_1242.py
2f31c57ffb95c2c874b65c03c58edd96eb822dfb
# Generated by Django 2.0.3 on 2018-09-14 12:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user', '0002_project'), ] operations = [ migrations.RenameField( model_name='project', old_name='file_path', ...
[((221, 314), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""project"""', 'old_name': '"""file_path"""', 'new_name': '"""base_path"""'}), "(model_name='project', old_name='file_path', new_name\n ='base_path')\n", (243, 314), False, 'from django.db import migrations, models\n'),...
frankgh/deep-visualization-toolbox
image_misc.py
c9bb26eacae0b4d1a25d3844538c2830026add76
#! /usr/bin/env python import cv2 import matplotlib.pyplot as plt import skimage import skimage.io from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.pyplot import cm from mpl_toolkits.axes_grid1 import make_axes_locatable from numpy import ...
[((1017, 1036), 'numpy.array', 'array', (['arr', '"""uint8"""'], {}), "(arr, 'uint8')\n", (1022, 1036), False, 'from numpy import arange, array, newaxis, tile, linspace, pad, expand_dims, fromstring, ceil, dtype, float32, sqrt, dot, zeros\n'), ((1633, 1655), 'matplotlib.figure.Figure', 'Figure', ([], {'figsize': '(5, 5...
Kedyn/PingPong
text.py
47e39a9d30e1a3a7b828c5b5e85b0666d67b0d7b
import pygame.font import copy class Text: """Draws a text to the screen.""" def __init__(self, rect, size, color, screen, text): self.screen = screen self.rect = copy.deepcopy(rect) self.text = text self.color = color self.font = pygame.font.SysFont(None, size) ...
[((190, 209), 'copy.deepcopy', 'copy.deepcopy', (['rect'], {}), '(rect)\n', (203, 209), False, 'import copy\n')]
ey-advisory-technology-testing/selenium
py/test/selenium/webdriver/common/window_tests.py
7e342d3b8eb913a9626475a158c4bc6ae5d68315
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
[((3004, 3110), 'pytest.mark.xfail_safari', 'pytest.mark.xfail_safari', ([], {'raises': 'WebDriverException', 'reason': '"""Get Window Rect command not implemented"""'}), "(raises=WebDriverException, reason=\n 'Get Window Rect command not implemented')\n", (3028, 3110), False, 'import pytest\n'), ((3360, 3466), 'pyt...
mayuri-dhote/psydac
psydac/cad/geometry.py
01ddbe2d049a599684c45060912d01c2658160a3
# coding: utf-8 # # a Geometry class contains the list of patches and additional information about # the topology i.e. connectivity, boundaries # For the moment, it is used as a container, that can be loaded from a file # (hdf5) from itertools import product from collections import abc import numpy as np import string ...
[((11899, 11938), 'h5py.File', 'h5py.File', (['filename'], {'mode': '"""w"""'}), "(filename, mode='w', **kwargs)\n", (11908, 11938), False, 'import h5py\n'), ((12022, 12058), 'yaml.dump', 'yaml.dump', ([], {'data': 'yml', 'sort_keys': '(False)'}), '(data=yml, sort_keys=False)\n', (12031, 12058), False, 'import yaml\n')...
ok1zjf/AMNet
utils.py
51b163eec63d6d1e2e3dbc140d19afdc7b4273ee
__author__ = 'Jiri Fajtl' __email__ = 'ok1zjf@gmail.com' __version__= '2.2' __status__ = "Research" __date__ = "28/1/2018" __license__= "MIT License" import os import numpy as np import glob import subprocess import platform import sys import pkg_resources import torch import PIL as Image try: import cv2 except:...
[((491, 510), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (504, 510), False, 'import os\n'), ((1248, 1299), 'os.path.join', 'os.path.join', (['dataset_path', 'splits_path', 'split_name'], {}), '(dataset_path, splits_path, split_name)\n', (1260, 1299), False, 'import os\n'), ((1312, 1327), 'glob.glob',...
HDembinski/aghast
python/aghast/aghast_generated/Slice.py
f3d45a6960033f48fb8f6b7e906cb36b9d9d8e95
# automatically generated by the FlatBuffers compiler, do not modify # namespace: aghast_generated import flatbuffers class Slice(object): __slots__ = ["_tab"] # Slice def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) # Slice def Start(self): return self._...
[((231, 264), 'flatbuffers.table.Table', 'flatbuffers.table.Table', (['buf', 'pos'], {}), '(buf, pos)\n', (254, 264), False, 'import flatbuffers\n'), ((406, 455), 'flatbuffers.number_types.UOffsetTFlags.py_type', 'flatbuffers.number_types.UOffsetTFlags.py_type', (['(0)'], {}), '(0)\n', (452, 455), False, 'import flatbu...
AleksaLuka/Axelrod
axelrod/tests/strategies/test_mystrategy.py
5f2fefcb2bf8f371ef489382f90f116b46ac1023
import axelrod as axl from .test_player import TestPlayer C, D = axl.Action.C, axl.Action.D class TestMyStrategy(TestPlayer): name = "MyStrategy" player = axl.mystrategy expected_classifier = { "memory_depth": 1, "stochastic": False, "long_run_time": False, "inspects_sour...
[((563, 579), 'axelrod.Alternator', 'axl.Alternator', ([], {}), '()\n', (577, 579), True, 'import axelrod as axl\n'), ((714, 730), 'axelrod.Alternator', 'axl.Alternator', ([], {}), '()\n', (728, 730), True, 'import axelrod as axl\n'), ((865, 881), 'axelrod.Cooperator', 'axl.Cooperator', ([], {}), '()\n', (879, 881), Tr...
Gr1ph00n/staticwebanalyzer
analyzer/BannerTool.py
8bf6337a77192b85913d75778830ccbb9006081f
#FILE NAME: BannerTool.py #created by: Ciro Veneruso #purpose: banner localization #last edited by: Ciro Veneruso #INSTALL: BeautifulSoup #TODO: this code is a blob, must be refactorized!!!! import re import mechanize import socket import urllib from tools import BaseTool from bs4 import BeautifulSoup from pprint i...
[]
meetps/rhea
rhea/build/toolflow/xilinx/__init__.py
f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0
from .ise import ISE from .vivado import Vivado
[]
fredpan/Prosopagnosia_Web_Server
app/AccountManagment.py
b56b58eccdbbde6b158802d49f7bcc1b44b18b69
# Copyright 2020 EraO Prosopagnosia Helper Dev Team, Liren Pan, Yixiao Hong, Hongzheng Xu, Stephen Huang, Tiancong Wang # # Supervised by Prof. Steve Mann (http://www.eecg.toronto.edu/~mann/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with th...
[((1836, 1883), 'app.webapp.route', 'webapp.route', (['"""/login"""'], {'methods': "['GET', 'POST']"}), "('/login', methods=['GET', 'POST'])\n", (1848, 1883), False, 'from app import webapp\n'), ((2161, 2208), 'app.webapp.route', 'webapp.route', (['"""/login_submit"""'], {'methods': "['POST']"}), "('/login_submit', met...
priyablue/lidar_navigation
scripts/slice.py
39cd44a44043fa001c9d797ddea6c19e3376276c
import math from point2d import Point2D def to_point(rads, dist): x = math.cos(rads) * dist y = math.sin(rads) * dist return Point2D(x, y) class Slice(object): def __init__(self, begin, end): self.__begin = begin self.__end = end self.__begin_rad = math.radians(self.__begin...
[((140, 153), 'point2d.Point2D', 'Point2D', (['x', 'y'], {}), '(x, y)\n', (147, 153), False, 'from point2d import Point2D\n'), ((77, 91), 'math.cos', 'math.cos', (['rads'], {}), '(rads)\n', (85, 91), False, 'import math\n'), ((107, 121), 'math.sin', 'math.sin', (['rads'], {}), '(rads)\n', (115, 121), False, 'import mat...
WernerDreier/audio-korpora-pipeline
src/audio_korpora_pipeline/inputadapter/adapters.py
ac171cdfb0663c7b6250c06cc9c70a951b908251
import concurrent import os import re import shutil import xml.etree.ElementTree as ET # TODO do we have this as requirement? from concurrent.futures import as_completed from concurrent.futures._base import as_completed from pathlib import Path import ffmpeg import pandas as pd import webrtcvad from audio_korpora_pi...
[((1766, 1776), 'audio_korpora_pipeline.inputadapter.audiosplit.splitter.Splitter', 'Splitter', ([], {}), '()\n', (1774, 1776), False, 'from audio_korpora_pipeline.inputadapter.audiosplit.splitter import Splitter\n'), ((4142, 4206), 'audio_korpora_pipeline.metamodel.mediasession.MediaSession', 'MediaSession', (['self.A...
anaikawadi/svbrdf-estimation
development/multiImage_pytorch/experiment.py
c977aa8448b2131af3960895afd1105d29e5484a
import matplotlib.pyplot as plt import math import shutil import torch from accelerate import Accelerator from tensorboardX import SummaryWriter from cli import parse_args from dataset import SvbrdfDataset from losses import MixedLoss, MixedLoss2, MixedLoss3 from models import MultiViewModel, SingleViewModel from pathl...
[((675, 687), 'cli.parse_args', 'parse_args', ([], {}), '()\n', (685, 687), False, 'from cli import parse_args\n'), ((784, 804), 'pathlib.Path', 'Path', (['args.model_dir'], {}), '(args.model_dir)\n', (788, 804), False, 'from pathlib import Path\n'), ((818, 830), 'persistence.Checkpoint', 'Checkpoint', ([], {}), '()\n'...
amazon-research/long-short-term-transformer
src/rekognition_online_action_detection/engines/__init__.py
a425be4b52ab68fddd85c91d26571e4cdfe8379a
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 from .engines import do_train, do_inference from .lstr.lstr_trainer import * from .lstr.lstr_inference import *
[]
nuagenetworks/nuage-tempest-plugin
nuage_tempest_plugin/tests/api/test_nuage_ports.py
ac1bfb0709c7bbaf04017af3050fb3ed1ad1324a
# Copyright 2017 NOKIA # All Rights Reserved. from netaddr import IPNetwork import testtools from tempest.common import waiters from tempest.lib import exceptions from tempest.scenario import manager from tempest.test import decorators from nuage_tempest_plugin.lib.test.nuage_test import NuageAdminNetworksTest from ...
[((569, 588), 'nuage_tempest_plugin.lib.topology.Topology.get_conf', 'Topology.get_conf', ([], {}), '()\n', (586, 588), False, 'from nuage_tempest_plugin.lib.topology import Topology\n'), ((595, 624), 'nuage_tempest_plugin.lib.topology.Topology.get_logger', 'Topology.get_logger', (['__name__'], {}), '(__name__)\n', (61...
thanosa/coding-challenges
advent_of_code/2019/11_space_police/aoc_2019_11.py
a10b0de51da076a4bcc798b4a3d5a08e29c5af01
''' Advent of code 2019 Day 11 - Space police ''' from typing import NamedTuple from enum import Enum INPUT_FILE=__file__.replace('.py', '.dat') def to_number(digits: list) -> int: return int(''.join(map(str, digits))) def to_list(number: int) -> list: return [int(i) for i in str(number)] ...
[]
jkrueger1/nicos
nicos_mlz/mira/setups/mezeiflip.py
5f4ce66c312dedd78995f9d91e8a6e3c891b262b
description = 'Mezei spin flipper using TTI power supply' group = 'optional' tango_base = 'tango://miractrl.mira.frm2:10000/mira/' devices = dict( dct1 = device('nicos.devices.entangle.PowerSupply', description = 'current in first channel of supply (flipper current)', tangodevice = tango_base + 't...
[]
hxri/mars
mars/learn/cluster/_k_means_init.py
f7864f00911883b94800b63856f0e57648d3d9b4
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
[((14667, 14695), 'numpy.argmin', 'np.argmin', (['distances'], {'axis': '(1)'}), '(distances, axis=1)\n', (14676, 14695), True, 'import numpy as np\n'), ((15191, 15219), 'numpy.argmin', 'np.argmin', (['distances'], {'axis': '(1)'}), '(distances, axis=1)\n', (15200, 15219), True, 'import numpy as np\n'), ((15329, 15358)...
ojones/wikipedia_parser
wikipedia_parser/infobox/wikitext_parser.py
db548290fbc392299bba8adfda9fe18baa1e66fe
import re from wikipedia_parser.infobox import clean_text as clean_help from wikipedia_parser.infobox import wikitext_helpers as wtext_help from wikipedia_parser.third_party_adapters import parserfromhell_adapter as adapter __author__ = 'oswaldjones' def get_simple_text(wtext, key, clean=True): text = None ...
[((386, 414), 'wikipedia_parser.third_party_adapters.parserfromhell_adapter.template_dict', 'adapter.template_dict', (['wtext'], {}), '(wtext)\n', (407, 414), True, 'from wikipedia_parser.third_party_adapters import parserfromhell_adapter as adapter\n'), ((433, 466), 'wikipedia_parser.infobox.wikitext_helpers.get_wtext...
threefoldtech/threebot_prebuilt
sandbox/lib/jumpscale/JumpscaleLibs/clients/graphql/GraphQLFactory.py
1f0e1c65c14cef079cd80f73927d7c8318755c48
from .GraphQLClient import GraphQLClient from Jumpscale import j JSConfigs = j.baseclasses.object_config_collection class GraphQLFactory(JSConfigs): __jslocation__ = "j.clients.graphql" _CHILDCLASS = GraphQLClient
[]
tumb1er/django-video-transcoding
src/video_transcoding/defaults.py
54c85fb4a3b58b3f3b82e461b2f54f3c8dd5fcc6
from os import getenv as e from kombu import Queue CELERY_APP_NAME = 'video_transcoding' VIDEO_TRANSCODING_CELERY_CONF = { 'broker_url': e('VIDEO_TRANSCODING_CELERY_BROKER_URL', 'amqp://guest:guest@rabbitmq:5672/'), 'result_backend': e('VIDEO_TRANSCODING_CELERY_RESULT_BACKEND', None), ...
[((146, 223), 'os.getenv', 'e', (['"""VIDEO_TRANSCODING_CELERY_BROKER_URL"""', '"""amqp://guest:guest@rabbitmq:5672/"""'], {}), "('VIDEO_TRANSCODING_CELERY_BROKER_URL', 'amqp://guest:guest@rabbitmq:5672/')\n", (147, 223), True, 'from os import getenv as e\n'), ((267, 317), 'os.getenv', 'e', (['"""VIDEO_TRANSCODING_CELE...
jmboettcher/fall2019_sentiment_in_alternative_words
wordSenseByContext.py
d88fd0ed7d1396bb3755431d6aff85b880ffe149
from collections import defaultdict from nltk.tokenize import sent_tokenize from nltk.corpus import wordnet as wn from nltk.corpus import semcor as sc from nltk.corpus import stopwords import mywordtokenizer class SenseContextWordDict: def __init__(self): self.dictionary = self._create_dictionary() d...
[((430, 456), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (445, 456), False, 'from nltk.corpus import stopwords\n'), ((481, 507), 'nltk.corpus.semcor.tagged_sents', 'sc.tagged_sents', ([], {'tag': '"""sem"""'}), "(tag='sem')\n", (496, 507), True, 'from nltk.corpus import ...
tjwalch/django-restshop
paymentmethods/stripejs/tests.py
569b57a5694e76a365556d7c4c9a97dd293d96c6
import decimal from unittest import mock from django.conf import settings from django.test import modify_settings from rest_framework import test from rest_framework.reverse import reverse import stripe from restshop import serializers from restshop.models import Order from paymentmethods.stripejs.models import Strip...
[((418, 496), 'django.test.modify_settings', 'modify_settings', ([], {'INSTALLED_APPS': "{'append': 'restshop.paymentmethods.stripejs'}"}), "(INSTALLED_APPS={'append': 'restshop.paymentmethods.stripejs'})\n", (433, 496), False, 'from django.test import modify_settings\n'), ((2052, 2086), 'unittest.mock.patch', 'mock.pa...
tnnt-devteam/python-backend
tnnt/uniqdeaths.py
1ecb0ddaccf176726739b64212831d038a7463a0
from tnnt.settings import UNIQUE_DEATH_REJECTIONS, UNIQUE_DEATH_NORMALIZATIONS import re def normalize(death): # Given a death string, apply normalizations from settings. for regtuple in UNIQUE_DEATH_NORMALIZATIONS: death = re.sub(regtuple[0], regtuple[1], death) return death def reject(death): ...
[((241, 280), 're.sub', 're.sub', (['regtuple[0]', 'regtuple[1]', 'death'], {}), '(regtuple[0], regtuple[1], death)\n', (247, 280), False, 'import re\n'), ((478, 501), 're.search', 're.search', (['regex', 'death'], {}), '(regex, death)\n', (487, 501), False, 'import re\n')]
anubhavvardhan/qutip
qutip/graph.py
daf384840efbb44b86e39d8bda64d907d9f6b47f
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
[((2857, 2903), 'qutip.cy.graph_utils._node_degrees', '_node_degrees', (['A.indices', 'A.indptr', 'A.shape[0]'], {}), '(A.indices, A.indptr, A.shape[0])\n', (2870, 2903), False, 'from qutip.cy.graph_utils import _breadth_first_search, _node_degrees, _reverse_cuthill_mckee, _maximum_bipartite_matching, _weighted_biparti...
Pierre-Thibault/neo-insert-imports
test/source_dir/comments_blank_lines_code.py
c20399d5666b2c3590be7f40c8be1130343bbadc
# comments------------------ def a(x): print x if True: a(10)
[]
super-resolution/Locan
locan/data/hulls/__init__.py
94ed7759f7d7ceddee7c7feaabff80010cfedf30
""" Hull objects of localization data. Submodules: ----------- .. autosummary:: :toctree: ./ hull alpha_shape """ from locan.data.hulls.alpha_shape import * from locan.data.hulls.hull import * __all__ = [] __all__.extend(hull.__all__) __all__.extend(alpha_shape.__all__)
[]
tschoonj/cgat-daisy
tests/test_workflow_build_combinations.py
f85a2c82ca04f352aad00660cfc14a9aa6773168
import pytest from daisy.workflow import build_combinations def test_one_option(): assert build_combinations( {"option1": ["value1", "value2"]}) == \ [{'option1': 'value1'}, {'option1': 'value2'}] def test_two_options(): assert build_combinations( {'option1': ["value1", "val...
[((96, 149), 'daisy.workflow.build_combinations', 'build_combinations', (["{'option1': ['value1', 'value2']}"], {}), "({'option1': ['value1', 'value2']})\n", (114, 149), False, 'from daisy.workflow import build_combinations\n'), ((265, 339), 'daisy.workflow.build_combinations', 'build_combinations', (["{'option1': ['va...
katnoria/world-models
src/train_vae.py
6584f35fa9508c991050ddc9c17f5862a00008fe
# class Encoder: # pass # class Decoder: # pass # class VariationAutoEncoder: # pass import os os.environ['CUDA_VISIBLE_DEVICES'] = "0" import pickle import logging from glob import glob import numpy as np from time import time from datetime import datetime from PIL import Image import matplotlib.pyplot ...
[((566, 598), 'logging.getLogger', 'logging.getLogger', (['"""worldmodels"""'], {}), "('worldmodels')\n", (583, 598), False, 'import logging\n'), ((656, 688), 'logging.getLogger', 'logging.getLogger', (['"""worldmodels"""'], {}), "('worldmodels')\n", (673, 688), False, 'import logging\n'), ((701, 773), 'logging.Formatt...
harryzcy/canvas-file-syncer
login.py
16b98ee164df8570605b1a274c02f0dc7403730e
import time from config import get_password, get_username from playwright.sync_api import Page def login(page: Page, url: str, landing_url: str): raise RuntimeError("default login not supported") def login_kenan_flagler(page: Page, url: str, landing_url: str) -> None: page.goto(url) page.wait_for_load_...
[((480, 495), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (490, 495), False, 'import time\n'), ((646, 659), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (656, 659), False, 'import time\n'), ((1291, 1306), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1301, 1306), False, 'import time\n'), (...
xa4a/multitidal
multitidal/client_lib.py
26f757f12464e8f935c0389c6356b97cfaa9f03f
import asyncio import json import os import pty import shutil import sys import tty import termios import time import threading import tornado.iostream from tornado.ioloop import IOLoop from tornado.websocket import websocket_connect ioloop = tornado.ioloop.IOLoop.instance() SSH_LOGIN = "root" SSH_PASSWORD = "algor...
[((2501, 2518), 'threading.Event', 'threading.Event', ([], {}), '()\n', (2516, 2518), False, 'import threading\n'), ((2823, 2836), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (2833, 2836), False, 'import time\n'), ((2847, 2910), 'pty.spawn', 'pty.spawn', (['args'], {'master_read': 'master_read', 'stdin_read': '...
olds/ha_gehome
custom_components/ge_home/entities/common/ge_water_heater.py
5cb24deab64bcade45861da0497a84631845922c
import abc import logging from typing import Any, Dict, List, Optional from homeassistant.components.water_heater import WaterHeaterEntity from homeassistant.const import ( TEMP_FAHRENHEIT, TEMP_CELSIUS ) from gehomesdk import ErdCode, ErdMeasurementUnits from ...const import DOMAIN from .ge_erd_entity import ...
[((340, 367), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (357, 367), False, 'import logging\n')]
zyuchuan/scrapy
scrapy/contracts/default.py
ce24f53957b41877319a5ffc6cf26f0a18baaec2
import json from scrapy.item import BaseItem from scrapy.http import Request from scrapy.exceptions import ContractFail from scrapy.contracts import Contract # contracts class UrlContract(Contract): """ Contract to set the url of the request (mandatory) @url http://scrapy.org """ name = 'url' ...
[((2209, 2297), 'scrapy.exceptions.ContractFail', 'ContractFail', (["('Returned %s %s, expected %s' % (occurrences, self.obj_name, expected))"], {}), "('Returned %s %s, expected %s' % (occurrences, self.obj_name,\n expected))\n", (2221, 2297), False, 'from scrapy.exceptions import ContractFail\n')]
pabloduque0/cnn_deconv_viz
networks/metrics.py
3fc3d8a9dbad8e8e28d4df4023bdb438e4c9cf85
from keras import backend as K import tensorflow as tf import numpy as np def custom_dice_coefficient(y_true, y_pred, recall_weight=0.3): recall_weight = tf.Variable(recall_weight, dtype=tf.float32) regular_dice = dice_coefficient(y_true, y_pred) recall = lession_recall(y_true, y_pred) recall = tf.cas...
[((160, 204), 'tensorflow.Variable', 'tf.Variable', (['recall_weight'], {'dtype': 'tf.float32'}), '(recall_weight, dtype=tf.float32)\n', (171, 204), True, 'import tensorflow as tf\n'), ((314, 347), 'tensorflow.cast', 'tf.cast', (['recall'], {'dtype': 'tf.float32'}), '(recall, dtype=tf.float32)\n', (321, 347), True, 'im...
kk0501/spider
scrapy_template/scrapy_template/pipelines.py
404540a76922885f9dd12f9a513f5ec88b0d2072
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html from scrapy.exceptions import DropItem from hashlib import md5 from scrapy import log from twisted.enterprise import adbapi fro...
[((834, 876), 'twisted.enterprise.adbapi.ConnectionPool', 'adbapi.ConnectionPool', (['"""MySQLdb"""'], {}), "('MySQLdb', **dbargs)\n", (855, 876), False, 'from twisted.enterprise import adbapi\n'), ((2103, 2119), 'scrapy.log.err', 'log.err', (['failure'], {}), '(failure)\n', (2110, 2119), False, 'from scrapy import log...
willferreira/multilabel-stance-detection
run_training_size_bootstrap.py
ddc0ed9caa26b63f40e89a377f1738e83fcb7724
import click import pickle import numpy as np from collections import defaultdict from utils import reset_seeds, get_dataset, load_embeddings from mlp_multilabel_wrapper import PowersetKerasWrapper, MultiOutputKerasWrapper from mlp_utils import CrossLabelDependencyLoss def get_random_sample(dataset_name='bbc', train_...
[((912, 927), 'click.command', 'click.command', ([], {}), '()\n', (925, 927), False, 'import click\n'), ((929, 968), 'click.option', 'click.option', (['"""--n-samples"""'], {'default': '(10)'}), "('--n-samples', default=10)\n", (941, 968), False, 'import click\n'), ((970, 1031), 'click.option', 'click.option', (['"""--...
Shuailong/CCGSupertagging
code/evaluate.py
891a6a477a4a05daeb847d4a4c33a1bc929d97b2
#!/usr/bin/env python # encoding: utf-8 """ evaluate.py Created by Shuailong on 2016-12-2. Evaluate model accuracy on test set. """ from __future__ import print_function from time import time from keras.models import load_model import os from utils import true_accuracy from dataset import get_data from train imp...
[((410, 416), 'time.time', 'time', ([], {}), '()\n', (414, 416), False, 'from time import time\n'), ((459, 480), 'dataset.get_data', 'get_data', ([], {'force': '(False)'}), '(force=False)\n', (467, 480), False, 'from dataset import get_data\n'), ((672, 707), 'os.path.join', 'os.path.join', (['MODEL_DIR', 'MODEL_FILE'],...
Cloudlock/bravado
setup.py
bacf49ea9d791ec9f564a3a141c77995d2f395b0
#!/usr/bin/env python # Copyright (c) 2013, Digium, Inc. # Copyright (c) 2014-2016, Yelp, Inc. import os from setuptools import setup import bravado setup( name="bravado", # cloudlock version, no twisted dependency version=bravado.version + "cl", license="BSD 3-Clause License", description="Lib...
[((402, 427), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (417, 427), False, 'import os\n')]
devdattakulkarni/test-solum
solum/api/controllers/v1/assembly.py
4e9ddb82d217116aa2c30a6f2581080cbdfae325
# Copyright 2013 - Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
[((1201, 1215), 'pecan.expose', 'pecan.expose', ([], {}), '()\n', (1213, 1215), False, 'import pecan\n'), ((1541, 1579), 'wsmeext.pecan.wsexpose', 'wsme_pecan.wsexpose', (['assembly.Assembly'], {}), '(assembly.Assembly)\n', (1560, 1579), True, 'import wsmeext.pecan as wsme_pecan\n'), ((1972, 2034), 'wsmeext.pecan.wsexp...
mjain2/ottertune
server/website/website/migrations/0003_background_task_optimization.py
011e896bf89df831fb1189b1ab4c9a7d7dca420a
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2018-08-02 07:58 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('website', '0002_enable_compression'), ] operations...
[((434, 548), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'choices': "[(1, 'MODIFIED'), (2, 'PROCESSING'), (3, 'PROCESSED')]", 'default': '(1)', 'editable': '(False)'}), "(choices=[(1, 'MODIFIED'), (2, 'PROCESSING'), (3,\n 'PROCESSED')], default=1, editable=False)\n", (453, 548), False, 'from djang...
bobbyluig/6.A01
src/agility/usc/settings.py
16dd8963951eca4a1312a15c216d0cc3c117d063
from agility.usc.enumeration import uscSerialMode, ChannelMode, HomeMode from agility.usc.reader import BytecodeReader class UscSettings: def __init__(self): self.servosAvailable = 6 self.servoPeriod = 156 self.miniMaestroServoPeriod = 80000 self.servoMultiplier = 1 self.se...
[((932, 948), 'agility.usc.reader.BytecodeReader', 'BytecodeReader', ([], {}), '()\n', (946, 948), False, 'from agility.usc.reader import BytecodeReader\n')]
jtom38/invmon-api
invmonInfra/domain/__init__.py
28f163bef47ee5c95bac0f40198e25e44090758f
from .dbApiInterface import DbApiTableInterface from .dbApiTableInterface import DbApiTableInterface from .cacheInterface import CacheInterface from .loggerInterface import LoggerInterface from .envReaderInterface import EnvReaderInterface from .driverInterface import DriverInterface from .jobsInterface import JobsInte...
[]
ameenetemady/DeepPep
app/app8_18mix/h_noSeqSearch.py
121826309667f1290fa1121746a2992943d0927b
import sys import csv import os sys.path.append('../../') import h_lib import h_lib_noSeqSearch in_strFastaFilename = '{!s}/data/protein/18mix/18mix_db_plus_contaminants_20081209.fasta'.format(os.environ.get('HOME')) in_strPeptideFilename = '{!s}/data/protein/18mix/18_mixtures_peptide_identification.txt'.format(os.en...
[((33, 58), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (48, 58), False, 'import sys\n'), ((447, 499), 'h_lib.getPeptides', 'h_lib.getPeptides', (['in_strPeptideFilename', '"""\t"""', '(0)', '(2)'], {}), "(in_strPeptideFilename, '\\t', 0, 2)\n", (464, 499), False, 'import h_lib\n'), ((...
ashokn414/python_floating_conversions
normalizer.py
7a132c703272e6651daf555816171f04ee5b5555
# for normalization we need to have the maxima of x and y values with the help of which # we can normalise the given values import csv filename = "values.csv" fields = [] rows = [] with open(filename,'r') as csvfile: reader = csv.reader(csvfile) fields = next(reader) for row in reader: ...
[((238, 257), 'csv.reader', 'csv.reader', (['csvfile'], {}), '(csvfile)\n', (248, 257), False, 'import csv\n')]
jiwalker-usgs/pyGDP
pygdp/fwgs.py
dca4789fb0c53c889d6fa1b38ec867bc939a2d04
from pygdp import _execute_request from pygdp import _get_geotype from owslib.util import log def submitFeatureWeightedGridStatistics(geoType, dataSetURI, varID, startTime, endTime, attribute, value, gmlIDs, verbose, coverage, delim, stat, grpby, timeStep, summAttr, weighted, WF...
[((744, 784), 'pygdp._execute_request.dodsReplace', '_execute_request.dodsReplace', (['dataSetURI'], {}), '(dataSetURI)\n', (772, 784), False, 'from pygdp import _execute_request\n'), ((794, 836), 'owslib.util.log.info', 'log.info', (['"""Generating feature collection."""'], {}), "('Generating feature collection.')\n",...
rbanffy/bjoern
tests/pure-req.py
b177b62aa626cee97972a2e73f8543e6d86b5eb7
import sys import socket conn = socket.create_connection(('0.0.0.0', 8080)) msgs = [ # 0 Keep-Alive, Transfer-Encoding chunked 'GET / HTTP/1.1\r\nConnection: Keep-Alive\r\n\r\n', # 1,2,3 Close, EOF "encoding" 'GET / HTTP/1.1\r\n\r\n', 'GET / HTTP/1.1\r\nConnection: close\r\n\r\n', 'GET / HTTP/...
[((33, 76), 'socket.create_connection', 'socket.create_connection', (["('0.0.0.0', 8080)"], {}), "(('0.0.0.0', 8080))\n", (57, 76), False, 'import socket\n')]
gtfarng/Odoo_migrade
apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/stock/models/web_planner.py
9cc28fae4c379e407645248a29d22139925eafe7
# -*- coding: utf-8 -*- from odoo import models class PlannerInventory(models.Model): _inherit = 'web.planner' def _get_planner_application(self): planner = super(PlannerInventory, self)._get_planner_application() planner.append(['planner_inventory', 'Inventory Planner']) return plan...
[]
Wizard-Of-Chaos/WizardBot
wizbot.py
75a2e482c7d7921e9a06dde4d210c68330c6fbe2
#WIZARD BOT IS LIVE import calendar import discord as dc from discord.ext.commands import Bot from discord.ext import commands from functools import partial import asyncio as aio import time from random import randint from datetime import datetime from discord.ext import commands from guildconfig import GuildConfig f...
[((397, 429), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""!"""'}), "(command_prefix='!')\n", (409, 429), False, 'from discord.ext import commands\n'), ((474, 504), 'guildconfig.GuildConfig', 'GuildConfig', (['bot', '"""config.pkl"""'], {}), "(bot, 'config.pkl')\n", (485, 504), False, 'from g...
henryoliver/data-structures
stack.py
eb3d709543ace5197236164998b8295e72187cb0
class Stack: def __init__(self): self.stack = [] self.minMaxStack = [] # O(1) time | O(1) space def peek(self): if (len(self.stack)): return self.stack[-1] return None # O(1) time | O(1) space def pop(self): if (len(self.stack)): sel...
[]
javiergarridomellado/proyectodai
ProyectoDAI/settings.py
64944d10f543c3094630056906b5f101a73bdd7b
""" Django settings for TusPachangas project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import django import dj_database_url # Build paths inside the project li...
[((438, 473), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""templates"""'], {}), "(BASE_DIR, 'templates')\n", (450, 473), False, 'import os\n'), ((2074, 2096), 'os.environ.get', 'os.environ.get', (['"""PORT"""'], {}), "('PORT')\n", (2088, 2096), False, 'import os\n'), ((2600, 2632), 'os.path.join', 'os.path.join', ...
JustinACoder/H22-GR3-UnrealAI
Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/tensorflow/python/eager/test.py
361eb9ef1147f8a2991e5f98c4118cd823184adf
# Copyright 2017 The TensorFlow 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...
[((1118, 1147), 'tensorflow.python.framework.ops.enable_eager_execution', '_ops.enable_eager_execution', ([], {}), '()\n', (1145, 1147), True, 'from tensorflow.python.framework import ops as _ops\n'), ((1151, 1167), 'tensorflow.python.platform.test.main', '_test.main', (['argv'], {}), '(argv)\n', (1161, 1167), True, 'f...
monokim/CheesyBullets
util.py
eeb5a79a69936701ff7962b846e6310f7df91cb0
import time import pyautogui import win32gui def get_screen_rect(caption='CheesyBullets'): hwnd = win32gui.FindWindow(None, caption) rect = win32gui.GetWindowRect(hwnd) screen_rect = (rect[0], rect[1], rect[2] - rect[0], rect[3] - rect[1]) return rect class Timer(): def __init__(self): sel...
[((103, 137), 'win32gui.FindWindow', 'win32gui.FindWindow', (['None', 'caption'], {}), '(None, caption)\n', (122, 137), False, 'import win32gui\n'), ((149, 177), 'win32gui.GetWindowRect', 'win32gui.GetWindowRect', (['hwnd'], {}), '(hwnd)\n', (171, 177), False, 'import win32gui\n'), ((538, 549), 'time.time', 'time.time'...
mbrcknl/graph-refine
graph-to-graph/elf_correlate.py
78c74f18127db53606f18f775a5a50de86bc6b97
# # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) # # SPDX-License-Identifier: BSD-2-Clause # import re import graph_refine.syntax as syntax import graph_refine.problem as problem import graph_refine.stack_logic as stack_logic from graph_refine.syntax import true_term, false_term, mk_not from graph_refine.check i...
[]
Etherbay/Gelatin
Gelatin/parser/Parser.py
d2afa85a48034d6ee34580e49e16542f31ad208e
# Copyright (c) 2010-2017 Samuel Abels # # 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, d...
[((1285, 1310), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1300, 1310), False, 'import os\n'), ((1650, 1712), 'simpleparse.parser.Parser.__init__', 'parser.Parser.__init__', (['self', '_ebnf', '"""root"""'], {'prebuilts': 'offside'}), "(self, _ebnf, 'root', prebuilts=offside)\n", (1672, ...
dirchev/Python-101-Forever-1
C03-Unit-Testing/21-C03V15/utils.py
13c3bb182747aae244ae6f9fd6f79c8223f3e9a6
BIG_CONSTANT = "YES" def group_by(xs, grouper): groups = {} for x in xs: group = grouper(x) if group not in groups: groups[group] = [] groups[group].append(x) return groups print(group_by([1, 2, 3, 4, 5, 6], lambda x: "even" if x % 2 == 0 else "odd"))
[]
streamsets/datacollector-tests-external
pipeline/test_sftp_to_s3.py
6f255b5e7496deeef333b57a5e9df4911ba3ef00
# Copyright 2019 StreamSets Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
[((865, 892), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (882, 892), False, 'import logging\n'), ((991, 1015), 'streamsets.testframework.markers.sdc_min_version', 'sdc_min_version', (['"""3.8.2"""'], {}), "('3.8.2')\n", (1006, 1015), False, 'from streamsets.testframework.markers impor...
NoahRJohnson/terra
terra/tests/__init__.py
131954ee42fb5905ceff35101e34d89c5eb6de6c
import os # Use this as a package level setup def load_tests(loader, standard_tests, pattern): if os.environ.get('TERRA_UNITTEST', None) != "1": print('WARNING: Running terra tests without setting TERRA_UNITTEST will ' 'result in side effects such as extraneouse log files being ' 'generated'...
[((336, 361), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (351, 361), False, 'import os\n'), ((102, 140), 'os.environ.get', 'os.environ.get', (['"""TERRA_UNITTEST"""', 'None'], {}), "('TERRA_UNITTEST', None)\n", (116, 140), False, 'import os\n')]
benburrill/formiko
icons/svg2png.py
86630506c537f9517666d9b0d5b2a905e7385b01
# -*- coding: utf-8 -*- from gi.repository.GdkPixbuf import Pixbuf from os import makedirs def main(): for size in (16, 22, 24, 32, 48, 64, 128, 256, 512): icon = Pixbuf.new_from_file_at_scale("formiko.svg", size, size, True) makedirs("%dx%d" % (size, size)) icon.savev("%dx%d/formiko.png"...
[((178, 240), 'gi.repository.GdkPixbuf.Pixbuf.new_from_file_at_scale', 'Pixbuf.new_from_file_at_scale', (['"""formiko.svg"""', 'size', 'size', '(True)'], {}), "('formiko.svg', size, size, True)\n", (207, 240), False, 'from gi.repository.GdkPixbuf import Pixbuf\n'), ((249, 281), 'os.makedirs', 'makedirs', (["('%dx%d' % ...
AngelOnFira/megagame-controller
django/currencies/migrations/0003_auto_20211121_0701.py
033fec84babf80ffd0868a0f7d946ac4c18b061c
# Generated by Django 3.2.8 on 2021-11-21 12:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("currencies", "0002_initial"), ] operations = [ migrations.AddField( model_name="payment", name="completed", ...
[((330, 364), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (349, 364), False, 'from django.db import migrations, models\n'), ((496, 526), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (515, 526), False, 'f...
tinkoff-ai/etna-ts
etna/transforms/decomposition/trend.py
ded5161ed49f5c2697778825f899842ee30c6c61
from typing import Optional import pandas as pd from ruptures import Binseg from ruptures.base import BaseCost from sklearn.linear_model import LinearRegression from etna.transforms.base import PerSegmentWrapper from etna.transforms.decomposition.change_points_trend import BaseEstimator from etna.transforms.decomposi...
[((3774, 3792), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (3790, 3792), False, 'from sklearn.linear_model import LinearRegression\n'), ((5504, 5603), 'ruptures.Binseg', 'Binseg', ([], {'model': 'self.model', 'custom_cost': 'self.custom_cost', 'min_size': 'self.min_size', 'jump': 'se...
schwehr/argopy
argopy/tests/test_fetchers_facade_index.py
1b35d5cfb87b2f9ccd2ca45b9987a614edd30700
import xarray as xr import pytest import warnings import argopy from argopy import IndexFetcher as ArgoIndexFetcher from argopy.errors import InvalidFetcherAccessPoint, InvalidFetcher, ErddapServerError, DataNotFound from . import ( AVAILABLE_INDEX_SOURCES, requires_fetcher_index, requires_connected_erddap...
[((2985, 3076), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Waiting for https://github.com/euroargodev/argopy/issues/16"""'}), "(reason=\n 'Waiting for https://github.com/euroargodev/argopy/issues/16')\n", (3001, 3076), False, 'import pytest\n'), ((3625, 3716), 'pytest.mark.skip', 'pytest.mark.skip',...
jatty/hass-acthor
custom_components/acthor/config_flow.py
9d5aaed3f01e9288fef031b47b0808e6e80c22d3
import voluptuous as vol from homeassistant.config_entries import ConfigFlow from homeassistant.const import CONF_HOST, CONF_NAME from .acthor import test_connection from .const import DEVICE_NAME, DOMAIN class ACThorConfigFlow(ConfigFlow, domain=DOMAIN): async def async_step_user(self, user_input: dict = None) ...
[((818, 862), 'voluptuous.Required', 'vol.Required', (['CONF_NAME'], {'default': 'DEVICE_NAME'}), '(CONF_NAME, default=DEVICE_NAME)\n', (830, 862), True, 'import voluptuous as vol\n'), ((885, 908), 'voluptuous.Required', 'vol.Required', (['CONF_HOST'], {}), '(CONF_HOST)\n', (897, 908), True, 'import voluptuous as vol\n...
glauberm/doaj
doajtest/fixtures/common.py
dc24dfcbf4a9f02ce5c9b09b611a5766ea5742f7
NOTES = { 'notes': [ {'date': '2014-05-22T00:00:00Z', 'note': 'Second Note'}, {'date': '2014-05-21T14:02:45Z', 'note': 'First Note'} ] } SUBJECT = { "subject": ['HB1-3840', 'H'] } OWNER = { "owner": "Owner" } EDITORIAL = { "editor_group": "editorgroup", "editor": "associate" }...
[]
HEInventions/docnado
docnado/docnado.py
8817d8a9856b4babd9a2f81678a9ef0b8a75d4bc
""" docnado.py A rapid documentation tool that will blow you away. """ import os import re import sys import csv import glob import time import signal import shutil import urllib import base64 import hashlib import argparse import tempfile import datetime import threading import traceback import subprocess import pl...
[((12509, 12752), 're.compile', 're.compile', (['"""^(p|div|h[1-6]|blockquote|pre|dl|ol|ul|script|noscript|form|fieldset|math|hr|hr/|style|li|dt|dd|thead|tbody|tr|th|td|section|footer|header|group|figure|figcaption|article|canvas|output|progress|nav|main)$"""', 're.IGNORECASE'], {}), "(\n '^(p|div|h[1-6]|blockquote|...
Luis-Felipe-N/curso-em-video-python
modulo-3/aulas/modulos e pacotes/uteis.py
09ff58ae31ae0360ebec74de609011d527956065
def fatorial(n): f = 1 while n != 0: f *= n n -= 1 return f def dobro(n): n *= 2 return n def triplo(n): n *= 3 return n
[]
MaximBrewer/sebe
server/src/oscarbluelight/tests/offer/test_benefit_percentage.py
4b94b2c782d018b6fa3a130fa30173386cc9bfdd
from decimal import Decimal as D from django.core import exceptions from django.test import TestCase from oscar.test import factories from oscar.test.basket import add_product, add_products from django_redis import get_redis_connection from oscarbluelight.offer.models import ( Range, Benefit, BluelightCount...
[((558, 587), 'django_redis.get_redis_connection', 'get_redis_connection', (['"""redis"""'], {}), "('redis')\n", (578, 587), False, 'from django_redis import get_redis_connection\n'), ((629, 698), 'oscarbluelight.offer.models.Range.objects.create', 'Range.objects.create', ([], {'name': '"""All products"""', 'includes_a...
adstr123/LPTHW
CLCC/ex8.py
1a331ef173ffd6122b5c5ed13d8fdcc73ab7ce66
# Moving around directories with pushd & popd # You can save directries to go back to later. These can be built up in a stack. #pushd i/like/icecream # current stack: ~temp/i/like/icecream #pushd i/like # current stack: ~temp/i/like ~temp/i/like/icecream #popd # PS ~temp/i/like #popd # PS ~temp/i/like/icecre...
[]
clouserw/zamboni
mkt/search/tests/test_filters.py
c4a568b69c1613f27da41d46328b2975cbdc1c07
# -*- coding: utf-8 -*- import json from nose.tools import eq_, ok_ from rest_framework.exceptions import ParseError from django.contrib.auth.models import AnonymousUser from django.test.client import RequestFactory from django.test.utils import override_settings import mkt from mkt.constants.applications import DEV...
[((2859, 2897), 'django.test.utils.override_settings', 'override_settings', ([], {'ES_USE_PLUGINS': '(True)'}), '(ES_USE_PLUGINS=True)\n', (2876, 2897), False, 'from django.test.utils import override_settings\n'), ((1003, 1018), 'django.contrib.auth.models.AnonymousUser', 'AnonymousUser', ([], {}), '()\n', (1016, 1018)...
sweeneyb/iot-core-micropython
third_party/logging.py
7fc341902fbf8fa587f0dc3aa10c0803a5e0d6a5
# MIT License # # Copyright (c) 2019 Johan Brichau # # 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, mer...
[((2455, 2486), 'sys.print_exception', 'sys.print_exception', (['e', '_stream'], {}), '(e, _stream)\n', (2474, 2486), False, 'import sys\n'), ((2542, 2556), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (2554, 2556), False, 'import sys\n')]
acounsel/django_msat
assessments/migrations/0003_auto_20210212_1943.py
86a54e43429001cb6433e28b294d6b8a94b97e6e
# Generated by Django 3.1.6 on 2021-02-12 19:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('assessments', '0002_auto_20210212_1904'), ] operations = [ migrations.AlterField( model_name='country', name='region...
[((341, 525), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'choices': "[('america', 'Americas'), ('europe', 'Europe'), ('africa', 'Africa'), (\n 'asia', 'Asia'), ('oceania', 'Oceania')]", 'max_length': '(100)', 'null': '(True)'}), "(blank=True, choices=[('america', 'Americas'), ('europe...
sethmlarson/workplace-search-python
noxfile.py
0680ce7144fc0608d3d8c336315ffaf7ddc3ca2d
import nox SOURCE_FILES = ( "setup.py", "noxfile.py", "elastic_workplace_search/", "tests/", ) @nox.session(python=["2.7", "3.4", "3.5", "3.6", "3.7", "3.8"]) def test(session): session.install(".") session.install("-r", "dev-requirements.txt") session.run("pytest", "--record-mode=none"...
[((116, 178), 'nox.session', 'nox.session', ([], {'python': "['2.7', '3.4', '3.5', '3.6', '3.7', '3.8']"}), "(python=['2.7', '3.4', '3.5', '3.6', '3.7', '3.8'])\n", (127, 178), False, 'import nox\n'), ((335, 348), 'nox.session', 'nox.session', ([], {}), '()\n', (346, 348), False, 'import nox\n'), ((462, 475), 'nox.sess...
osheraz/komodo
komodo2_rl/src/environments/Spawner.py
d53759100ced7439dd501620f955f347087e4f63
# !/usr/bin/env python import rospy import numpy as np from gazebo_msgs.srv import SpawnModel, SpawnModelRequest, SpawnModelResponse from copy import deepcopy from tf.transformations import quaternion_from_euler sdf_cube = """<?xml version="1.0" ?> <sdf version="1.4"> <model name="MODELNAME"> <static>0</static...
[((14597, 14616), 'copy.deepcopy', 'deepcopy', (['sdf_sand2'], {}), '(sdf_sand2)\n', (14605, 14616), False, 'from copy import deepcopy\n'), ((14908, 14927), 'gazebo_msgs.srv.SpawnModelRequest', 'SpawnModelRequest', ([], {}), '()\n', (14925, 14927), False, 'from gazebo_msgs.srv import SpawnModel, SpawnModelRequest, Spaw...
tefra/xsdata-w3c-tests
output/models/ms_data/regex/re_l32_xsd/__init__.py
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
from output.models.ms_data.regex.re_l32_xsd.re_l32 import ( Regex, Doc, ) __all__ = [ "Regex", "Doc", ]
[]
ConverJens/pipelines
sdk/python/tests/dsl/metadata_tests.py
a1d453af214ec9eebad73fb05845dd3499d60d00
# Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[((898, 1042), 'kfp.components.structures.InputSpec', 'InputSpec', ([], {'name': '"""input1"""', 'description': '"""input1 desc"""', 'type': "{'GCSPath': {'bucket_type': 'directory', 'file_type': 'csv'}}", 'default': '"""default1"""'}), "(name='input1', description='input1 desc', type={'GCSPath': {\n 'bucket_type': ...
elifloresch/thirty-days-challenge
challenges/python-solutions/day-25.py
d3d41f5ce8cc4155ebf9cf52c1ece43c15a1e2af
import math def is_prime_number(number): if number < 2: return False if number == 2 or number == 3: return True if number % 2 == 0 or number % 3 == 0: return False number_sqrt = math.sqrt(number) int_number_sqrt = int(number_sqrt) + 1 for d in range(6, int_number_sq...
[((223, 240), 'math.sqrt', 'math.sqrt', (['number'], {}), '(number)\n', (232, 240), False, 'import math\n')]
rnixx/garden.cefpython
examples/path_config.py
91d5f69e9983a28ce1971637d7d2f0051c456882
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Minimal example of the CEFBrowser widget use. Here you don't have any controls (back / forth / reload) or whatsoever. Just a kivy app displaying the chromium-webview. In this example we demonstrate how the cache path of CEF can be set. """ import os from kivy.app im...
[((833, 888), 'kivy.logger.Logger.info', 'Logger.info', (['"""Example: The CEF pathes have been set to"""'], {}), "('Example: The CEF pathes have been set to')\n", (844, 888), False, 'from kivy.logger import Logger\n'), ((901, 951), 'kivy.logger.Logger.info', 'Logger.info', (['"""- Cache %s"""', 'CEFBrowser._caches_pat...
laserbat/random-projects
simple-systems/and_xor_shift.py
925f94f80299df6f16e91975e89f5fff7df20005
#!/usr/bin/python3 # If F(a) is any function that can be defined as composition of bitwise XORs, ANDs and left shifts # Then the dynac system x_(n+1) = F(x_n) is Turing complete # Proof by simulation (rule110) a = 1 while a: print(bin(a)) a = a ^ (a << 1) ^ (a & (a << 1)) ^ (a & (a << 1) & (a << 2))
[]
Gauddel/trinity
trinity/protocol/common/peer_pool_event_bus.py
0b12943ac36f4090abc22fc965e9e9a4f42c6f35
from abc import ( abstractmethod, ) from typing import ( Any, Callable, cast, FrozenSet, Generic, Type, TypeVar, ) from cancel_token import ( CancelToken, ) from p2p.exceptions import ( PeerConnectionLost, ) from p2p.kademlia import Node from p2p.peer import ( BasePeer, ...
[((705, 737), 'typing.TypeVar', 'TypeVar', (['"""TPeer"""'], {'bound': 'BasePeer'}), "('TPeer', bound=BasePeer)\n", (712, 737), False, 'from typing import Any, Callable, cast, FrozenSet, Generic, Type, TypeVar\n'), ((753, 798), 'typing.TypeVar', 'TypeVar', (['"""TStreamEvent"""'], {'bound': 'HasRemoteEvent'}), "('TStre...
annagitel/ocs-ci
tests/e2e/performance/csi_tests/test_pvc_creation_deletion_performance.py
284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5
""" Test to verify performance of PVC creation and deletion for RBD, CephFS and RBD-Thick interfaces """ import time import logging import datetime import pytest import ocs_ci.ocs.exceptions as ex import threading import statistics from concurrent.futures import ThreadPoolExecutor from uuid import uuid4 from ocs_ci.fr...
[((629, 656), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (646, 656), False, 'import logging\n'), ((2792, 2808), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (2806, 2808), False, 'import pytest\n'), ((3602, 3618), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (3616, 36...
MikeBirdsall/food-log
templates/t/searchresult_withnone.py
5edc1fa515d5e2721e96afb7d2b437296903a31d
#!/usr/bin/python3 from jinja2 import Environment, FileSystemLoader def spacenone(value): return "" if value is None else str(value) results = [ dict( description="Noodles and Company steak Stromboli", comment="", size="small", cals=530, carbs=50, fat=25, ...
[((1072, 1094), 'jinja2.FileSystemLoader', 'FileSystemLoader', (['""".."""'], {}), "('..')\n", (1088, 1094), False, 'from jinja2 import Environment, FileSystemLoader\n')]
aman-roy/pune.pycon.org
payments/views.py
f56cc948bd56767110d337c694ecbf5540bdf4b9
from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from payments.models import Invoice, RazorpayKeys from payments.razorpay.razorpay_payments import RazorpayPayments from payments.models import Payment, Order import json @csrf_exempt def webhook(request): if request.method ...
[((1090, 1137), 'django.http.JsonResponse', 'JsonResponse', (["{'message': 'Method Not Allowed'}"], {}), "({'message': 'Method Not Allowed'})\n", (1102, 1137), False, 'from django.http import JsonResponse\n'), ((1170, 1198), 'payments.models.RazorpayKeys.objects.first', 'RazorpayKeys.objects.first', ([], {}), '()\n', (...
danschef/gear-detector
src/convnet/image_classifier.py
153d1031778f183ac38edf0532d2f266029c5ea7
import configparser import os import sys from time import localtime, strftime, mktime import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from net import Net from geo_helper import store_image_bounds from image_helper import CLASSES from image_helper import save_image f...
[((459, 486), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (484, 486), False, 'import configparser\n'), ((1035, 1056), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (1054, 1056), True, 'import torch.nn as nn\n'), ((5163, 5191), 'net.Net', 'Net', ([], {'in_channels'...
aaanh/duplicated_accelcamp
src/modules/AlphabetPlotter.py
7d4b60ace023bede907f8ed367ba492731a1951d
import tkinter as tk from tkinter import filedialog import csv import matplotlib.pyplot as plt root = tk.Tk(screenName=':0.0') root.withdraw() file_path = filedialog.askopenfilename() lastIndex = len(file_path.split('/')) - 1 v0 = [0, 0, 0] x0 = [0, 0, 0] fToA = 1 error = 0.28 errorZ = 3 t = [] time...
[((108, 132), 'tkinter.Tk', 'tk.Tk', ([], {'screenName': '""":0.0"""'}), "(screenName=':0.0')\n", (113, 132), True, 'import tkinter as tk\n'), ((165, 193), 'tkinter.filedialog.askopenfilename', 'filedialog.askopenfilename', ([], {}), '()\n', (191, 193), False, 'from tkinter import filedialog\n'), ((2223, 2238), 'matplo...
mitodl/mit-xpro
users/migrations/0008_profile_fields_optional.py
981d6c87d963837f0b9ccdd996067fe81394dba4
# Generated by Django 2.2.3 on 2019-07-15 19:24 from django.db import migrations, models def backpopulate_incomplete_profiles(apps, schema): """Backpopulate users who don't have a profile record""" User = apps.get_model("users", "User") Profile = apps.get_model("users", "Profile") for user in User.o...
[((2522, 2622), 'django.db.migrations.RunPython', 'migrations.RunPython', (['backpopulate_incomplete_profiles'], {'reverse_code': 'remove_incomplete_profiles'}), '(backpopulate_incomplete_profiles, reverse_code=\n remove_incomplete_profiles)\n', (2542, 2622), False, 'from django.db import migrations, models\n'), ((1...
nwukie/ChiDG
test/unit_testing/grid/element_linear_dx_data/test_element_linearC/element/geom_element_AD.py
d096548ba3bd0a338a29f522fb00a669f0e33e9b
from __future__ import division import torch import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np import sys import os import time # # TORCH INSTALLATION: refer to https://pytorch.org/get-started/locally/ # def update_progress(job_t...
[((1336, 1402), 'torch.tensor', 'torch.tensor', (['coords_data'], {'requires_grad': '(True)', 'dtype': 'torch.float64'}), '(coords_data, requires_grad=True, dtype=torch.float64)\n', (1348, 1402), False, 'import torch\n'), ((2061, 2127), 'torch.tensor', 'torch.tensor', (['val_r_data'], {'requires_grad': '(False)', 'dtyp...
brian-thomas/osr_stat_generator
osr_stat_generator/generator.py
89f6a71e17c274befa3af7222a24c34a77f1f40e
""" OSR (LOTFP) stat generator. """ import random def d(num_sides): """ Represents rolling a die of size 'num_sides'. Returns random number from that size die """ return random.randint(1, num_sides) def xdy(num_dice, num_sides): """ represents rolling num_dice of size num_sides. Re...
[((198, 226), 'random.randint', 'random.randint', (['(1)', 'num_sides'], {}), '(1, num_sides)\n', (212, 226), False, 'import random\n')]
nick6655/management-sdk-python
cohesity_management_sdk/models/health_tile.py
88e792cb83e5c24a22af495b220c145d0c45841d
# -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. import cohesity_management_sdk.models.alert class HealthTile(object): """Implementation of the 'HealthTile' model. Health for Dashboard. Attributes: capacity_bytes (long|int): Raw Cluster Capacity in Bytes. This is not usable ca...
[]
nihanjali/PageRank
TextRank/textrank.py
baea9d89fb962fd1311a61127123bf36d9d2dd38
import os import sys import copy import collections import nltk import nltk.tokenize sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) import pagerank ''' textrank.py ----------- This module implements TextRank, an unsupervised keyword significance scoring algorithm. TextRank builds a...
[]
lionelkusch/neurolib
tests/test_exploration.py
714eef48616af0ebdb62decc84826221472398f9
import logging import os import random import string import time import unittest import neurolib.utils.paths as paths import neurolib.utils.pypetUtils as pu import numpy as np import pytest import xarray as xr from neurolib.models.aln import ALNModel from neurolib.models.fhn import FHNModel from neurolib.models.multim...
[((10456, 10471), 'unittest.main', 'unittest.main', ([], {}), '()\n', (10469, 10471), False, 'import unittest\n'), ((1635, 1679), 'neurolib.utils.parameterSpace.ParameterSpace', 'ParameterSpace', (["{'mue_ext_mean': [1.0, 2.0]}"], {}), "({'mue_ext_mean': [1.0, 2.0]})\n", (1649, 1679), False, 'from neurolib.utils.parame...
belst/irc3
irc3/tags.py
c89303cf5937a4dc7cf1eda8e662dc702b5e0ad9
# -*- coding: utf-8 -*- ''' Module offering 2 functions, encode() and decode(), to transcode between IRCv3.2 tags and python dictionaries. ''' import re import random import string _escapes = ( ("\\", "\\\\"), (";", r"\:"), (" ", r"\s"), ("\r", r"\r"), ("\n", r"\n"), ) # make the possibility of...
[((785, 820), 're.compile', 're.compile', (['"""^([\\\\w.-]+/)?[\\\\w-]+$"""'], {}), "('^([\\\\w.-]+/)?[\\\\w-]+$')\n", (795, 820), False, 'import re\n'), ((923, 953), 're.compile', 're.compile', (["'^[^ ;\\n\\r\\x00]*$'"], {}), "('^[^ ;\\n\\r\\x00]*$')\n", (933, 953), False, 'import re\n'), ((1022, 1042), 'string.repl...
Rahmatullina/FinalYearProject
app/forms.py
326f521b9f600dbbc7ace2223bd5aafc79b2267c
from django import forms from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm # from .models import RegionModel # from .models import SERVICE_CHOICES, REGION_CHOICES from django.contrib.auth import authenticate # from django.contrib.auth.forms import UserCreationForm, UserChangeForm # from .models i...
[((736, 786), 'django.contrib.auth.authenticate', 'authenticate', ([], {'username': 'username', 'password': 'password'}), '(username=username, password=password)\n', (748, 786), False, 'from django.contrib.auth import authenticate\n'), ((1127, 1177), 'django.contrib.auth.authenticate', 'authenticate', ([], {'username':...
MrZhang1994/mobile-federated-learning
src/fedavg_trainer.py
6e088a91266d889869af5a1eb0bad83ca635a4a5
# newly added libraries import copy import wandb import time import math import csv import shutil from tqdm import tqdm import torch import numpy as np import pandas as pd from client import Client from config import * import scheduler as sch class FedAvgTrainer(object): def __init__(self, dataset, model, device...
[((4042, 4076), 'numpy.zeros', 'np.zeros', (['(1, client_num_in_total)'], {}), '((1, client_num_in_total))\n', (4050, 4076), True, 'import numpy as np\n'), ((23990, 24031), 'math.ceil', 'math.ceil', (['(TIME_COMPRESSION_RATIO * tmp_t)'], {}), '(TIME_COMPRESSION_RATIO * tmp_t)\n', (23999, 24031), False, 'import math\n')...
jfparentledartech/DEFT
src/test.py
6e7e98664cd635509bdff69533a24a7c4e4e3ea3
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import cv2 import matplotlib.pyplot as plt import numpy as np from progress.bar import Bar import torch import pickle import motmetrics as mm from lib.opts import opts from lib.logger im...
[((1524, 1547), 'numpy.zeros', 'np.zeros', (['(8)', 'np.float32'], {}), '(8, np.float32)\n', (1532, 1547), True, 'import numpy as np\n'), ((709, 728), 'pickle.dump', 'pickle.dump', (['opt', 'f'], {}), '(opt, f)\n', (720, 728), False, 'import pickle\n'), ((3314, 3325), 'time.time', 'time.time', ([], {}), '()\n', (3323, ...
AkillesAILimited/CompilerGym
compiler_gym/envs/gcc/datasets/csmith.py
34c0933ba26b385ebd2cd67f5d8edbb046c6bf02
# 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 logging import shutil import subprocess import tempfile from pathlib import Path from threading import Lock from typing import Iterable,...
[((884, 950), 'compiler_gym.util.runfiles_path.runfiles_path', 'runfiles_path', (['"""compiler_gym/third_party/csmith/csmith/bin/csmith"""'], {}), "('compiler_gym/third_party/csmith/csmith/bin/csmith')\n", (897, 950), False, 'from compiler_gym.util.runfiles_path import runfiles_path\n'), ((970, 1046), 'compiler_gym.uti...
DanielWinklehner/dans_pymodules
dans_pymodules/power_of_two.py
04dfdaeccc171712cad6eb24202608e2eda21eca
__author__ = "Daniel Winklehner" __doc__ = "Find out if a number is a power of two" def power_of_two(number): """ Function that checks if the input value (data) is a power of 2 (i.e. 2, 4, 8, 16, 32, ...) """ res = 0 while res == 0: res = number % 2 number /= 2.0 prin...
[]
rmorshea/viewdom
examples/index/context.py
24c528642e9ef0179999936b2e6f3b8a9d770df8
from viewdom import html, render, use_context, Context expected = '<h1>My Todos</h1><ul><li>Item: first</li></ul>' # start-after title = 'My Todos' todos = ['first'] def Todo(label): prefix = use_context('prefix') return html('<li>{prefix}{label}</li>') def TodoList(todos): return html('<ul>{[Todo(lab...
[((200, 221), 'viewdom.use_context', 'use_context', (['"""prefix"""'], {}), "('prefix')\n", (211, 221), False, 'from viewdom import html, render, use_context, Context\n'), ((233, 265), 'viewdom.html', 'html', (['"""<li>{prefix}{label}</li>"""'], {}), "('<li>{prefix}{label}</li>')\n", (237, 265), False, 'from viewdom im...