repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 840k |
|---|---|---|---|---|
zsolt-beringer/osm-gimmisn | tests/test_webframe.py | b0cbf2e88c1846ef49e33fd32aeb6b4ecabea4c0 | #!/usr/bin/env python3
#
# Copyright (c) 2019 Miklos Vajna and contributors.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""The test_webframe module covers the webframe module."""
from typing import List
from typing import TYPE_CHECKING
from typing import Tupl... | [((114, 4, 114, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((34, 32, 34, 77), 'webframe.handle_static', 'webframe.handle_static', ({(34, 55, 34, 76): '"""/osm/static/osm.css"""'}, {}), "('/osm/static/osm.css')", False, 'import webframe\n'), ((40, 32, 40, 82), 'webframe.handle_st... |
nimatest1234/telegram_spotify_downloader_bot | spotify.py | 7e0a9ba32ee219752582b917867600653337f3d1 | from __future__ import unicode_literals
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import requests
from youtube_search import YoutubeSearch
import youtube_dl
import eyed3.id3
import eyed3
import lyricsgenius
import telepot
spotifyy = spotipy.Spotify(
client_credentials_manager=SpotifyClient... | [((15, 9, 15, 96), 'lyricsgenius.Genius', 'lyricsgenius.Genius', ({(15, 29, 15, 95): '"""biZZReO7F98mji5oz3cE0FiIG73Hh07qoXSIzYSGNN3GBsnY-eUrPAVSdJk_0_de"""'}, {}), "(\n 'biZZReO7F98mji5oz3cE0FiIG73Hh07qoXSIzYSGNN3GBsnY-eUrPAVSdJk_0_de')", False, 'import lyricsgenius\n'), ((19, 6, 19, 24), 'telepot.Bot', 'telepot.Bo... |
Tillsten/atom | tests/test_atomdict.py | 19b6291f7d3c9b3828dcd73e900b8dcbc2ddf92d | #------------------------------------------------------------------------------
# Copyright (c) 2018-2019, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------... | [((41, 1, 41, 43), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(41, 25, 41, 33): '"""member"""', (41, 35, 41, 42): 'MEMBERS'}, {}), "('member', MEMBERS)", False, 'import pytest\n'), ((49, 1, 49, 43), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(49, 25, 49, 33): '"""member"""', (49, 35, 49, 42): ... |
eggveloper/dippy.core | dippy/core/timestamp.py | 8ad613a50bcbf52132de1ece889e22fa4aba3a44 | from datetime import datetime
class Timestamp(float):
def __new__(cls, value=None):
return super().__new__(
cls, datetime.utcnow().timestamp() if value is None else value
)
def to_date(self) -> datetime:
return datetime.utcfromtimestamp(self)
def __repr__(self):
... | [((11, 15, 11, 46), 'datetime.datetime.utcfromtimestamp', 'datetime.utcfromtimestamp', ({(11, 41, 11, 45): 'self'}, {}), '(self)', False, 'from datetime import datetime\n'), ((7, 17, 7, 34), 'datetime.datetime.utcnow', 'datetime.utcnow', ({}, {}), '()', False, 'from datetime import datetime\n')] |
tushortz/biblelover | bible/admin.py | 8ef4980d7f68e4037874373fb0ecde12d2d63d76 | from django.contrib import admin
from bible.models import Bible, VerseOfTheDay
@admin.register(Bible)
class BibleAdmin(admin.ModelAdmin):
list_display = ['__str__', 'text']
readonly_fields = ['book', 'chapter', 'verse', 'text', 'category']
search_fields = ['text', 'book', 'chapter']
list_filter = ['ca... | [((5, 1, 5, 22), 'django.contrib.admin.register', 'admin.register', ({(5, 16, 5, 21): 'Bible'}, {}), '(Bible)', False, 'from django.contrib import admin\n'), ((22, 1, 22, 30), 'django.contrib.admin.register', 'admin.register', ({(22, 16, 22, 29): 'VerseOfTheDay'}, {}), '(VerseOfTheDay)', False, 'from django.contrib imp... |
Procrat/typy | typy/nodes.py | 668cedb7f929256a09f565af9ee43c02889bec3f | """
Our own implementation of an abstract syntax tree (AST).
The convert function recursively converts a Python AST (from the module `ast`)
to our own AST (of the class `Node`).
"""
import ast
from logging import debug
from typy.builtin import data_types
from typy.exceptions import NotYetSupported, NoSuchAttribute, ... | [((23, 14, 23, 52), 'typy.exceptions.NotYetSupported', 'NotYetSupported', ({(23, 30, 23, 45): '"""check call to"""', (23, 47, 23, 51): 'self'}, {}), "('check call to', self)", False, 'from typy.exceptions import NotYetSupported, NoSuchAttribute, NotIterable\n'), ((58, 8, 58, 48), 'logging.debug', 'debug', ({(58, 14, 58... |
Sam-Gresh/linkage-agent-tools | anonlink-entity-service/backend/entityservice/integrationtests/objectstoretests/test_objectstore.py | f405c7efe3fa82d99bc047f130c0fac6f3f5bf82 | """
Testing:
- uploading over existing files
- using deleted credentials
- using expired credentials
"""
import io
import minio
from minio import Minio
import pytest
from minio.credentials import AssumeRoleProvider, Credentials
from entityservice.object_store import connect_to_object_store, connect_to_upload_obje... | [((43, 25, 43, 50), 'entityservice.object_store.connect_to_object_store', 'connect_to_object_store', ({}, {}), '()', False, 'from entityservice.object_store import connect_to_object_store, connect_to_upload_object_store\n'), ((44, 41, 44, 73), 'entityservice.object_store.connect_to_upload_object_store', 'connect_to_upl... |
JackDan9/soil | soil/build/lib/soil/db/sqlalchemy/api.py | ae612a4634634aace834491fbdefbc69e6167674 | # Copyright 2020 Soil, Inc.
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); yo... | [((38, 6, 38, 33), 'oslo_log.log.getLogger', 'logging.getLogger', ({(38, 24, 38, 32): '__name__'}, {}), '(__name__)', True, 'from oslo_log import log as logging\n'), ((41, 8, 41, 24), 'threading.Lock', 'threading.Lock', ({}, {}), '()', False, 'import threading\n')] |
kykrueger/redash | tests/test_models.py | 5fd78fdb2324a7c194e8a99c13deb5a57268866c | import calendar
import datetime
from unittest import TestCase
import pytz
from dateutil.parser import parse as date_parse
from tests import BaseTestCase
from redash import models, redis_connection
from redash.models import db, types
from redash.utils import gen_query_hash, utcnow
class DashboardTest(BaseTestCase):
... | [((495, 4, 495, 22), 'redash.models.db.session.flush', 'db.session.flush', ({}, {}), '()', False, 'from redash.models import db, types\n'), ((17, 8, 17, 26), 'redash.models.db.session.flush', 'db.session.flush', ({}, {}), '()', False, 'from redash.models import db, types\n'), ((21, 8, 21, 26), 'redash.models.db.session... |
EvanthiosPapadopoulos/Python3 | .history/List of Capstone Projects/FibonacciSequence_20200516134123.py | ab773fd458e365c1510f98ecac65965234c881e8 | '''
Fibonacci Sequence
'''
import HeaderOfFiles
def fibonacciSeq(number):
'''
Generate Fibonacci Sequence to the given number.
'''
a = 1
b = 1
for i in range(number):
yield a
a,b = b,a+b
while True:
try:
f = int(input("Enter a number for Fibonacci: "... | [] |
jacobfulano/composer | composer/algorithms/mixup/__init__.py | 4ad81df2d2ca6e5f0b4922bb2db750cd76ba34e8 | # Copyright 2021 MosaicML. All Rights Reserved.
from composer.algorithms.mixup.mixup import MixUp as MixUp
from composer.algorithms.mixup.mixup import MixUpHparams as MixUpHparams
from composer.algorithms.mixup.mixup import mixup_batch as mixup_batch
_name = 'MixUp'
_class_name = 'MixUp'
_functional = 'mixup_batch'
_... | [] |
alanpeixinho/NiftyNet | tests/simple_gan_test.py | 9a17022a71985974f9e5ca992c765d55860fdd7d | from __future__ import absolute_import, print_function
import unittest
import os
import tensorflow as tf
from tensorflow.keras import regularizers
from niftynet.network.simple_gan import SimpleGAN
from tests.niftynet_testcase import NiftyNetTestCase
class SimpleGANTest(NiftyNetTestCase):
def test_3d_reg_shape(s... | [((48, 4, 48, 18), 'tensorflow.test.main', 'tf.test.main', ({}, {}), '()', True, 'import tensorflow as tf\n'), ((16, 12, 16, 32), 'tensorflow.ones', 'tf.ones', ({(16, 20, 16, 31): 'input_shape'}, {}), '(input_shape)', True, 'import tensorflow as tf\n'), ((17, 12, 17, 32), 'tensorflow.ones', 'tf.ones', ({(17, 20, 17, 31... |
N4S4/thingspeak_wrapper | tests/test.py | f5c26e52c09124b85cc6056782d766d145e65a31 | import time
import thingspeak_wrapper as tsw
# Initiate the class ThingWrapper with (CHANNEL_ID, WRITE_API__KEY, READ_API_KEY)
# if is a public channel just pass the CHANNEL_ID argument, api_key defaults are None
my_channel = tsw.wrapper.ThingWrapper(501309, '6TQDNWJQ44FA0GAQ', '10EVD2N6YIHI5O7Z')
# all set of func... | [((7, 13, 7, 85), 'thingspeak_wrapper.wrapper.ThingWrapper', 'tsw.wrapper.ThingWrapper', ({(7, 38, 7, 44): '501309', (7, 46, 7, 64): '"""6TQDNWJQ44FA0GAQ"""', (7, 66, 7, 84): '"""10EVD2N6YIHI5O7Z"""'}, {}), "(501309, '6TQDNWJQ44FA0GAQ', '10EVD2N6YIHI5O7Z')", True, 'import thingspeak_wrapper as tsw\n'), ((26, 0, 26, 14)... |
neptune-ai/neptune-contrib | neptunecontrib/monitoring/skopt.py | fe5c6853128020aaaa59b440cc5203b940dcd39a | #
# Copyright (c) 2019, Neptune Labs Sp. z o.o.
#
# 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 agr... | [((120, 4, 120, 26), 'neptunecontrib.monitoring.utils.expect_not_a_run', 'expect_not_a_run', ({(120, 21, 120, 25): '_exp'}, {}), '(_exp)', False, 'from neptunecontrib.monitoring.utils import axes2fig, expect_not_a_run\n'), ((138, 4, 138, 26), 'warnings.warn', 'warnings.warn', ({(138, 18, 138, 25): 'message'}, {}), '(me... |
aiddenkeli/Snoopy | snoopy/server/transforms/Maltego.py | dd76180145981b3574b419edce39dbb060bd8c8c | #!/usr/bin/python
#
# This might be horrible code...
# ...but it works
# Feel free to re-write in a better way
# And if you want to - send it to us, we'll update ;)
# maltego@paterva.com (2010/10/18)
#
import sys
from xml.dom import minidom
class MaltegoEntity(object):
value = "";
weight = 100;
displayInformation ... | [] |
sfdc-qbranch/MetaDeploy | metadeploy/api/migrations/0050_add_clickthrough_agreement.py | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | # Generated by Django 2.1.5 on 2019-02-12 21:18
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("api", "0049_add_all_other_translations")]
operations = [
migrations.CreateModel(
name="ClickThroughAgreement... | [((30, 18, 34, 13), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import migrations, models\n'), ((17, 20, 22, 21), 'django.db.models.AutoField', 'models.AutoField', (), '', False, 'from django.db import migrations, models\n'), ((24, 25, 24, 43), 'django.db.models.TextField', 'model... |
dfdan/invenio-iiif | invenio_iiif/config.py | 2ea2747fd29ab03b1d38e0ca6d2a9c1506aa8cbc | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""IIIF API for Invenio."""
IIIF_API_PREFIX = '/iiif/'
"""URL prefix to IIIF API."""
III... | [] |
mconlon17/vivo-pub-ingest | pub_ingest.py | 7c03ecdd6dc5418121a6b92de1572d1cc63f5cb5 | #!/user/bin/env/python
"""
pub_ingest.py -- Read a bibtex file and make VIVO RDF
The following objects will be made as needed:
-- publisher
-- journal
-- information resource
-- timestamp for the information resource
-- people
-- authorships
-- concepts
The result... | [] |
u-blox/ubxlib | port/platform/common/automation/u_utils.py | 4dc1b16e6f12354b601cb1c9d799c10f4e2afb54 | #!/usr/bin/env python
'''Generally useful bits and bobs.'''
import queue # For PrintThread and exe_run
from time import sleep, time, gmtime, strftime # For lock timeout, exe_run timeout and logging
from multiprocessing import RLock
from copy import copy
import threading # For Print... | [((203, 4, 203, 33), 'os.chmod', 'os.chmod', ({(203, 13, 203, 17): 'path', (203, 19, 203, 32): 'stat.S_IWRITE'}, {}), '(path, stat.S_IWRITE)', False, 'import os\n'), ((211, 7, 211, 31), 'os.path.isdir', 'os.path.isdir', ({(211, 21, 211, 30): 'directory'}, {}), '(directory)', False, 'import os\n'), ((410, 7, 410, 31), '... |
tcjansen/beer | faigler_mazeh.py | c6421371b6506cef1adf88cefa9a55db2f04e2dc | import numpy as np
import astropy.modeling.blackbody as bb
import astropy.constants as const
from astropy.io import fits
from scipy.interpolate import interp2d
class FaiglerMazehFit():
def __init__(self, P_orb, inc, R_star, M_star, T_star, A_ellip=False, A_beam=False,
R_p=False, a=False, u=False, g=0.65, logg=... | [((266, 21, 266, 89), 'numpy.genfromtxt', 'np.genfromtxt', (), '', True, 'import numpy as np\n'), ((213, 40, 215, 26), 'numpy.genfromtxt', 'np.genfromtxt', (), '', True, 'import numpy as np\n'), ((216, 8, 216, 70), 'numpy.genfromtxt', 'np.genfromtxt', (), '', True, 'import numpy as np\n'), ((245, 22, 245, 86), 'numpy.g... |
f2010126/LTH_Master | src/vanilla_pytorch/prune_model.py | 709472e7e7962fbf3a56a620c536fb03d359734f | import torch.nn.utils.prune as prune
import torch
from src.vanilla_pytorch.utils import count_rem_weights
from src.vanilla_pytorch.models.linearnets import LeNet, init_weights
from src.vanilla_pytorch.models.resnets import Resnets
def remove_pruning(model):
for i, (name, module) in enumerate(model.named_modules()... | [((70, 10, 70, 32), 'src.vanilla_pytorch.models.resnets.Resnets', 'Resnets', (), '', False, 'from src.vanilla_pytorch.models.resnets import Resnets\n'), ((12, 12, 12, 42), 'torch.nn.utils.prune.remove', 'prune.remove', ({(12, 25, 12, 31): 'module', (12, 33, 12, 41): '"""weight"""'}, {}), "(module, 'weight')", True, 'im... |
CitrusAqua/mol-infer | Grid-neighbor-search/GNS/read_instance_2layer_2LMM_L.py | 6d5411a2cdc7feda418f9413153b1b66b45a2e96 | """
read_instance_BH-cyclic.py
"""
'''
[seed graph]
V_C : "V_C"
E_C : "E_C"
[core specification]
ell_LB : "\ell_{\rm LB}"
ell_UB : "\ell_{\rm UB}"
cs_LB : "\textsc{cs}_{\rm LB}"
cs_UB : "\textsc{cs}_{\rm UB}"
'''
import sys
def read_pmax_file(filename):
with ope... | [((82, 12, 82, 65), 'sys.stderr.write', 'sys.stderr.write', ({(82, 29, 82, 64): '"""error: a strange edge is found.\n"""'}, {}), "('error: a strange edge is found.\\n')", False, 'import sys\n'), ((83, 12, 83, 23), 'sys.exit', 'sys.exit', ({(83, 21, 83, 22): '(1)'}, {}), '(1)', False, 'import sys\n')] |
ArtBIT/gamma | gamma/system_input.py | 4ec03251fcd46cd7ae7b5123ad101064b0f9bdd1 | from .system import *
from .colours import *
class InputSystem(System):
def init(self):
self.key = 'input'
def setRequirements(self):
self.requiredComponents = ['input']
def updateEntity(self, entity, scene):
# don't allow input during a cutscene
if scene.cutscene is... | [] |
mcognetta/federated | tensorflow_federated/python/research/utils/checkpoint_utils_test.py | fa0c1a00b5d77768bc2f38f503f3ef1a65693945 | # Lint as: python3
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | [((28, 1, 28, 32), 'attr.s', 'attr.s', (), '', False, 'import attr\n'), ((38, 10, 38, 19), 'attr.ib', 'attr.ib', ({}, {}), '()', False, 'import attr\n'), ((39, 20, 39, 29), 'attr.ib', 'attr.ib', ({}, {}), '()', False, 'import attr\n'), ((40, 14, 40, 23), 'attr.ib', 'attr.ib', ({}, {}), '()', False, 'import attr\n'), ((... |
alexli0707/pyforum | website/models/user.py | 4f5ea4a0b07e094e24410ae699016590b9c20d59 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import peewee
from flask import current_app,abort
from flask.ext.login import AnonymousUserMixin, UserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from peewee import Model, IntegerField, CharField,PrimaryKeyField
from website.app import db_wr... | [((15, 9, 15, 26), 'peewee.PrimaryKeyField', 'PrimaryKeyField', ({}, {}), '()', False, 'from peewee import Model, IntegerField, CharField, PrimaryKeyField\n'), ((16, 12, 16, 33), 'peewee.CharField', 'CharField', (), '', False, 'from peewee import Model, IntegerField, CharField, PrimaryKeyField\n'), ((17, 15, 17, 36), '... |
robertavram/project5 | FlaskApp/__init__.py | 12a2816b84be994b561f2f693cf34c0fa4f0ca19 | # application
import application | [] |
harikuts/dsr_optimization | sim2net/speed/constant.py | 796e58da578f7841a060233a8981eb69d92b798b | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2012 Michal Kalewski <mkalewski at cs.put.poznan.pl>
#
# This file is a part of the Simple Network Simulator (sim2net) project.
# USE, MODIFICATION, COPYING AND DISTRIBUTION OF THIS SOFTWARE IS SUBJECT TO
# THE TERMS AND CONDITIONS OF THE MIT LICENSE. YOU SHOULD H... | [((60, 8, 61, 40), 'sim2net.utility.validation.check_argument_type', 'check_argument_type', ({(60, 28, 60, 45): 'Constant.__name__', (60, 47, 60, 54): '"""speed"""', (60, 56, 60, 61): 'float', (60, 63, 60, 68): 'speed', (61, 28, 61, 39): 'self.logger'}, {}), "(Constant.__name__, 'speed', float, speed, self.logger)", Fa... |
haryoa/nexula | nexula/nexula_utility/utility_extract_func.py | cc3b5a9b8dd8294bdc47150a1971cb49c4dde225 | from nexula.nexula_utility.utility_import_var import import_class
class NexusFunctionModuleExtractor():
"""
Used for constructing pipeline data preporcessing and feature representer
"""
def __init__(self, module_class_list, args_dict, **kwargs):
"""
Instantiate class(es) object in pip... | [((34, 17, 34, 44), 'logging.getLogger', 'logging.getLogger', ({(34, 35, 34, 43): '"""nexula"""'}, {}), "('nexula')", False, 'import logging\n'), ((56, 31, 56, 61), 'nexula.nexula_utility.utility_import_var.import_class', 'import_class', ({(56, 44, 56, 52): 'function', (56, 54, 56, 60): 'module'}, {}), '(function, modu... |
MJ-Jang/Marbas | marbas/preprocessing.py | 0a144e4f2ae868604ed4d3b7ae892a53fdebf388 | import os
from configparser import ConfigParser
cfg = ConfigParser()
#PATH_CUR = os.getcwd() + '/pynori'
PATH_CUR = os.path.dirname(__file__)
cfg.read(PATH_CUR+'/config.ini')
# PREPROCESSING
ENG_LOWER = cfg.getboolean('PREPROCESSING', 'ENG_LOWER')
class Preprocessing(object):
"""Preprocessing modules before tokeniz... | [((4, 6, 4, 20), 'configparser.ConfigParser', 'ConfigParser', ({}, {}), '()', False, 'from configparser import ConfigParser\n'), ((6, 11, 6, 36), 'os.path.dirname', 'os.path.dirname', ({(6, 27, 6, 35): '__file__'}, {}), '(__file__)', False, 'import os\n')] |
amvasudeva/rapidata | pravash/servicenowplugin/xlr-servicenow-plugin-master/src/main/resources/servicenow/ServiceNowQueryTile.py | 7b6e984d24866f5cf474847cf462ac628427cf48 | #
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#
import com.xhaus.jyson.JysonCodec... | [] |
Buckinghamshire-Digital-Service/buckinghamshire-council | bc/recruitment/migrations/0022_merge_20200331_1633.py | bbbdb52b515bcdfc79a2bd9198dfa4828405370e | # Generated by Django 2.2.10 on 2020-03-31 15:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("recruitment", "0021_merge_20200331_1503"),
("recruitment", "0013_button_block"),
]
operations = []
| [] |
Pyabecedarian/Algorithms-and-Data-Structures-using-Python | Stage_3/Task11_Graph/depth_first_search.py | 08642357df60d48cb185b5487150204b42764260 | """
The Depth First Search (DFS)
The goal of a dfs is to search as deeply as possible, connecting as many nodes in the graph as possible and
branching where necessary. Think of the BFS that builds a search tree one level at a time, whereas the DFS
creates a search tree by exploring one branch of the tree a... | [] |
rbtcollins/rusty_rail | salt/_modules/freebsd_common.py | 6ab8a95247b42a81add03500a75ce6678ede5d58 | def sysrc(value):
"""Call sysrc.
CLI Example:
.. code-block:: bash
salt '*' freebsd_common.sysrc sshd_enable=YES
salt '*' freebsd_common.sysrc static_routes
"""
return __salt__['cmd.run_all']("sysrc %s" % value)
| [] |
jhunken/auth0-python | auth0/v3/management/blacklists.py | af5d863ffe75a4a7cd729c9d084cad6b37bd632e | from .rest import RestClient
class Blacklists(object):
"""Auth0 blacklists endpoints
Args:
domain (str): Your Auth0 domain, e.g: 'username.auth0.com'
token (str): Management API v2 Token
telemetry (bool, optional): Enable or disable Telemetry
(defaults to True)
"""
... | [] |
qzm/QUANTAXIS | test_backtest/simplebacktest.py | 055fdc16d67670fb4770e7097865336199e55f3e | # coding=utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 th... | [((31, 4, 31, 26), 'QUANTAXIS.QA_BacktestBroker', 'QA.QA_BacktestBroker', ({}, {}), '()', True, 'import QUANTAXIS as QA\n'), ((32, 5, 32, 20), 'QUANTAXIS.QA_Account', 'QA.QA_Account', ({}, {}), '()', True, 'import QUANTAXIS as QA\n'), ((75, 7, 75, 21), 'QUANTAXIS.QA_Risk', 'QA.QA_Risk', ({(75, 18, 75, 20): 'AC'}, {}), ... |
jjhelmus/artview | artview/components/field.py | 2af5ccad8d509d11ef6da7c97bee0f7b255b6879 | """
field.py
Class instance used for modifying field via Display window.
"""
# Load the needed packages
from functools import partial
from ..core import Variable, Component, QtGui, QtCore
class FieldButtonWindow(Component):
'''Class to display a Window with Field name radio buttons.'''
Vradar = None #: s... | [((93, 35, 93, 70), 'functools.partial', 'partial', ({(93, 43, 93, 62): 'self.FieldSelectCmd', (93, 64, 93, 69): 'field'}, {}), '(self.FieldSelectCmd, field)', False, 'from functools import partial\n')] |
Careerleaf/django-rest-framework-mongoengine | rest_framework_mongoengine/fields.py | fc28dbf7af760528f6f7247e567328df46458799 | from bson.errors import InvalidId
from django.core.exceptions import ValidationError
from django.utils.encoding import smart_str
from mongoengine import dereference
from mongoengine.base.document import BaseDocument
from mongoengine.document import Document
from rest_framework import serializers
from mongoengine.fields... | [((89, 18, 89, 38), 'django.core.exceptions.ValidationError', 'ValidationError', ({(89, 34, 89, 37): 'msg'}, {}), '(msg)', False, 'from django.core.exceptions import ValidationError\n'), ((34, 33, 34, 49), 'django.utils.encoding.smart_str', 'smart_str', ({(34, 43, 34, 48): 'field'}, {}), '(field)', False, 'from django.... |
bbhunter/fuzz-lightyear | tests/conftest.py | 75c1318d2f747a4fac6b55a46649c944528769ba | import pytest
from fuzz_lightyear.datastore import _ALL_POST_FUZZ_HOOKS_BY_OPERATION
from fuzz_lightyear.datastore import _ALL_POST_FUZZ_HOOKS_BY_TAG
from fuzz_lightyear.datastore import _RERUN_POST_FUZZ_HOOKS_BY_OPERATION
from fuzz_lightyear.datastore import _RERUN_POST_FUZZ_HOOKS_BY_TAG
from fuzz_lightyear.datastore... | [((16, 1, 16, 29), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((32, 1, 32, 29), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((18, 4, 18, 33), 'fuzz_lightyear.supplements.abstraction.get_abstraction.cache_clear', 'get_abstraction.cache_clear', ({}, {}), '()', False,... |
michael-the1/diepvries | src/diepvries/field.py | ddba9c91ee5fb2014dc576ffb74faa40c3d0d04f | """Module for a Data Vault field."""
from typing import Optional
from . import (
FIELD_PREFIX,
FIELD_SUFFIX,
METADATA_FIELDS,
TABLE_PREFIXES,
UNKNOWN,
FieldDataType,
FieldRole,
TableType,
)
class Field:
"""A field in a Data Vault model."""
def __init__(
self,
... | [] |
tuggeluk/mmdetection | mmdet/datasets/deepscoresV2.py | 669a535c944628a3ab43330cae5c77b643e13a4b | """DEEPSCORESV2
Provides access to the DEEPSCORESV2 database with a COCO-like interface. The
only changes made compared to the coco.py file are the class labels.
Author:
Lukas Tuggener <tugg@zhaw.ch>
Yvan Satyawan <y_satyawan@hotmail.com>
Created on:
November 23, 2019
"""
from .coco import *
import os
im... | [((23, 19, 23, 36), 'obb_anns.OBBAnns', 'OBBAnns', ({(23, 27, 23, 35): 'ann_file'}, {}), '(ann_file)', False, 'from obb_anns import OBBAnns\n'), ((98, 12, 98, 39), 'json.dump', 'json.dump', ({(98, 22, 98, 34): 'json_results', (98, 36, 98, 38): 'fo'}, {}), '(json_results, fo)', False, 'import json\n')] |
agsmorodin/gomatic | tests/go_cd_configurator_test.py | e6ae871ffc2d027823f6b7a5755e0ac65c724538 | #!/usr/bin/env python
import unittest
from xml.dom.minidom import parseString
import xml.etree.ElementTree as ET
from decimal import Decimal
from gomatic import GoCdConfigurator, FetchArtifactDir, RakeTask, ExecTask, ScriptExecutorTask, FetchArtifactTask, \
FetchArtifactFile, Tab, GitMaterial, PipelineMaterial,... | [] |
adriangrepo/qreservoir | gui/wellplot/settings/style/wellplotstylehandler.py | 20fba1b1fd1a42add223d9e8af2d267665bec493 | import logging
from qrutilities.imageutils import ImageUtils
from PyQt4.QtGui import QColor
logger = logging.getLogger('console')
class WellPlotStyleHandler(object):
'''
classdocs
'''
def saveDataState(self, wellPlotData, wellPlotStyleWidget):
if wellPlotStyleWidget.plotTitleOnCheckBox.isC... | [((4, 9, 4, 37), 'logging.getLogger', 'logging.getLogger', ({(4, 27, 4, 36): '"""console"""'}, {}), "('console')", False, 'import logging\n'), ((19, 20, 19, 49), 'qrutilities.imageutils.ImageUtils.rgbToString', 'ImageUtils.rgbToString', ({(19, 43, 19, 44): 'r', (19, 45, 19, 46): 'g', (19, 47, 19, 48): 'b'}, {}), '(r, g... |
geoffreynyaga/ANGA-UTM | utm_messages/urls.py | 8371a51ad27c85d2479bb34d8c4e02ea28465941 | from django.conf.urls import url
from . import views
app_name = "messages"
urlpatterns = [
url(r'^$', views.InboxListView.as_view(), name='inbox'),
url(r'^sent/$', views.SentMessagesListView.as_view(), name='sent'),
url(r'^compose/$', views.MessagesCreateView.as_view(), name='compo... | [] |
iotile/iotile_cloud | server/apps/datablock/tests/test_create_worker.py | 9dc65ac86d3a730bba42108ed7d9bbb963d22ba6 | import datetime
import json
import dateutil.parser
from django.contrib.auth import get_user_model
from django.test import Client, TestCase
from django.utils import timezone
from apps.devicelocation.models import DeviceLocation
from apps.physicaldevice.models import Device
from apps.property.models import GenericProp... | [((27, 13, 27, 29), 'django.contrib.auth.get_user_model', 'get_user_model', ({}, {}), '()', False, 'from django.contrib.auth import get_user_model\n'), ((36, 18, 38, 9), 'apps.stream.models.StreamVariable.objects.create_variable', 'StreamVariable.objects.create_variable', (), '', False, 'from apps.stream.models import ... |
maya2250/nova | nova/policies/servers.py | e483ca1cd9a5db5856f87fc69ca07c42d2be5def | # 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
# d... | [((27, 4, 36, 10), 'oslo_policy.policy.DocumentedRuleDefault', 'policy.DocumentedRuleDefault', ({(28, 8, 28, 25): "(SERVERS % 'index')", (29, 8, 29, 16): 'RULE_AOO', (30, 8, 30, 26): '"""List all servers"""', (31, 8, 36, 9): "[{'method': 'GET', 'path': '/servers'}]"}, {}), "(SERVERS % 'index', RULE_AOO,\n 'List all ... |
sajaldebnath/vrops-custom-group-creation | set-env.py | e3c821336832445e93706ad29afe216867660123 | # !/usr/bin python
"""
#
# set-env - a small python program to setup the configuration environment for data-push.py
# data-push.py contains the python program to push attribute values to vROps
# Author Sajal Debnath <sdebnath@vmware.com>
#
"""
# Importing the required modules
import json
import base64
i... | [((29, 19, 29, 49), 'base64.b64encode', 'base64.b64encode', ({(29, 36, 29, 48): 'serverpasswd'}, {}), '(serverpasswd)', False, 'import base64\n'), ((55, 4, 55, 107), 'json.dump', 'json.dump', (), '', False, 'import json\n'), ((19, 27, 19, 56), 'os.path.realpath', 'os.path.realpath', ({(19, 44, 19, 55): 'sys.argv[0]'}, ... |
gtadeus/LeetCodeChallenge2009 | week02/day08.py | 81d3fae205fb9071d7a98260df9bbeb1c8c8ffe0 | import unittest
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def sumRootToLeaf(self, root: TreeNode) -> int:
m = self.c(root)
r=0
for n in ... | [((51, 4, 51, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n')] |
tiuD/cross-prom | config.py | 8b987138ec32e0ac64ca6ffe13d0e1cd0d18aef3 | TOKEN = "1876415562:AAEsX_c9k3Fot2IT0BYRqkCCQ5vFEHQDLDQ"
CHAT_ID = [957539786] # e.g. [1234567, 2233445, 3466123...]
| [] |
mik2k2/buchschloss | buchschloss/gui2/__init__.py | 8a9d17de5847ccab48a0de48aa4b60af2a7cc045 | """entry point"""
from . import main
start = main.app.launch
| [] |
francesco-p/FACIL | src/tests/test_stop_at_task.py | e719deebb6d2acb5778b60759294c23ea5e2b454 | from tests import run_main_and_assert
FAST_LOCAL_TEST_ARGS = "--exp-name local_test --datasets mnist" \
" --network LeNet --num-tasks 5 --seed 1 --batch-size 32" \
" --nepochs 2 --num-workers 0 --stop-at-task 3"
def test_finetuning_stop_at_task():
args_line = FAST_LO... | [((11, 4, 11, 34), 'tests.run_main_and_assert', 'run_main_and_assert', ({(11, 24, 11, 33): 'args_line'}, {}), '(args_line)', False, 'from tests import run_main_and_assert\n')] |
shreyventure/LeetCode-Solutions | Python/contains-duplicate.py | 74423d65702b78974e390f17c9d6365d17e6eed5 | # Autor: Anuj Sharma (@optider)
# Github Profile: https://github.com/Optider/
# Problem Link: https://leetcode.com/problems/contains-duplicate/
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
count = {}
for n in nums :
if count.get(n) != None :
ret... | [] |
google-ar/chromium | build/android/gyp/dex.py | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | #!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import optparse
import os
import sys
import tempfile
import zipfile
from util import build_utils
def _C... | [((30, 7, 30, 37), 'zipfile.ZipFile', 'zipfile.ZipFile', ({(30, 23, 30, 31): 'dex_path', (30, 33, 30, 36): '"""r"""'}, {}), "(dex_path, 'r')", False, 'import zipfile\n'), ((32, 7, 32, 63), 'zipfile.ZipFile', 'zipfile.ZipFile', ({(32, 23, 32, 35): 'tmp_dex_path', (32, 37, 32, 40): '"""w"""', (32, 42, 32, 62): 'zipfile.Z... |
Edwardhgj/meiduo | apps/views.py | 38796f5caf54676eb5620f50ade5474ee8700ad8 | from django.shortcuts import render
from django.http import HttpResponse
from django.contrib.auth.hashers import check_password, make_password
from django.views import View
from utils.response_code import RET, error_map
from rest_framework.views import APIView
from rest_framework.response import Response
from apps.ser... | [((17, 11, 17, 46), 'django.shortcuts.render', 'render', ({(17, 18, 17, 25): 'request', (17, 27, 17, 45): '"""admin/login.html"""'}, {}), "(request, 'admin/login.html')", False, 'from django.shortcuts import render\n'), ((58, 15, 58, 35), 'django.contrib.auth.hashers.make_password', 'make_password', ({(58, 29, 58, 34):... |
realtwister/LearnedEvolution | learnedevolution/targets/covariance/amalgam_covariance.py | 2ec49b50a49acae9693cfb05ac114dfbcc4aa337 | import numpy as np;
from .covariance_target import CovarianceTarget;
class AMaLGaMCovariance(CovarianceTarget):
_API=2.
def __init__(self,
theta_SDR = 1.,
eta_DEC = 0.9,
alpha_Sigma = [-1.1,1.2,1.6],
NIS_MAX = 25,
tau = 0.35,
epsilon = 1e-30,
condition_n... | [((53, 16, 53, 45), 'numpy.linalg.svd', 'np.linalg.svd', ({(53, 30, 53, 44): 'new_covariance'}, {}), '(new_covariance)', True, 'import numpy as np\n'), ((54, 17, 54, 26), 'numpy.max', 'np.max', ({(54, 24, 54, 25): 's'}, {}), '(s)', True, 'import numpy as np\n'), ((55, 17, 55, 80), 'numpy.clip', 'np.clip', ({(55, 25, 55... |
terrorizer1980/fs-admin | binding.gyp | e21216161c56def4ca76a3ef4e71844e2ba26074 | {
'target_defaults': {
'win_delay_load_hook': 'false',
'conditions': [
['OS=="win"', {
'msvs_disabled_warnings': [
4530, # C++ exception handler used, but unwind semantics are not enabled
4506, # no definition for inline function
],
}],
],
},
'targets'... | [] |
emoritzx/botw-tracker | src/botwtracker/settings.py | 9c096e62825f2ba2f0f66167b646eaf5a1b5b50a | """Django settings for botwtracker project.
Copyright (c) 2017, Evan Moritz.
botw-tracker is an open source software project released under the MIT License.
See the accompanying LICENSE file for terms.
"""
import os
from .config_local import *
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | [((14, 11, 14, 47), 'os.path.join', 'os.path.join', ({(14, 24, 14, 32): 'BASE_DIR', (14, 34, 14, 38): '""".."""', (14, 40, 14, 46): '"""data"""'}, {}), "(BASE_DIR, '..', 'data')", False, 'import os\n'), ((110, 4, 110, 42), 'os.path.join', 'os.path.join', ({(110, 17, 110, 25): 'BASE_DIR', (110, 27, 110, 31): '""".."""',... |
Geo-Gabriel/eccomerce_nestle_mongodb | app/domains/users/views.py | 97bf5dbdc7bee20a9ca2f7cad98afc6e8f11bd3e | from flask import Blueprint, request, jsonify
from app.domains.users.actions import get_all_users, insert_user, get_user_by_id, update_user, delete_user
app_users = Blueprint('app.users', __name__)
@app_users.route('/users', methods=['GET'])
def get_users():
return jsonify([user.serialize() for user in get_all_... | [((5, 12, 5, 44), 'flask.Blueprint', 'Blueprint', ({(5, 22, 5, 33): '"""app.users"""', (5, 35, 5, 43): '__name__'}, {}), "('app.users', __name__)", False, 'from flask import Blueprint, request, jsonify\n'), ((15, 11, 15, 37), 'app.domains.users.actions.get_user_by_id', 'get_user_by_id', (), '', False, 'from app.domains... |
PerryXDeng/project_punyslayer | legacy_code/tf_cnn_siamese/model.py | 79529b020ca56a5473dbb85ac7155bc03dc5023a | import legacy_code.tf_cnn_siamese.configurations as conf
import tensorflow as tf
import numpy as np
def construct_cnn(x, conv_weights, conv_biases, fc_weights, fc_biases,
dropout = False):
"""
constructs the convolution graph for one image
:param x: input node
:param conv_weights: convolutio... | [((32, 13, 32, 34), 'tensorflow.reshape', 'tf.reshape', ({(32, 24, 32, 25): 'x', (32, 27, 32, 33): '[n, m]'}, {}), '(x, [n, m])', True, 'import tensorflow as tf\n'), ((61, 12, 61, 49), 'tensorflow.squared_difference', 'tf.squared_difference', ({(61, 34, 61, 40): 'twin_1', (61, 42, 61, 48): 'twin_2'}, {}), '(twin_1, twi... |
FingerCrunch/scrapy | tests/test_utils_log.py | 3225de725720bba246ba8c9845fe4b84bc0c82e7 | import sys
import logging
import unittest
from testfixtures import LogCapture
from twisted.python.failure import Failure
from scrapy.utils.log import (failure_to_exc_info, TopLevelFormatter,
LogCounterHandler, StreamLogger)
from scrapy.utils.test import get_crawler
from scrapy.extensions... | [((32, 23, 32, 35), 'testfixtures.LogCapture', 'LogCapture', ({}, {}), '()', False, 'from testfixtures import LogCapture\n'), ((36, 17, 36, 42), 'logging.getLogger', 'logging.getLogger', ({(36, 35, 36, 41): '"""test"""'}, {}), "('test')", False, 'import logging\n'), ((42, 17, 42, 48), 'logging.getLogger', 'logging.getL... |
jeff012345/clue-part-duo | astar.py | bd9ccd2ccdbc2fe358a696b31644b93e70ff874b | import heapq
from typing import List
from definitions import RoomPosition, Position
import random
import sys
class PriorityQueue:
def __init__(self):
self.elements: Array = []
def empty(self) -> bool:
return len(self.elements) == 0
def put(self, item, priority: float):
hea... | [((18, 15, 18, 43), 'heapq.heappop', 'heapq.heappop', ({(18, 29, 18, 42): 'self.elements'}, {}), '(self.elements)', False, 'import heapq\n'), ((15, 49, 15, 84), 'random.randint', 'random.randint', ({(15, 64, 15, 65): '(1)', (15, 67, 15, 83): '(9999999999999999)'}, {}), '(1, 9999999999999999)', False, 'import random\n')... |
pb-jchin/FALCON_unzip | src/py_scripts/fc_phasing.py | 21b1df3491e3bb7b9d8ecd13fc0c9c1a45b6393f | from pypeflow.common import *
from pypeflow.data import PypeLocalFile, makePypeLocalFile, fn
from pypeflow.task import PypeTask, PypeThreadTaskBase, PypeTaskBase
from pypeflow.controller import PypeWorkflow, PypeThreadWorkflow
from falcon_kit.FastaReader import FastaReader
import subprocess, shlex
import os, re
cigar... | [((13, 13, 13, 30), 'pypeflow.data.fn', 'fn', ({(13, 16, 13, 29): 'self.bam_file'}, {}), '(self.bam_file)', False, 'from pypeflow.data import PypeLocalFile, makePypeLocalFile, fn\n'), ((17, 14, 17, 32), 'pypeflow.data.fn', 'fn', ({(17, 17, 17, 31): 'self.vmap_file'}, {}), '(self.vmap_file)', False, 'from pypeflow.data ... |
pabloduque0/cnn_deconv_viz | augmentation/combineds/wgan_gp_straight.py | 3fc3d8a9dbad8e8e28d4df4023bdb438e4c9cf85 | from keras.datasets import mnist
from keras.layers.merge import _Merge
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampling2D, Conv... | [((24, 16, 24, 47), 'keras.backend.random_uniform', 'K.random_uniform', ({(24, 33, 24, 46): '(32, 1, 1, 1)'}, {}), '((32, 1, 1, 1))', True, 'import keras.backend as K\n'), ((34, 20, 34, 39), 'keras.optimizers.RMSprop', 'RMSprop', (), '', False, 'from keras.optimizers import RMSprop\n'), ((37, 25, 37, 72), 'augmentation... |
BernardoB95/Extrator_SPEDFiscal | Core/Block_C/RC480_Factory.py | 10b4697833c561d24654251da5f22d044f03fc16 | from Core.IFactory import IFactory
from Regs.Block_C import RC480
class RC480Factory(IFactory):
def create_block_object(self, line):
self.rc480 = _rc480 = RC480()
_rc480.reg_list = line
return _rc480
| [((8, 30, 8, 37), 'Regs.Block_C.RC480', 'RC480', ({}, {}), '()', False, 'from Regs.Block_C import RC480\n')] |
mgoldchild/keras-onnx | keras2onnx/proto/__init__.py | 8e700572b89a907ca21a3096556f64b62b7aa76c | ###############################################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
###############################################################################
imp... | [((17, 11, 17, 41), 'onnx.defs.onnx_opset_version', 'onnx.defs.onnx_opset_version', ({}, {}), '()', False, 'import onnx\n'), ((21, 27, 21, 63), 'pkg_resources.parse_version', 'pkg_resources.parse_version', ({(21, 55, 21, 62): '"""1.0.1"""'}, {}), "('1.0.1')", False, 'import pkg_resources\n'), ((28, 3, 28, 34), 'os.envi... |
ocefpaf/xroms | tests/test_load.py | 763d6e678e28fe074e0aaab26fecd2b74e51a8b0 | '''Test package.'''
import xroms
from glob import glob
import os
def test_open_netcdf():
'''Test xroms.open_netcdf().'''
base = os.path.join(xroms.__path__[0],'..','tests','input')
files = glob('%s/ocean_his_000?.nc' % base)
ds = xroms.open_netcdf(files)
assert ds
def test_open_zar... | [((11, 11, 11, 63), 'os.path.join', 'os.path.join', ({(11, 24, 11, 41): 'xroms.__path__[0]', (11, 42, 11, 46): '""".."""', (11, 47, 11, 54): '"""tests"""', (11, 55, 11, 62): '"""input"""'}, {}), "(xroms.__path__[0], '..', 'tests', 'input')", False, 'import os\n'), ((12, 12, 12, 47), 'glob.glob', 'glob', ({(12, 17, 12, ... |
alvnary18/django-nvd3 | demoproject/demoproject/urls.py | 4b7dffb1107b8202698212b99c26d1d0097afd1d | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^piechart/', views.demo_piechart, name='demo_piechart'),
url(r'^linechart/', views.demo_linechart, name='demo_linechart'),
url(r'^linechart_without_date/', views.demo_linechart_without_date,... | [((6, 4, 6, 39), 'django.conf.urls.url', 'url', (), '', False, 'from django.conf.urls import url\n'), ((7, 4, 7, 65), 'django.conf.urls.url', 'url', (), '', False, 'from django.conf.urls import url\n'), ((8, 4, 8, 68), 'django.conf.urls.url', 'url', (), '', False, 'from django.conf.urls import url\n'), ((9, 4, 9, 107),... |
Harri-Renney/Mind_Control_Synth | wired_version/mcs_wired.py | 5a892a81a3f37444ef154f29a62d44fa1476bfbd | import time
import mido
from pinaps.piNapsController import PiNapsController
from NeuroParser import NeuroParser
"""
Equation of motion used to modify virbato.
"""
def positionStep(pos, vel, acc):
return pos + vel * 2 + (1/2) * acc * 4
def velocityStep(vel, acc):
return acc * 2 + vel
CTRL_LF... | [((49, 11, 49, 60), 'mido.open_output', 'mido.open_output', ({(49, 28, 49, 59): '"""USB Midi:USB Midi MIDI 1 20:0"""'}, {}), "('USB Midi:USB Midi MIDI 1 20:0')", False, 'import mido\n'), ((50, 18, 50, 83), 'mido.Message', 'mido.Message', (), '', False, 'import mido\n'), ((54, 23, 54, 41), 'pinaps.piNapsController.PiNap... |
windblood/kafka_stock | pipeline/visualization/single_tab.py | 8dbe4a1cf5c367b3c210683d4027bbfaf955ed41 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 31 11:47:47 2019
@author: yanyanyu
"""
"""
Tab1-plot1: candlestick
"""
import json
import datetime
import pandas as pd
from math import pi
from random import choice
from pytz import timezone
from bokeh.plotting import figure,show
from bokeh.p... | [((40, 19, 40, 95), 'pandas.DataFrame', 'pd.DataFrame', (), '', True, 'import pandas as pd\n'), ((48, 17, 48, 65), 'bokeh.models.Select', 'Select', (), '', False, 'from bokeh.models import ColumnDataSource, Select, HoverTool, LinearAxis, LabelSet, Range1d, PreText, Div\n'), ((49, 18, 49, 40), 'bokeh.models.Div', 'Div',... |
Wangjw6/project | traffic_predict/model.py | daae9de42fe7bf7ff29c20246e1164b62b7cef4a | # -*- coding:utf-8 -*-
import tensorflow as tf
class CNN:
def __init__(self, save_or_load_path=None, trainable=True, learning_rate = 0.00002,timestep=9,road=189,predstep=1):
self.trainable = trainable
self.learning_rate = learning_rate
self.road = road
self.input_size = timestep *... | [((13, 22, 13, 93), 'tensorflow.placeholder', 'tf.placeholder', (), '', True, 'import tensorflow as tf\n'), ((14, 22, 14, 95), 'tensorflow.placeholder', 'tf.placeholder', (), '', True, 'import tensorflow as tf\n'), ((18, 18, 18, 56), 'tensorflow.truncated_normal', 'tf.truncated_normal', (), '', True, 'import tensorflow... |
SanLiWuXun/Virtual-Control | VirtualMouse-mediapipe.py | c3b38d4e2df201af851ca70a90de1fdc770158e4 | import cv2
import mediapipe as mp
from time import sleep
import numpy as np
import autopy
import pynput
wCam, hCam = 1280, 720
wScr, hScr = autopy.screen.size()
cap = cv2.VideoCapture(0)
cap.set(3, wCam)
cap.set(4, hCam)
mp_drawing = mp.solutions.drawing_utils
mp_hands = mp.solutions.hands
mouse = pynput.mouse.Cont... | [((9, 13, 9, 33), 'autopy.screen.size', 'autopy.screen.size', ({}, {}), '()', False, 'import autopy\n'), ((11, 6, 11, 25), 'cv2.VideoCapture', 'cv2.VideoCapture', ({(11, 23, 11, 24): '0'}, {}), '(0)', False, 'import cv2\n'), ((18, 8, 18, 33), 'pynput.mouse.Controller', 'pynput.mouse.Controller', ({}, {}), '()', False, ... |
JochenZoellner/tf_neiss-1 | util/tools/split_train_val.py | c91019e5bce6d3c7512237eec5ea997fd95304ac | import glob
import logging
import os
import shutil
import sys
"""script to divide a folder with generated/training data into a train and val folder
- val folder contains 500 Samples if not changed in source code
- DOES NOT work if images structured in subfolders, see below
- if there is no dir in the given... | [((22, 12, 22, 39), 'os.path.join', 'os.path.join', ({(22, 25, 22, 35): 'foldername', (22, 37, 22, 38): 'x'}, {}), '(foldername, x)', False, 'import os\n'), ((18, 27, 18, 38), 'os.getcwd', 'os.getcwd', ({}, {}), '()', False, 'import os\n'), ((32, 28, 32, 57), 'glob.glob1', 'glob.glob1', ({(32, 39, 32, 47): 'dir_path', ... |
KonstantinKlepikov/Hands-on-Neuroevolution-with-Python | Chapter10/neuroevolution/distributed_helpers.py | cdd35fa21f2a091d176c140427ab1644d9ecd1f2 |
import threading
from queue import Queue
from multiprocessing.pool import ApplyResult
import tabular_logger as tlogger
class AsyncWorker(object):
@property
def concurrent_tasks(self):
raise NotImplementedError()
def run_async(self, task_id, task, callback):
raise NotImplementedError()
... | [((19, 27, 19, 34), 'queue.Queue', 'Queue', ({}, {}), '()', False, 'from queue import Queue\n'), ((21, 33, 21, 40), 'queue.Queue', 'Queue', ({}, {}), '()', False, 'from queue import Queue\n'), ((33, 30, 36, 13), 'threading.Thread', 'threading.Thread', (), '', False, 'import threading\n'), ((38, 8, 38, 61), 'tabular_log... |
tompis/casual | make/platform/registry.py | d838716c7052a906af8a19e945a496acdc7899a2 |
import os
registry = {}
class RegisterPlatform(object):
'''
classdocs
'''
def __init__(self, platform):
'''
Constructor
'''
self.platform = platform
def __call__(self, clazz):
registry[self.platform] = clazz
def platform():
# Decide on whi... | [] |
everyvoter/everyvoter | mailer/admin.py | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | """Django Admin Panels for App"""
from django.contrib import admin
from mailer import models
@admin.register(models.SendingAddress)
class SendingAddressAdmin(admin.ModelAdmin):
"""Admin View for SendingAddress"""
list_display = ('address', 'organization')
list_filter = ('organization__name',)
actions ... | [((6, 1, 6, 38), 'django.contrib.admin.register', 'admin.register', ({(6, 16, 6, 37): 'models.SendingAddress'}, {}), '(models.SendingAddress)', False, 'from django.contrib import admin\n')] |
systemallica/django-belt | tests/settings.py | 3035a8bad26a108d9c78daaccb81ab8a9a9ebd41 | DEBUG = True
USE_TZ = True
SECRET_KEY = "dummy"
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sites",
"rest_framework",
"django_filters",
"belt",
"tests.app",
]... | [] |
ALIGN-analoglayout/2018-01-ALIGN | Cell_Generation/fabric_CMC_NMOS.py | 931263cec2efc05d58657af9ecca88ae0040c3a5 | import sys
import json
import transformation
class StopPointGrid:
def __init__( self, nm, layer, direction, width, pitch, offset=0):
self.nm = nm
self.layer = layer
self.direction = direction
assert direction in ['v','h']
self.width = width
self.pitch = pitch
... | [((57, 20, 57, 60), 'transformation.Rect', 'transformation.Rect', ({(57, 40, 57, 44): 'None', (57, 45, 57, 49): 'None', (57, 50, 57, 54): 'None', (57, 55, 57, 59): 'None'}, {}), '(None, None, None, None)', False, 'import transformation\n'), ((59, 16, 59, 51), 'transformation.Rect', 'transformation.Rect', ({(59, 37, 59,... |
tiramtaramta/conduit | docs/testcases/all_in_one.py | ae4ca8e64fe64c2b6702d803d799e380fda84a92 | from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
import os
import time
import csv
from webdriver_manager.chrome import ChromeDriverManager
import math
from basic_function import ... | [((15, 26, 15, 35), 'selenium.webdriver.chrome.options.Options', 'Options', ({}, {}), '()', False, 'from selenium.webdriver.chrome.options import Options\n'), ((32, 8, 32, 21), 'time.sleep', 'time.sleep', ({(32, 19, 32, 20): '(2)'}, {}), '(2)', False, 'import time\n'), ((61, 8, 61, 21), 'time.sleep', 'time.sleep', ({(6... |
amalshaji/python-playground | config.py | bd3a88a493f36230958613d60a9d70d64f971dba | from pydantic import BaseSettings
class Settings(BaseSettings):
deta_project_key: str
settings = Settings()
| [] |
dainiusjocas/labs | IV_semester/os/configs.py | 25aa0ae2032681dbaf0afd83f3d80bedddea6407 | #!/usr/bin/env python
''' This module provides configuration options for OS project. No more magic numbers! '''
BLOCK_SIZE = 16 # words
WORD_SIZE = 4 # bytes
# length od RS in blocks
RESTRICTED_LENGTH = 1
# length of DS in blocks
DS_LENGTH = 6
# timer value
TIMER_VALUE = 10
# buffer size
BUFFER_SIZE = 16
# num... | [] |
Russ76/robotics-toolbox-python | roboticstoolbox/models/URDF/Puma560.py | 4b3e82a6522757ffde1f83aef8d05b3ad475e9de | #!/usr/bin/env python
import numpy as np
from roboticstoolbox.robot.ERobot import ERobot
from math import pi
class Puma560(ERobot):
"""
Class that imports a Puma 560 URDF model
``Puma560()`` is a class which imports a Unimation Puma560 robot definition
from a URDF file. The model describes its kine... | [((57, 18, 57, 57), 'numpy.array', 'np.array', ({(57, 27, 57, 56): '[0, pi / 2, -pi / 2, 0, 0, 0]'}, {}), '([0, pi / 2, -pi / 2, 0, 0, 0])', True, 'import numpy as np\n'), ((58, 18, 58, 29), 'numpy.zeros', 'np.zeros', ({(58, 27, 58, 28): '6'}, {}), '(6)', True, 'import numpy as np\n'), ((64, 41, 64, 69), 'numpy.array',... |
hashnfv/hashnfv-functest | functest/tests/unit/odl/test_odl.py | ff34df7ec7be6cd5fcf0f7557b393bd5d6266047 | #!/usr/bin/env python
# Copyright (c) 2016 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
"""Define t... | [((68, 4, 68, 37), 'logging.disable', 'logging.disable', ({(68, 20, 68, 36): 'logging.CRITICAL'}, {}), '(logging.CRITICAL)', False, 'import logging\n'), ((120, 5, 120, 67), 'mock.patch', 'mock.patch', (), '', False, 'import mock\n'), ((174, 5, 174, 51), 'mock.patch', 'mock.patch', (), '', False, 'import mock\n'), ((181... |
OptimalRanging/NTPsec | ntpclients/ntptrace.py | 7fa9b38c3e91f96b173ffa02bafa29cf81173cf7 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ntptrace - trace peers of an NTP server
Usage: ntptrace [-n | --numeric] [-m number | --max-hosts=number]
[-r hostname | --host=hostname] [--help | --more-help]
hostname
See the manual page for details.
"""
# SPDX-License-Identifier: BS... | [((118, 27, 120, 64), 'getopt.getopt', 'getopt.getopt', ({(119, 8, 119, 20): 'sys.argv[1:]', (119, 22, 119, 30): '"""m:nr:?"""', (120, 8, 120, 63): "['help', 'host=', 'max-hosts=', 'more-help', 'numeric']"}, {}), "(sys.argv[1:], 'm:nr:?', ['help', 'host=', 'max-hosts=',\n 'more-help', 'numeric'])", False, 'import ge... |
abueide/lbry | lbrynet/wallet/server/block_processor.py | 7f5deaf6c80422a30b3714d4bf12e028756ed9fe | import struct
import msgpack
from lbrynet.wallet.transaction import Transaction, Output
from torba.server.hash import hash_to_hex_str
from torba.server.block_processor import BlockProcessor
from lbrynet.schema.claim import Claim
from lbrynet.wallet.server.model import ClaimInfo
class LBRYBlockProcessor(BlockProce... | [((139, 15, 139, 90), 'lbrynet.wallet.server.model.ClaimInfo', 'ClaimInfo', ({(139, 25, 139, 29): 'name', (139, 31, 139, 36): 'value', (139, 38, 139, 42): 'txid', (139, 44, 139, 48): 'nout', (139, 50, 139, 63): 'output.amount', (139, 65, 139, 72): 'address', (139, 74, 139, 80): 'height', (139, 82, 139, 89): 'cert_id'},... |
jihunroh/ProjectEuler-Python | ProjectEuler.Problem.013.py | 2fceaf5c3dd61038004b6128c5d9ee7a76142bca | from ProjectEulerCommons.Base import *
numbers_list = """37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
8926167... | [] |
historeno/enermaps | api/app/endpoints/datasets.py | ad3a97636baa153a56367e374d0fef7f009bf19d | """Endpoint for the manipulation of datasets
"""
import hashlib
from flask import Response
from flask_restx import Namespace, Resource, abort
from app.common import client
from app.common import datasets as datasets_fcts
from app.common import path
api = Namespace("datasets", description="Datasets related endpoints... | [((13, 6, 13, 69), 'flask_restx.Namespace', 'Namespace', (), '', False, 'from flask_restx import Namespace, Resource, abort\n'), ((20, 19, 20, 44), 'app.common.client.get_dataset_list', 'client.get_dataset_list', ({}, {}), '()', False, 'from app.common import client\n'), ((34, 19, 34, 44), 'app.common.client.get_datase... |
forewing/lc | python/p45.py | 314468a1a3bb7d38eccf1f34b0d1b7da04a34784 | class Solution:
def jump(self, nums: List[int]) -> int:
n = len(nums)
dp = [float('inf')] * n
dp[0] = 0
tail = 1
for i in range(n):
limit = min(n, i + nums[i] + 1)
for j in range(tail, limit):
dp[j] = min(dp[j], dp[i] + 1)
... | [] |
doycode/mlgorithms | mlgorithms/knn/__init__.py | b187efad474acdc9b7c6defe4761f101530bd1a3 | from .knn import KNNClassifier
__all__ = ['KNNClassifier'] | [] |
sotkonstantinidis/testcircle | apps/configuration/fields.py | 448aa2148fbc2c969e60f0b33ce112d4740a8861 | import unicodedata
from django.forms import fields
class XMLCompatCharField(fields.CharField):
"""
Strip 'control characters', as XML 1.0 does not allow them and the API may
return data in XML.
"""
def to_python(self, value):
value = super().to_python(value=value)
return self.rem... | [((20, 23, 20, 47), 'unicodedata.category', 'unicodedata.category', ({(20, 44, 20, 46): 'ch'}, {}), '(ch)', False, 'import unicodedata\n')] |
erikdelange/MicroPython-HTTP-Server | ademo.py | 54bda9d55ac65b9a6bbf2189098a788add52b344 | import sys
import time
import uasyncio as asyncio
from ahttpserver import sendfile, Server
app = Server()
@app.route("GET", "/")
async def root(reader, writer, request):
writer.write(b"HTTP/1.1 200 OK\r\n")
writer.write(b"Connection: close\r\n")
writer.write(b"Content-Type: text/html\r\n")
... | [((7, 6, 7, 14), 'ahttpserver.Server', 'Server', ({}, {}), '()', False, 'from ahttpserver import sendfile, Server\n'), ((46, 8, 46, 24), 'time.localtime', 'time.localtime', ({}, {}), '()', False, 'import time\n'), ((75, 11, 75, 35), 'uasyncio.get_event_loop', 'asyncio.get_event_loop', ({}, {}), '()', True, 'import uasy... |
vipulSharma18/Deep-Self-Supervised-Audio-Video-Cosegmentation-with-Adaptive-Noise-Cancellation | models/audio_net.py | d52695be31a1552d0785f3b6634bde6ef9276a90 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Unet(nn.Module):
def __init__(self, fc_dim=64, num_downs=5, ngf=64, use_dropout=False):
super(Unet, self).__init__()
# construct unet structure
unet_block = UnetBlock(
ngf * 8, ngf * 8, input_n... | [((31, 19, 31, 36), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', ({(31, 34, 31, 35): '1'}, {}), '(1)', True, 'import torch.nn as nn\n'), ((58, 19, 58, 42), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', ({(58, 32, 58, 35): '0.2', (58, 37, 58, 41): 'True'}, {}), '(0.2, True)', True, 'import torch.nn as nn\n'), ((59, 19, 59, 49), 't... |
cnschema/kgtool | tests/test_core.py | 599e23a9e8a856625143b171f9c36eb5b00623f6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Path hack
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
try:
import unittest2 as unittest
except ImportError:
import unittest
from kgtool.core import * # noqa
class CoreTestCase(unittest.TestCase):
def setUp(self):
pass
def t... | [((6, 19, 6, 40), 'os.path.abspath', 'os.path.abspath', ({(6, 35, 6, 39): '""".."""'}, {}), "('..')", False, 'import os\n'), ((204, 4, 204, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((30, 25, 30, 46), 'os.path.basename', 'os.path.basename', ({(30, 42, 30, 45): 'tin'}, {}), '(ti... |
ricardoavelino/compas_ags | ui/Rhino/AGS/dev/AGS_toolbar_display_cmd.py | 1c9e496bc4b72b11adc80ea97288ddc27e92c08e | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import scriptcontext as sc
import compas_rhino
from compas_ags.rhino import SettingsForm
from compas_ags.rhino import FormObject
from compas_ags.rhino import ForceObject
__commandname__ = "AGS_toolbar_displa... | [((26, 4, 26, 99), 'compas_ags.rhino.SettingsForm.from_scene', 'SettingsForm.from_scene', (), '', False, 'from compas_ags.rhino import SettingsForm\n'), ((18, 8, 18, 73), 'compas_rhino.display_message', 'compas_rhino.display_message', ({(18, 37, 18, 72): '"""AGS has not been initialised yet."""'}, {}), "('AGS has not b... |
VidoniJorge/c-interprete | lpp/evaluator.py | 4f026d093b26289d3f692cd64d52069fdd1d954c | from typing import (
Any,
cast,
List,
Optional,
Type
)
import lpp.ast as ast
from lpp.builtins import BUILTINS
from lpp.object import(
Boolean,
Builtin,
Environment,
Error,
Function,
Integer,
Null,
Object,
ObjectType,
String,
Return
)
TRUE = Boolean(True... | [((25, 7, 25, 20), 'lpp.object.Boolean', 'Boolean', ({(25, 15, 25, 19): 'True'}, {}), '(True)', False, 'from lpp.object import Boolean, Builtin, Environment, Error, Function, Integer, Null, Object, ObjectType, String, Return\n'), ((26, 8, 26, 22), 'lpp.object.Boolean', 'Boolean', ({(26, 16, 26, 21): 'False'}, {}), '(Fa... |
QPC-database/aws-parallelcluster | cli/tests/pcluster/config/test_validators.py | 8c2e9595ca171340df21695c27d85dc00f19d3e4 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | [((50, 1, 50, 17), 'pytest.fixture', 'pytest.fixture', ({}, {}), '()', False, 'import pytest\n'), ((55, 1, 90, 1), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(56, 4, 56, 54): '"""section_dict, expected_message, expected_warning"""', (57, 4, 89, 5): "[({'scheduler': 'sge', 'initial_queue_size': 1, 'max_queu... |
takamatsu-shyo/yolo-microservice | flask_app.py | b8ab03b98c0939ab1849d0da938d0878b0ec441f | from flask import Flask
from flask import request
from flask import Response
from resources import resourcePing, resourceResolution
from message_protocol.resolution_input import parseResolutionInput
import json
app = Flask(__name__)
@app.route('/ping', methods=['GET'])
def ping():
output = resourcePing.main()
... | [((8, 6, 8, 21), 'flask.Flask', 'Flask', ({(8, 12, 8, 20): '__name__'}, {}), '(__name__)', False, 'from flask import Flask\n'), ((12, 13, 12, 32), 'resources.resourcePing.main', 'resourcePing.main', ({}, {}), '()', False, 'from resources import resourcePing, resourceResolution\n'), ((14, 11, 14, 53), 'flask.Response', ... |
Stinger101/my_uno_ml_service | backend/server/server/wsgi.py | 47d19f6e5e19e73c465b7ddca889324c9bd5862f | """
WSGI config for server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | [((14, 0, 14, 66), 'os.environ.setdefault', 'os.environ.setdefault', ({(14, 22, 14, 46): '"""DJANGO_SETTINGS_MODULE"""', (14, 48, 14, 65): '"""server.settings"""'}, {}), "('DJANGO_SETTINGS_MODULE', 'server.settings')", False, 'import os\n'), ((16, 14, 16, 36), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_applicat... |
mchestr/pycbc | pycbc/config.py | c215c1f177fe383ec6e797437fa2d5f4727eb9f3 | import os
from functools import reduce
import boto3
import yaml
from copy import deepcopy
from cryptography.fernet import Fernet
from pycbc import json
from pycbc.utils import AttrDict as d
s3 = boto3.client('s3')
_mapping_tag = yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG
_DEFAULTS = d({
'users': [],
'enc... | [((12, 5, 12, 23), 'boto3.client', 'boto3.client', ({(12, 18, 12, 22): '"""s3"""'}, {}), "('s3')", False, 'import boto3\n'), ((86, 11, 86, 50), 'yaml.load', 'yaml.load', (), '', False, 'import yaml\n'), ((45, 41, 45, 44), 'pycbc.utils.AttrDict', 'd', ({}, {}), '()', True, 'from pycbc.utils import AttrDict as d\n'), ((4... |
vinirossa/password_generator_test | models/toolscontext/errorhandler.py | dd2f43540c6f58ff9217320c21b246c0be3fc55f | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Module Name
Description...
"""
__author__ = "Vinícius Pereira"
__copyright__ = "Copyright 2021, Vinícius Pereira"
__credits__ = ["Vinícius Pereira","etc."]
__date__ = "2021/04/12"
__license__ = "GPL"
__version__ = "1.0.0"
__pythonversion__ = "3.9.1"
__maintaine... | [((34, 13, 34, 40), 'logging.getLogger', 'logging.getLogger', ({(34, 31, 34, 39): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((37, 16, 37, 41), 'logging.Formatter', 'logging.Formatter', ({(37, 34, 37, 40): 'format'}, {}), '(format)', False, 'import logging\n'), ((39, 19, 39, 48), 'logging.FileHandler',... |
henchc/Rediscovering-Text-as-Data | 05-Intro-to-SpaCy/scripts/choropleth.py | 3e14fa7a4bd82899ea564d4f7857a5dbdc616a4f | def us_choropleth(t):
import matplotlib.cm
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from matplotlib.colors import Normalize
import shapefile
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
im... | [((14, 4, 14, 33), 'matplotlib.pyplot.title', 'plt.title', (), '', True, 'import matplotlib.pyplot as plt\n'), ((16, 23, 23, 21), 'mpl_toolkits.basemap.Basemap', 'Basemap', (), '', False, 'from mpl_toolkits.basemap import Basemap\n'), ((58, 9, 58, 18), 'matplotlib.pyplot.gca', 'plt.gca', ({}, {}), '()', True, 'import m... |
ntmoore/skycamera | take_day_and_night_pictures.py | c8c67970b0e3a52ce008dbd6b34df20cdda786b7 | import time
import os
#parameters
sunset_hr=8
dawn_hr=7
daytime_period_min=60
nighttime_period_min=1
time.localtime()
print("program starts at ",time.localtime());
while(1):
#Is it day or night?
time.localtime()
hour = time.localtime()[3]
minute = time.localtime()[4]
hour_float = 1.0*hour+minute... | [((10, 0, 10, 16), 'time.localtime', 'time.localtime', ({}, {}), '()', False, 'import time\n'), ((11, 27, 11, 43), 'time.localtime', 'time.localtime', ({}, {}), '()', False, 'import time\n'), ((16, 4, 16, 20), 'time.localtime', 'time.localtime', ({}, {}), '()', False, 'import time\n'), ((17, 11, 17, 27), 'time.localtim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.