repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
achoraev/SoftUni
PythonBasics/ExamPreparation/FamilyTrip.py
0cc7db470a096cc33bbe0ca6bd90060b79120573
budget = float(input()) nights = int(input()) price_night = float(input()) percent_extra = int(input()) if nights > 7: price_night = price_night - (price_night * 0.05) sum = nights * price_night total_sum = sum + (budget * percent_extra / 100) if total_sum <= budget: print(f"Ivanovi will be left ...
[]
csch0/SublimeText-TeX-Live-Package-Manager
tex_live_package_manager/progress.py
ab21bd49a945f611250613e9cb862a7703dc534f
import sublime, sublime_plugin import threading class ProcessQueueManager(): __shared = {} items = [] thread = None # Current item details messages = None function = None callback = None # Progress Bar preferences i = 0 size = 8 add = 1 def __new__(cls, *args, **kwargs): inst = object.__new__(cls) ...
[((1963, 2051), 'sublime.status_message', 'sublime.status_message', (["('%s [%s=%s]' % (self.messages[0], ' ' * before, ' ' * after))"], {}), "('%s [%s=%s]' % (self.messages[0], ' ' * before, ' ' *\n after))\n", (1985, 2051), False, 'import sublime, sublime_plugin\n'), ((2336, 2367), 'threading.Thread.__init__', 'th...
rscprof/moscow_routes_parser
moscow_routes_parser/t_mos_ru.py
692627dd43d62f70e3e12a761897571c79a022a0
import html import json import logging import re from abc import abstractmethod from datetime import datetime, time from typing import Optional import requests from moscow_routes_parser.model import Route, Timetable, Equipment, Timetable_builder from moscow_routes_parser.model_impl import Timetable_builder_t_mos_ru ...
[((6138, 6165), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (6155, 6165), False, 'import logging\n'), ((8193, 8220), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (8210, 8220), False, 'import logging\n'), ((1418, 1504), 're.finditer', 're.finditer', (['"...
spudmind/spud
web/api/get_summary_data.py
86e44bca4efd3cd6358467e1511048698a45edbc
from web.api import BaseAPI from utils import mongo import json class DataApi(BaseAPI): def __init__(self): BaseAPI.__init__(self) self._db = mongo.MongoInterface() self.query = {} self.fields = { "donation_count": "$influences.electoral_commission.donation_count", ...
[((122, 144), 'web.api.BaseAPI.__init__', 'BaseAPI.__init__', (['self'], {}), '(self)\n', (138, 144), False, 'from web.api import BaseAPI\n'), ((164, 186), 'utils.mongo.MongoInterface', 'mongo.MongoInterface', ([], {}), '()\n', (184, 186), False, 'from utils import mongo\n')]
guillermomolina/neutron
neutron/common/ovn/utils.py
bd2933a2588d1e0b18790dd719ca1d89aa4a0c8d
# 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...
[((1595, 1618), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (1608, 1618), False, 'from oslo_log import log\n'), ((1693, 1765), 'collections.namedtuple', 'collections.namedtuple', (['"""AddrPairsDiff"""', "['added', 'removed', 'changed']"], {}), "('AddrPairsDiff', ['added', 'removed', ...
pjryan93/web3.py
ens/exceptions.py
e066452a7b0e78d6cb8a9462532d169de901ef99
import idna class AddressMismatch(ValueError): ''' In order to set up reverse resolution correctly, the ENS name should first point to the address. This exception is raised if the name does not currently point to the address. ''' pass class InvalidName(idna.IDNAError): ''' This excep...
[]
CaptainHorse/MAS-Additions
Submods/MAS Additions/MASM/scripts/midi_input.py
5714aaf8cfa3c57432f6231795cbe1d75df46f74
import mido from socketer import MASM inPort = None doReadInput = False def Start(): global inPort try: print(f"MIDI inputs: {mido.get_input_names()}") inPort = mido.open_input() print(f"MIDI input open: {inPort}") except Exception as e: inPort = None print(f"Could not open MIDI input: {e}") def Update(...
[((169, 186), 'mido.open_input', 'mido.open_input', ([], {}), '()\n', (184, 186), False, 'import mido\n'), ((403, 432), 'socketer.MASM.hasDataBool', 'MASM.hasDataBool', (['"""MIDI_STOP"""'], {}), "('MIDI_STOP')\n", (419, 432), False, 'from socketer import MASM\n'), ((580, 615), 'socketer.MASM.hasDataCheck', 'MASM.hasDa...
Matheus-Rangel/dash-carbon-components
dash_carbon_components/Column.py
e3f4aa4a8d649e2740db32677040f2548ef5da48
# AUTO GENERATED FILE - DO NOT EDIT from dash.development.base_component import Component, _explicitize_args class Column(Component): """A Column component. Row Column Keyword arguments: - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, strin...
[]
ddddhm1/LuWu
src/backend/schemas/vps.py
f9feaf10a6aca0dd31f250741a1c542ee5256633
from typing import List from typing import Optional from typing import Union from models.vps import VpsStatus from schemas.base import APIModel from schemas.base import BasePagination from schemas.base import BaseSchema from schemas.base import BaseSuccessfulResponseModel class VpsSshKeySchema(APIModel): name: s...
[]
hari-sh/sigplot
main.py
cd2359d7c868e35ed1d976d7eb8ac35d2dcc7e81
import sigplot as sp import matplotlib import matplotlib.pyplot as plt import numpy as np matplotlib.rcParams['toolbar'] = 'None' plt.style.use('dark_background') fig = plt.figure() # seed = np.linspace(3, 7, 1000) # a = (np.sin(2 * np.pi * seed)) # b = (np.cos(2 * np.pi * seed)) # sp.correlate(fig, b...
[((139, 171), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""dark_background"""'], {}), "('dark_background')\n", (152, 171), True, 'import matplotlib.pyplot as plt\n'), ((181, 193), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (191, 193), True, 'import matplotlib.pyplot as plt\n'), ((337, 359), 'n...
msyyc/autorest.python
test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/operations/_operations.py
91aa86f51d5c43c10ead5d51ac102618d23e3a21
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
[((1030, 1042), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (1037, 1042), False, 'from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar\n'), ((1158, 1170), 'msrest.Serializer', 'Serializer', ([], {}), '()\n', (1168, 1170), False, 'from msrest import Serializer\n'), ((1753, 1824), 'azur...
reddit/baseplate.py-upgrader
baseplate_py_upgrader/docker.py
2e4b019de7c22e2d2467eba488867fe81d7d5fc1
import logging import re from pathlib import Path from typing import Match logger = logging.getLogger(__name__) IMAGE_RE = re.compile( r"/baseplate-py:(?P<version>[0-9.]+(\.[0-9]+)?)-py(?P<python>[23]\.[0-9]+)-(?P<distro>(bionic|buster))(?P<repo>-artifactory)?(?P<dev>-dev)?" ) def upgrade_docker_image_refere...
[((87, 114), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (104, 114), False, 'import logging\n'), ((128, 291), 're.compile', 're.compile', (['"""/baseplate-py:(?P<version>[0-9.]+(\\\\.[0-9]+)?)-py(?P<python>[23]\\\\.[0-9]+)-(?P<distro>(bionic|buster))(?P<repo>-artifactory)?(?P<dev>-dev)...
ArcherLuo233/election-s-prediction
model/swtz_ty.py
9da72cb855f6d61f9cdec6e15f7ca832629ba51a
from sqlalchemy import Column, ForeignKey, Integer, String, Text from model.base import Base class SWTZ_TY(Base): __tablename__ = 'swtz_ty' class_name = '商务团组-团员' foreign_key = 'swtz_id' export_docx = False export_handle_file = ['identity'] field = [ 'id', 'nickname', 'job', 'id_card...
[((787, 813), 'sqlalchemy.Column', 'Column', (['Text'], {'comment': '"""备注"""'}), "(Text, comment='备注')\n", (793, 813), False, 'from sqlalchemy import Column, ForeignKey, Integer, String, Text\n'), ((558, 579), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""swtz.id"""'], {}), "('swtz.id')\n", (568, 579), False, 'from sql...
code-review-doctor/amy
amy/dashboard/tests/test_autoupdate_profile.py
268c1a199510457891459f3ddd73fcce7fe2b974
from django.urls import reverse from consents.models import Consent, Term from workshops.models import KnowledgeDomain, Person, Qualification from workshops.tests.base import TestBase class TestAutoUpdateProfile(TestBase): def setUp(self): self._setUpAirports() self._setUpLessons() self._...
[((358, 473), 'workshops.models.Person.objects.create_user', 'Person.objects.create_user', ([], {'username': '"""user"""', 'personal': '""""""', 'family': '""""""', 'email': '"""user@example.org"""', 'password': '"""pass"""'}), "(username='user', personal='', family='', email=\n 'user@example.org', password='pass')\...
kprokofi/animal-recognition-with-voice
bot/recognizer_bot/yolo/common/utils.py
e9e5235315255eb6e17df3dba616b2ed4c902c92
import numpy as np import time import cv2 import colorsys import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.layers import Activation, ReLU, Multiply # Custom objects from backbones package https://github.com/david8862/keras-YOLOv3-model-set/tree/master/common/backbones def mish(...
[((1919, 1982), 'numpy.around', 'np.around', (['(base_anchors * target_shape[::-1] / base_shape[::-1])'], {}), '(base_anchors * target_shape[::-1] / base_shape[::-1])\n', (1928, 1982), True, 'import numpy as np\n'), ((2790, 2811), 'numpy.random.seed', 'np.random.seed', (['(10101)'], {}), '(10101)\n', (2804, 2811), True...
PhilippHafe/CarND-Capstone
ros/src/tl_detector/light_classification/tl_classifier.py
9f933c817b11e7a093c3f2b07fad10710f7eb551
from styx_msgs.msg import TrafficLight import tensorflow as tf import numpy as np import datetime class TLClassifier(object): def __init__(self): PATH_TO_CKPT = "light_classification/frozen_inference_graph.pb" self.graph = tf.Graph() self.threshold = 0.5 with self.graph.as_default(...
[]
ctralie/SiRPyGL
testGMDS.py
e06c317ed60321d492725e39fd8fcc0ce56ff4c0
#Based off of http://wiki.wxpython.org/GLCanvas #Lots of help from http://wiki.wxpython.org/Getting%20Started from OpenGL.GL import * import wx from wx import glcanvas from Primitives3D import * from PolyMesh import * from LaplacianMesh import * from Geodesics import * from PointCloud import * from Cameras3D import * ...
[]
manpan-1/PySS
PySS/fem.py
1e4b13de3b2aed13ecf9818f9084a2fedb295cf1
import matplotlib.pyplot as plt import numpy as np import pickle # import csv # from collections import namedtuple # from mpl_toolkits.mplot3d import Axes3D # import matplotlib.animation as animation # import matplotlib.colors as mc class FEModel: def __init__(self, name=None, hist_data=None): self.name =...
[((9287, 9317), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(2)', 'ncols': '(3)'}), '(nrows=2, ncols=3)\n', (9299, 9317), True, 'import matplotlib.pyplot as plt\n'), ((9955, 9985), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(2)', 'ncols': '(3)'}), '(nrows=2, ncols=3)\n', (9967, 9985...
gigamonkey/sheets
gigamonkeys/get.py
a89e76360ad9a35e44e5e352346eeccbe6952b1f
#!/usr/bin/env python import json import sys from gigamonkeys.spreadsheets import spreadsheets spreadsheet_id = sys.argv[1] ranges = sys.argv[2:] data = spreadsheets().get(spreadsheet_id, include_grid_data=bool(ranges), ranges=ranges) json.dump(data, sys.stdout, indent=2)
[((240, 277), 'json.dump', 'json.dump', (['data', 'sys.stdout'], {'indent': '(2)'}), '(data, sys.stdout, indent=2)\n', (249, 277), False, 'import json\n'), ((157, 171), 'gigamonkeys.spreadsheets.spreadsheets', 'spreadsheets', ([], {}), '()\n', (169, 171), False, 'from gigamonkeys.spreadsheets import spreadsheets\n')]
mhmddpkts/Get-Turkish-Words-with-Web-Scraping
config.py
6e344640f6dc512f03a9b59522876ce7b6339a86
root_URL = "https://tr.wiktionary.org/wiki/Vikis%C3%B6zl%C3%BCk:S%C3%B6zc%C3%BCk_listesi_" filepath = "words.csv" #letters=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O", # "P","R","S","T","U","V","Y","Z"] ##İ,Ç,Ö,Ş,Ü harfleri not work correctly letters=["C"]
[]
praekelt/sow-generator
sow_generator/tasks.py
eb5dab3b3231688966254a1797ced7eec67b6e8a
from github3 import login from github3.models import GitHubError from celery import task from celery.decorators import periodic_task from celery.task.schedules import crontab from sow_generator.models import Repository, AuthToken def _sync_repository(obj): dirty = False token = AuthToken.objects.get(id=1).to...
[((1060, 1079), 'celery.task', 'task', ([], {'max_retries': '(5)'}), '(max_retries=5)\n', (1064, 1079), False, 'from celery import task\n'), ((333, 351), 'github3.login', 'login', ([], {'token': 'token'}), '(token=token)\n', (338, 351), False, 'from github3 import login\n'), ((1115, 1144), 'sow_generator.models.Reposit...
X-rayLaser/keras-auto-hwr
sources/wrappers.py
67cfc0209045b1e211f0491b0199cb9d6811bfd0
import numpy as np from sources import BaseSource from sources.base import BaseSourceWrapper from sources.preloaded import PreLoadedSource import json class WordsSource(BaseSource): def __init__(self, source): self._source = source def __len__(self): return len(self._source) def _remove_...
[((2030, 2043), 'json.loads', 'json.loads', (['s'], {}), '(s)\n', (2040, 2043), False, 'import json\n'), ((2091, 2108), 'numpy.array', 'np.array', (["d['mu']"], {}), "(d['mu'])\n", (2099, 2108), True, 'import numpy as np\n'), ((2122, 2139), 'numpy.array', 'np.array', (["d['sd']"], {}), "(d['sd'])\n", (2130, 2139), True...
yufeiwang63/ROLL
multiworld/multiworld/core/image_env.py
aba0b4530934946eb9c41fbe5a0d6c27775596ff
import random import cv2 import numpy as np import warnings from PIL import Image from gym.spaces import Box, Dict from multiworld.core.multitask_env import MultitaskEnv from multiworld.core.wrapper_env import ProxyEnv from multiworld.envs.env_util import concatenate_box_spaces from multiworld.envs.env_util import ge...
[((10932, 10955), 'numpy.uint8', 'np.uint8', (['(image * 255.0)'], {}), '(image * 255.0)\n', (10940, 10955), True, 'import numpy as np\n'), ((2759, 2808), 'gym.spaces.Box', 'Box', (['(0)', '(1)', '(self.image_length,)'], {'dtype': 'np.float32'}), '(0, 1, (self.image_length,), dtype=np.float32)\n', (2762, 2808), False, ...
huynguyen82/Modified-Kaldi-GStream-OnlineServer
sample_full_post_processor.py
e7429a5e44b9567b603523c0046fb42d8503a275
#!/usr/bin/env python import sys import json import logging from math import exp import requests as rq import re ### For NLP post-processing header={"Content-Type": "application/json"} message='{"sample":"Hello bigdata"}' api_url="http://192.168.1.197:11992/norm" ### def NLP_process_output(pre_str): try: ...
[]
AlexMikhalev/cord19redisknowledgegraph
lang_detect_gears.py
a143415aca8d4a6db820dc7a25280045f421a665
from langdetect import detect def detect_language(x): #detect language of the article try: lang=detect(x['value']) except: lang="empty" execute('SET', 'lang_article:' + x['key'], lang) if lang!='en': execute('SADD','titles_to_delete', x['key']) gb = GB() gb.foreach(detec...
[((116, 134), 'langdetect.detect', 'detect', (["x['value']"], {}), "(x['value'])\n", (122, 134), False, 'from langdetect import detect\n')]
shanv82/core
daemon/core/coreobj.py
70abb8cc1426ffceb53a03e84edc26f56f9ed4c0
""" Defines the basic objects for CORE emulation: the PyCoreObj base class, along with PyCoreNode, PyCoreNet, and PyCoreNetIf. """ import os import shutil import socket import threading from socket import AF_INET from socket import AF_INET6 from core.data import NodeData, LinkData from core.enumerations import LinkTy...
[((5487, 5814), 'core.data.NodeData', 'NodeData', ([], {'message_type': 'message_type', 'id': 'self.objid', 'node_type': 'self.apitype', 'name': 'self.name', 'emulation_id': 'self.objid', 'canvas': 'self.canvas', 'icon': 'self.icon', 'opaque': 'self.opaque', 'x_position': 'x', 'y_position': 'y', 'latitude': 'lat', 'lon...
wotsushi/competitive-programming
abc/128/b.py
17ec8fd5e1c23aee626aee70b1c0da8d7f8b8c86
# 入力 N = int(input()) S, P = ( zip(*( (s, int(p)) for s, p in (input().split() for _ in range(N)) )) if N else ((), ()) ) ans = '\n'.join( str(i) for _, _, i in sorted( zip( S, P, range(1, N + 1) ), key=lambda t: (t[0], -t[...
[]
mmmds/WirelessDiscoverCrackScan
additional/hashcat_crack.py
2eda9bd7c474d91ea08511a7322f5ba14d034f3d
# External cracking script, part of https://github.com/mmmds/WirelessDiscoverCrackScan import datetime import subprocess import os ### CONFIGURATION HASHCAT_DIR = "C:\\hashcat-5.1.0" HASHCAT_EXE = "hashcat64.exe" LOG_FILE = "crack_log.txt" DICT_DIR = "./dicts" def load_dict_list(): for r,d,f in os.walk(DICT_DIR)...
[((303, 320), 'os.walk', 'os.walk', (['DICT_DIR'], {}), '(DICT_DIR)\n', (310, 320), False, 'import os\n'), ((946, 961), 'os.listdir', 'os.listdir', (['"""."""'], {}), "('.')\n", (956, 961), False, 'import os\n'), ((786, 809), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (807, 809), False, 'import...
bennettdc/MCEdit-Unified
editortools/player.py
90abfb170c65b877ac67193e717fa3a3ded635dd
"""Copyright (c) 2010-2012 David Rio Vierra Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA...
[]
slimgroup/Devito-Examples
seismic/checkpointing/checkpoint.py
449e1286a18ebc4172069372ba2bf3cd2ec99a2f
# The MIT License (MIT) # # Copyright (c) 2016, Imperial College, London # # 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 t...
[]
shyba/lbry
lbrynet/file_manager/EncryptedFileManager.py
ab3278c50a8b7b5a8e9486a1c52be3d5e0c18297
""" Keep track of which LBRY Files are downloading and store their LBRY File specific metadata """ import logging import os from twisted.enterprise import adbapi from twisted.internet import defer, task, reactor from twisted.python.failure import Failure from lbrynet.reflector.reupload import reflect_stream from lbr...
[((893, 920), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (910, 920), False, 'import logging\n'), ((1836, 1877), 'twisted.internet.task.LoopingCall', 'task.LoopingCall', (['self.reflect_lbry_files'], {}), '(self.reflect_lbry_files)\n', (1852, 1877), False, 'from twisted.internet import...
TomMinor/MayaPerforce
Perforce/AppUtils.py
52182c7e5c3e91e41973d0c2abbda8880e809e49
import os import sys import re import logging p4_logger = logging.getLogger("Perforce") # Import app specific utilities, maya opens scenes differently than nuke etc # Are we in maya or nuke? if re.match( "maya", os.path.basename( sys.executable ), re.I ): p4_logger.info("Configuring for Maya") from MayaU...
[((64, 93), 'logging.getLogger', 'logging.getLogger', (['"""Perforce"""'], {}), "('Perforce')\n", (81, 93), False, 'import logging\n'), ((223, 255), 'os.path.basename', 'os.path.basename', (['sys.executable'], {}), '(sys.executable)\n', (239, 255), False, 'import os\n'), ((358, 390), 'os.path.basename', 'os.path.basena...
kourtneyshort/healthcare
fhir/immunizations_demo/models/trainer/model.py
1d1e2375304ac99f43a8b6aee7374fcdf641eb6f
#!/usr/bin/python3 # # 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 a...
[((1246, 1362), 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (['"""training_data"""'], {'default': 'None', 'help': '"""Path to training data. This should be a GCS path."""'}), "('training_data', default=None, help=\n 'Path to training data. This should be a GCS path.')\n", (1268, 1362), True, 'import ...
thecodeteam/heliosburn
heliosburn/django/hbproject/webui/models.py
513f6335c9788948d82e5c9285d7869f3ff4cc10
import json import re from django.conf import settings import requests from webui.exceptions import BadRequestException, UnauthorizedException, ServerErrorException, RedirectException, \ UnexpectedException, LocationHeaderNotFoundException, NotFoundException def validate_response(response): if 200 <= response...
[((758, 779), 'webui.exceptions.UnexpectedException', 'UnexpectedException', ([], {}), '()\n', (777, 779), False, 'from webui.exceptions import BadRequestException, UnauthorizedException, ServerErrorException, RedirectException, UnexpectedException, LocationHeaderNotFoundException, NotFoundException\n'), ((1132, 1151),...
sushilkar/ychaos
src/ychaos/core/verification/controller.py
6801390f0faf553789e3384440a72a0705310738
# Copyright 2021, Yahoo # Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms import time from typing import Dict, List, Optional, Type from pydantic import validate_arguments from ...app_logger import AppLogger from ...testplan import SystemState from ...testplan....
[((5805, 5849), 'time.sleep', 'time.sleep', (['verification_plugin.delay_before'], {}), '(verification_plugin.delay_before)\n', (5815, 5849), False, 'import time\n'), ((7571, 7614), 'time.sleep', 'time.sleep', (['verification_plugin.delay_after'], {}), '(verification_plugin.delay_after)\n', (7581, 7614), False, 'import...
binary-signal/vimeo-channel-downloader
tests/test_vimeodl.py
7c2ded9d07b2b698f4e52558ba7dc327c2827b6c
#!/usr/bin/env python # -*- coding: utf-8 -*- from vimeodl import __version__ from vimeodl.vimeo import VimeoLinkExtractor, VimeoDownloader def test_version(): assert __version__ == '0.1.0' def test_vimeo_link_extractor(): vm = VimeoLinkExtractor() vm.extract()
[((239, 259), 'vimeodl.vimeo.VimeoLinkExtractor', 'VimeoLinkExtractor', ([], {}), '()\n', (257, 259), False, 'from vimeodl.vimeo import VimeoLinkExtractor, VimeoDownloader\n')]
Yunusbcr/labgraph
labgraph/graphs/node_test_harness.py
a00ae7098b7b0e0eda8ce2e7e62dae86854616fb
#!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. import asyncio import functools import inspect from contextlib import contextmanager from typing import ( Any, AsyncIterable, Awaitable, Callable, Generic, Iterator, List, Mapping, Optional, Sequence,...
[((605, 629), 'typing.TypeVar', 'TypeVar', (['"""N"""'], {'bound': 'Node'}), "('N', bound=Node)\n", (612, 629), False, 'from typing import Any, AsyncIterable, Awaitable, Callable, Generic, Iterator, List, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union, overload\n'), ((647, 688), 'typing.TypeVar', 'TypeVar', (...
edward70/2021Computing
pygamelearning/lrud.py
df8fb818480a6e23f2eac736744294871ec0e38c
import pygame import sys pygame.init() clock = pygame.time.Clock() screen = pygame.display.set_mode([500, 500]) gameOn = True x1 = 0 y1 = 100 x2 = 100 y2 = 0 while gameOn == True: screen.fill([255,255,255]) for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() ...
[((26, 39), 'pygame.init', 'pygame.init', ([], {}), '()\n', (37, 39), False, 'import pygame\n'), ((48, 67), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (65, 67), False, 'import pygame\n'), ((78, 113), 'pygame.display.set_mode', 'pygame.display.set_mode', (['[500, 500]'], {}), '([500, 500])\n', (101, 113...
e93fem/PyTorchNLPBook
pytorch/xor/training_a_perceptron.py
c9ea9e0b3d1b8bba6a983b425c6c03dd79d3d6b0
import numpy as np import torch import matplotlib.pyplot as plt from torch import optim, nn from pytorch.xor.multilayer_perceptron import MultilayerPerceptron from pytorch.xor.utils import LABELS, get_toy_data, visualize_results, plot_intermediate_representations input_size = 2 output_size = len(set(LABELS)) num_hidd...
[((401, 424), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (418, 424), False, 'import torch\n'), ((425, 457), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_all', (['seed'], {}), '(seed)\n', (451, 457), False, 'import torch\n'), ((458, 478), 'numpy.random.seed', 'np.random.seed', (['seed...
raccoongang/socraticqs2
mysite/api/v0/tests.py
06201005136ee139846f857dbb2f518736e441de
import json import mock from django.core.urlresolvers import reverse from pymongo.errors import ServerSelectionTimeoutError from analytics.models import CourseReport from core.common.mongo import c_onboarding_status, _conn from core.common import onboarding from ct.models import UnitLesson, StudentError from ctms.t...
[((358, 388), 'django.core.urlresolvers.reverse', 'reverse', (['"""api:v0:health-check"""'], {}), "('api:v0:health-check')\n", (365, 388), False, 'from django.core.urlresolvers import reverse\n'), ((1015, 1044), 'pymongo.errors.ServerSelectionTimeoutError', 'ServerSelectionTimeoutError', ([], {}), '()\n', (1042, 1044),...
anthonymark33/Global-signbank
signbank/settings/base.py
ae61984a24f1cc0801d4621c81b882154ce99098
# Django settings for signbank project. import os from signbank.settings.server_specific import * from datetime import datetime DEBUG = True PROJECT_DIR = os.path.dirname(BASE_DIR) MANAGERS = ADMINS TIME_ZONE = 'Europe/Amsterdam' LOCALE_PATHS = [BASE_DIR+'conf/locale'] # in the database, SITE_ID 1 is example.com ...
[((157, 182), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (172, 182), False, 'import os\n'), ((7855, 7900), 'mimetypes.add_type', 'mimetypes.add_type', (['"""video/mp4"""', '""".mov"""', '(True)'], {}), "('video/mp4', '.mov', True)\n", (7873, 7900), False, 'import mimetypes\n'), ((8647, 86...
crombus/ocs-ci
ocs_ci/ocs/cluster.py
20340365882bdd06ddb6cd65bbd7df0ba7e2c2d8
""" A module for all rook functionalities and abstractions. This module has rook related classes, support for functionalities to work with rook cluster. This works with assumptions that an OCP cluster is already functional and proper configurations are made for interaction. """ import base64 import logging import ran...
[((1007, 1034), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1024, 1034), False, 'import logging\n'), ((15240, 15297), 'ocs_ci.utility.retry.retry', 'retry', (['UnexpectedBehaviour'], {'tries': '(20)', 'delay': '(10)', 'backoff': '(1)'}), '(UnexpectedBehaviour, tries=20, delay=10, back...
techthiyanes/scenic
scenic/projects/baselines/detr/configs/detr_config.py
05585b1189364e29d82413b9d4a50ffa8c246f0c
# pylint: disable=line-too-long r"""Default configs for COCO detection using DETR. """ # pylint: enable=line-too-long import copy import ml_collections _COCO_TRAIN_SIZE = 118287 NUM_EPOCHS = 300 def get_config(): """Returns the configuration for COCO detection using DETR.""" config = ml_collections.ConfigDict()...
[((293, 320), 'ml_collections.ConfigDict', 'ml_collections.ConfigDict', ([], {}), '()\n', (318, 320), False, 'import ml_collections\n'), ((457, 484), 'ml_collections.ConfigDict', 'ml_collections.ConfigDict', ([], {}), '()\n', (482, 484), False, 'import ml_collections\n'), ((1526, 1553), 'ml_collections.ConfigDict', 'ml...
artembashlak/share-youtube-to-mail
tests/conftest.py
347f72ed8846b85cae8e4f39896ab54e698a6de9
import pytest from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager @pytest.fixture(scope="function") def browser(): options = webdriver.ChromeOptions() options.add_argument('ignore-certificate-errors') options.add_argument("--headless") options.add_argument('--no-san...
[((105, 137), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (119, 137), False, 'import pytest\n'), ((167, 192), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (190, 192), False, 'from selenium import webdriver\n'), ((496, 517), 'webdrive...
lab-medvedeva/SCABFA-feature-selection
prepare_cicero_peaks.py
d5cd7568e667a75f75e753d9ab9dc645f3166902
from scale.dataset import read_mtx from argparse import ArgumentParser import pandas as pd import numpy as np import os def parse_args(): parser = ArgumentParser('Preparing raw peaks from cicero pipeline') parser.add_argument('--dataset_path', help='Path to Scale dataset: count, feature, barcode folder') ...
[((155, 213), 'argparse.ArgumentParser', 'ArgumentParser', (['"""Preparing raw peaks from cicero pipeline"""'], {}), "('Preparing raw peaks from cicero pipeline')\n", (169, 213), False, 'from argparse import ArgumentParser\n'), ((696, 747), 'pandas.read_csv', 'pd.read_csv', (['args.label_path'], {'sep': '"""\t"""', 'he...
CSIRT-MU/CRUSOE
crusoe_observe/neo4j-client/neo4jclient/CMSClient.py
73e4ac0ced6c3ac46d24ac5c3feb01a1e88bd36b
from neo4jclient.AbsClient import AbstractClient class CMSClient(AbstractClient): def __init__(self, password, **kwargs): super().__init__(password=password, **kwargs) def get_domain_names(self): """ Gets all domain names from database. :return: domain names in JSON-like form...
[]
jonasjucker/wildlife-telegram
location.py
5fb548d3779782467247cf5d1e165d1c2349de30
import time from datetime import date,datetime from astral import LocationInfo from astral.sun import sun class CamLocation: def __init__(self,lat,lon,info,country,timezone): self.info = LocationInfo(info, country, timezone, lat, lon) def is_night(self): s = sun(self.info.observer, date=date.t...
[((200, 247), 'astral.LocationInfo', 'LocationInfo', (['info', 'country', 'timezone', 'lat', 'lon'], {}), '(info, country, timezone, lat, lon)\n', (212, 247), False, 'from astral import LocationInfo\n'), ((314, 326), 'datetime.date.today', 'date.today', ([], {}), '()\n', (324, 326), False, 'from datetime import date, d...
ch1huizong/learning
lang/py/cookbook/v2/source/cb2_20_9_exm_1.py
632267634a9fd84a5f5116de09ff1e2681a6cc85
class Skidoo(object): ''' a mapping which claims to contain all keys, each with a value of 23; item setting and deletion are no-ops; you can also call an instance with arbitrary positional args, result is 23. ''' __metaclass__ = MetaInterfaceChecker __implements__ = IMinimalMapping, ICallabl...
[]
davidleonfdez/face2anime
face2anime/nb_utils.py
896bf85a7aa28322cc9e9e586685db8cbbf39d89
import importlib __all__ = ['mount_gdrive'] def mount_gdrive() -> str: """Mount Google Drive storage of the current Google account and return the root path. Functionality only available in Google Colab Enviroment; otherwise, it raises a RuntimeError. """ if (importlib.util.find_spec("google.colab")...
[((452, 502), 'google.colab.drive.mount', 'drive.mount', (['"""/content/gdrive"""'], {'force_remount': '(True)'}), "('/content/gdrive', force_remount=True)\n", (463, 502), False, 'from google.colab import drive\n'), ((280, 320), 'importlib.util.find_spec', 'importlib.util.find_spec', (['"""google.colab"""'], {}), "('go...
waschag-tvk/pywaschedv
wasch/tests.py
8f0428827c4c1c7e9462eaa94ba02290db1c340f
import datetime from django.utils import timezone from django.test import TestCase from django.contrib.auth.models import ( User, ) from wasch.models import ( Appointment, WashUser, WashParameters, # not models: AppointmentError, StatusRights, ) from wasch import tvkutils, payment class Wa...
[((387, 423), 'wasch.models.WashUser.objects.get_or_create_god', 'WashUser.objects.get_or_create_god', ([], {}), '()\n', (421, 423), False, 'from wasch.models import Appointment, WashUser, WashParameters, AppointmentError, StatusRights\n'), ((861, 910), 'wasch.models.Appointment.manager.scheduled_appointment_times', 'A...
1050669722/LeetCode-Answers
Python/problem1150.py
c8f4d1ccaac09cda63b60d75144335347b06dc81
from typing import List from collections import Counter # class Solution: # def isMajorityElement(self, nums: List[int], target: int) -> bool: # d = Counter(nums) # return d[target] > len(nums)//2 # class Solution: # def isMajorityElement(self, nums: List[int], target: int) -> bool: # ...
[]
arcadecoffee/advent-2021
day17/module.py
57d24cd6ba6e2b4d7e68ea492b955b73eaad7b6a
""" Advent of Code 2021 - Day 17 https://adventofcode.com/2021/day/17 """ import re from math import ceil, sqrt from typing import List, Tuple DAY = 17 FULL_INPUT_FILE = f'../inputs/day{DAY:02d}/input.full.txt' TEST_INPUT_FILE = f'../inputs/day{DAY:02d}/input.test.txt' def load_data(infile_path: str) -> Tuple[int,...
[((1183, 1199), 'math.sqrt', 'sqrt', (['(x1 * 8 + 1)'], {}), '(x1 * 8 + 1)\n', (1187, 1199), False, 'from math import ceil, sqrt\n')]
stefano-bragaglia/DePYsible
src/main/python/depysible/domain/rete.py
6b53ede459a10f5e24da89d3ebaa05f08ec7af12
from typing import List from typing import Optional from typing import Tuple from typing import Union Payload = Tuple[List['Literal'], 'Substitutions'] class Root: def __init__(self): self.children = set() def notify(self, ground: 'Literal'): for child in self.children: child.not...
[((3329, 3362), 'depysible.domain.definitions.Rule', 'Rule', (['lit', 'self.rule.type', 'ground'], {}), '(lit, self.rule.type, ground)\n', (3333, 3362), False, 'from depysible.domain.definitions import Rule\n')]
jeffreyzli/pokerbot-2017
pythonbot_1.0/GameData.py
df2aa31d6aaf0e3162d24ae5f4c2a918ab19831f
import HandRankings as Hand from deuces.deuces import Card, Evaluator class GameData: def __init__(self, name, opponent_name, stack_size, bb): # match stats self.name = name self.opponent_name = opponent_name self.starting_stack_size = int(stack_size) self.num_hands = 0 ...
[((2278, 2315), 'HandRankings.hand_win_odds', 'Hand.hand_win_odds', (['self.current_hand'], {}), '(self.current_hand)\n', (2296, 2315), True, 'import HandRankings as Hand\n'), ((5028, 5048), 'deuces.deuces.Card.new', 'Card.new', (['board_card'], {}), '(board_card)\n', (5036, 5048), False, 'from deuces.deuces import Car...
zyayoung/share-todo
todo/models.py
84813545f9aa3e89441c560e64e85bc799835d30
from django.db import models from django.contrib.auth.models import User from django.utils import timezone class Todo(models.Model): time_add = models.DateTimeField(auto_now_add=True) title = models.CharField(max_length=64) detail = models.TextField(blank=True) deadline = models.DateTimeField(blank=Tr...
[((150, 189), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (170, 189), False, 'from django.db import models\n'), ((202, 233), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(64)'}), '(max_length=64)\n', (218, 233), False, 'f...
DrewLazzeriKitware/trame
examples/Tutorial/Example/app.py
fdc73f07f17d2601e1b1d3934d2d6326a3c0281e
import os from trame import change, update_state from trame.layouts import SinglePageWithDrawer from trame.html import vtk, vuetify, widgets from vtkmodules.vtkCommonDataModel import vtkDataObject from vtkmodules.vtkFiltersCore import vtkContourFilter from vtkmodules.vtkIOXML import vtkXMLUnstructuredGridReader from ...
[((1453, 1466), 'vtkmodules.vtkRenderingCore.vtkRenderer', 'vtkRenderer', ([], {}), '()\n', (1464, 1466), False, 'from vtkmodules.vtkRenderingCore import vtkActor, vtkDataSetMapper, vtkRenderer, vtkRenderWindow, vtkRenderWindowInteractor\n'), ((1482, 1499), 'vtkmodules.vtkRenderingCore.vtkRenderWindow', 'vtkRenderWindo...
AleBurzio11/webots_ros2
webots_ros2_tutorials/webots_ros2_tutorials/master.py
99fa4a1a9d467e4ba71eff17ddf4e82444c78938
# Copyright 1996-2021 Soft_illusion. # # 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 w...
[((2699, 2720), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (2709, 2720), False, 'import rclpy\n'), ((2750, 2764), 'rclpy.spin', 'rclpy.spin', (['ls'], {}), '(ls)\n', (2760, 2764), False, 'import rclpy\n'), ((2792, 2808), 'rclpy.shutdown', 'rclpy.shutdown', ([], {}), '()\n', (2806, 2808), False...
arrowkato/pytest-CircleiCI
dev-template/src/mysql_connect_sample.py
2f6a1460a48bf88547538cfc72880a9c86f9ec23
import mysql.connector from mysql.connector import errorcode config = { 'user': 'user', 'password': 'password', 'host': 'mysql_container', 'database': 'sample_db', 'port': '3306', } if __name__ == "__main__": try: conn = mysql.connector.connect(**config) cursor = conn.cursor() ...
[]
viniciusbonito/CeV-Python-Exercicios
Mundo 1/ex011.py
6182421332f6f0c0a567c3e125fdc05736fa6281
# criar um programa que pergunte as dimensões de uma parede, calcule sua área e informe quantos litros de tinta # seriam necessários para a pintura, após perguntar o rendimento da tinta informado na lata print('=' * 40) print('{:^40}'.format('Assistente de pintura')) print('=' * 40) altura = float(input('Informe a al...
[]
henrique-tavares/Coisas
Python/Mundo 3/ex088.py
f740518b1bedec5b0ea8c12ae07a2cac21eb51ae
from random import sample from time import sleep jogos = list() print('-' * 20) print(f'{"MEGA SENA":^20}') print('-' * 20) while True: n = int(input("\nQuatos jogos você quer que eu sorteie? ")) if (n > 0): break print('\n[ERRO] Valor fora do intervalo') print() print('-=' * 3, e...
[((458, 468), 'time.sleep', 'sleep', (['(0.6)'], {}), '(0.6)\n', (463, 468), False, 'from time import sleep\n')]
django-roles-access/master
tests/test_utils.py
066d0d6b99b986eacc736e6973b415cbb9172d46
from importlib import import_module from unittest import TestCase as UnitTestCase from django.contrib.auth.models import Group from django.core.management import BaseCommand from django.conf import settings from django.test import TestCase from django.views.generic import TemplateView try: from unittest.mock impor...
[((16946, 16991), 'mock.patch', 'patch', (['"""django_roles_access.utils.ViewAccess"""'], {}), "('django_roles_access.utils.ViewAccess')\n", (16951, 16991), False, 'from mock import Mock, patch\n'), ((19821, 19874), 'mock.patch', 'patch', (['"""django_roles_access.utils.ViewAccess.objects"""'], {}), "('django_roles_acc...
jasondavis/FavoriteFiles
favorite_files.py
be088259ac36383399eebe85d8d5b35e235d25b0
''' Favorite Files Licensed under MIT Copyright (c) 2012 Isaac Muse <isaacmuse@gmail.com> ''' import sublime import sublime_plugin from os.path import join, exists, normpath from favorites import Favorites Favs = Favorites(join(sublime.packages_path(), 'User', 'favorite_files_list.json')) class Refresh: dummy_f...
[((230, 253), 'sublime.packages_path', 'sublime.packages_path', ([], {}), '()\n', (251, 253), False, 'import sublime\n'), ((340, 363), 'sublime.packages_path', 'sublime.packages_path', ([], {}), '()\n', (361, 363), False, 'import sublime\n'), ((4138, 4168), 'sublime.error_message', 'sublime.error_message', (['message']...
ktok07b6/polyphony
tests/list/list03.py
657c5c7440520db6b4985970bd50547407693ac4
from polyphony import testbench def list03(x, y, z): a = [1, 2, 3] r0 = x r1 = y a[r0] = a[r1] + z return a[r0] @testbench def test(): assert 4 == list03(0, 1 ,2) assert 5 == list03(2, 1 ,3) test()
[]
paskausks/sc2cm
sc2clanman/views.py
9c80e581933531496333d4a54c40174d4fb583a5
#!/bin/env python3 from collections import Counter from django.conf import settings from django.contrib.auth.decorators import login_required, permission_required from django.db import models as dm from django.shortcuts import get_object_or_404, render from django.views.generic.list import BaseListView from django.vie...
[((1130, 1162), 'django.utils.decorators.method_decorator', 'method_decorator', (['login_required'], {}), '(login_required)\n', (1146, 1162), False, 'from django.utils.decorators import method_decorator\n'), ((2278, 2292), 'django.db.models.Sum', 'dm.Sum', (['"""wins"""'], {}), "('wins')\n", (2284, 2292), True, 'from d...
parmentelat/manim
manimlib/mobject/functions.py
f05f94fbf51c70591bed3092587a5db0de439738
from manimlib.constants import * from manimlib.mobject.types.vectorized_mobject import VMobject from manimlib.utils.config_ops import digest_config from manimlib.utils.space_ops import get_norm class ParametricCurve(VMobject): CONFIG = { "t_range": [0, 1, 0.1], "min_samples": 10, "epsilon"...
[((514, 541), 'manimlib.utils.config_ops.digest_config', 'digest_config', (['self', 'kwargs'], {}), '(self, kwargs)\n', (527, 541), False, 'from manimlib.utils.config_ops import digest_config\n'), ((941, 974), 'manimlib.mobject.types.vectorized_mobject.VMobject.__init__', 'VMobject.__init__', (['self'], {}), '(self, **...
doudoudzj/ecsmate
lib/ecsmate/ecs.py
dda508a64ef9d6979dcc83377bb007d2a0acec30
#-*- coding: utf-8 -*- # # Copyright (c) 2012, ECSMate development team # All rights reserved. # # ECSMate is distributed under the terms of the (new) BSD License. # The full license can be found in 'LICENSE.txt'. """ECS SDK """ import time import hmac import base64 import hashlib import urllib import...
[]
mail2nsrajesh/tacker
tacker/api/v1/resource.py
dce6690659836c2885f1cf8227c19be234f8fe25
# Copyright 2012 OpenStack Foundation. # 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 req...
[((818, 845), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (835, 845), True, 'from oslo_log import log as logging\n'), ((1152, 1175), 'tacker.wsgi.JSONDeserializer', 'wsgi.JSONDeserializer', ([], {}), '()\n', (1173, 1175), False, 'from tacker import wsgi\n'), ((1224, 1249), 'tacker...
GitHubEmploy/akinator.py
akinator/utils.py
67c688b0332f4caa72bacc8fbc8f95abfe2290c9
""" MIT License Copyright (c) 2019 NinjaSnail1080 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...
[]
movinalot/ucs
ucs-python/create_ucs_sp_template.py
dc0d37784592d6d78f46efee40c86b6f7ac928b4
""" create_ucs_sp_template.py Purpose: UCS Manager Create a UCS Service Profile Template Author: John McDonough (jomcdono@cisco.com) github: (@movinalot) Cisco Systems, Inc. """ from ucsmsdk.ucshandle import UcsHandle from ucsmsdk.mometa.ls.LsServer import LsServer from ucsmsdk.mometa.org.OrgOrg import Or...
[((335, 392), 'ucsmsdk.ucshandle.UcsHandle', 'UcsHandle', (['"""sandbox-ucsm1.cisco.com"""', '"""admin"""', '"""password"""'], {}), "('sandbox-ucsm1.cisco.com', 'admin', 'password')\n", (344, 392), False, 'from ucsmsdk.ucshandle import UcsHandle\n'), ((434, 483), 'ucsmsdk.mometa.org.OrgOrg.OrgOrg', 'OrgOrg', ([], {'par...
132nd-etcher/epab
epab/core/config.py
5226d3a36580f8cc50cf5dcac426adb1350a2c9b
# coding=utf-8 """ Handles EPAB's config file """ import logging import pathlib import elib_config CHANGELOG_DISABLE = elib_config.ConfigValueBool( 'changelog', 'disable', description='Disable changelog building', default=False ) CHANGELOG_FILE_PATH = elib_config.ConfigValuePath( 'changelog', 'file_path', de...
[((122, 235), 'elib_config.ConfigValueBool', 'elib_config.ConfigValueBool', (['"""changelog"""', '"""disable"""'], {'description': '"""Disable changelog building"""', 'default': '(False)'}), "('changelog', 'disable', description=\n 'Disable changelog building', default=False)\n", (149, 235), False, 'import elib_conf...
Creativity-Hub/create_flask_app
create_flask_app.py
4c4e2c7360c7773f6f5e3d2fd30e310777650f57
import os import argparse def check_for_pkg(pkg): try: exec("import " + pkg) except: os.system("pip3 install --user " + pkg) def create_flask_app(app='flask_app', threading=False, wsgiserver=False, unwanted_warnings=False, logging=False, further_logging=False, site_endpoints=None, endpoints=None, request_endpoi...
[((1819, 1870), 'os.system', 'os.system', (["('touch ' + project + '/static/style.css')"], {}), "('touch ' + project + '/static/style.css')\n", (1828, 1870), False, 'import os\n'), ((1868, 1919), 'os.system', 'os.system', (["('touch ' + project + '/static/script.js')"], {}), "('touch ' + project + '/static/script.js')\...
Flared/flask-sqlalchemy
examples/flaskr/flaskr/__init__.py
e73abd51d957a4436bca6b5eadbf5d63771cf5ef
import os import click from flask import Flask from flask.cli import with_appcontext from flask_sqlalchemy import SQLAlchemy __version__ = (1, 0, 0, "dev") db = SQLAlchemy() def create_app(test_config=None): """Create and configure an instance of the Flask application.""" app = Flask(__name__, instance_rel...
[((164, 176), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (174, 176), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((1659, 1683), 'click.command', 'click.command', (['"""init-db"""'], {}), "('init-db')\n", (1672, 1683), False, 'import click\n'), ((292, 338), 'flask.Flask', 'Flask', (['__name_...
mcfx/trivm
simulator/cc.py
5b77ea157c562cfbfe87f7e7d256fb9702f8ceec
import os, sys fn = sys.argv[1] if os.system('python compile.py %s __tmp.S' % fn) == 0: os.system('python asm.py __tmp.S %s' % fn[:-2])
[((37, 83), 'os.system', 'os.system', (["('python compile.py %s __tmp.S' % fn)"], {}), "('python compile.py %s __tmp.S' % fn)\n", (46, 83), False, 'import os, sys\n'), ((94, 141), 'os.system', 'os.system', (["('python asm.py __tmp.S %s' % fn[:-2])"], {}), "('python asm.py __tmp.S %s' % fn[:-2])\n", (103, 141), False, '...
ariadnepinheiro/Disease_Simulator
ad2/Actor.py
e875036f4b0485575327463a17f4282487350cb3
#!/usr/bin/env python # coding: UTF-8 # # @package Actor # @author Ariadne Pinheiro # @date 26/08/2020 # # Actor class, which is the base class for Disease objects. # ## class Actor: # Holds the value of the next "free" id. __ID = 0 ## # Construct a new Actor object. # - Sets the initial values of...
[]
smukk9/Python
conversions/decimal_to_binary.py
5f4da5d616926dbe77ece828986b8d19c7d65cb5
"""Convert a Decimal Number to a Binary Number.""" def decimal_to_binary(num: int) -> str: """ Convert a Integer Decimal Number to a Binary Number as str. >>> decimal_to_binary(0) '0b0' >>> decimal_to_binary(2) '0b10' >>> decimal_to_binary(7) '0b111' ...
[((1498, 1515), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (1513, 1515), False, 'import doctest\n')]
xausky/hand-network
src/HandNetwork.py
e885003c5bb9157cd06dc3ea3aabddbb7162a0ab
#!/usr/bin/python3 #-*- coding: utf-8 -*- import urllib.parse import json import base64 import requests import logging class Network(): LOGIN_URL = 'http://192.168.211.101/portal/pws?t=li' BEAT_URL = 'http://192.168.211.101/portal/page/doHeartBeat.jsp' COMMON_HERADERS = { 'Accept-Language': 'en-US', ...
[((554, 590), 'logging.info', 'logging.info', (["('login:%s' % self.data)"], {}), "('login:%s' % self.data)\n", (566, 590), False, 'import logging\n'), ((610, 707), 'requests.post', 'requests.post', (['Network.LOGIN_URL'], {'data': 'self.data', 'headers': 'Network.COMMON_HERADERS', 'timeout': '(3)'}), '(Network.LOGIN_U...
Fongeme/algorithms-keeper
algorithms_keeper/parser/rules/use_fstring.py
ea80d9342b4d2efd246a6bc409889ed780accf08
import libcst as cst import libcst.matchers as m from fixit import CstLintRule from fixit import InvalidTestCase as Invalid from fixit import ValidTestCase as Valid class UseFstringRule(CstLintRule): MESSAGE: str = ( "As mentioned in the [Contributing Guidelines]" + "(https://github.com/TheAlgori...
[((592, 641), 'fixit.ValidTestCase', 'Valid', (['"""assigned=\'string\'; f\'testing {assigned}\'"""'], {}), '("assigned=\'string\'; f\'testing {assigned}\'")\n', (597, 641), True, 'from fixit import ValidTestCase as Valid\n'), ((651, 675), 'fixit.ValidTestCase', 'Valid', (['"""\'simple string\'"""'], {}), '("\'simple s...
akashnd/bert-multitask-learning
bert_multitask_learning/model_fn.py
aee5be006ef6a3feadf0c751a6f9b42c24c3fd21
# AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/13_model_fn.ipynb (unless otherwise specified). __all__ = ['variable_summaries', 'filter_loss', 'BertMultiTaskBody', 'BertMultiTaskTop', 'BertMultiTask'] # Cell from typing import Dict, Tuple from inspect import signature import tensorflow as tf import transform...
[((722, 751), 'tensorflow.compat.v1.name_scope', 'tf.compat.v1.name_scope', (['name'], {}), '(name)\n', (745, 751), True, 'import tensorflow as tf\n'), ((768, 800), 'tensorflow.reduce_mean', 'tf.reduce_mean', ([], {'input_tensor': 'var'}), '(input_tensor=var)\n', (782, 800), True, 'import tensorflow as tf\n'), ((809, 8...
Jennyx18/SiMon
SiMon/visualization.py
522432ff708954ac37050609cfd6f42dd96467e4
import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import math from datetime import datetime from matplotlib.colors import ListedColormap, BoundaryNorm from matplotlib.collections import LineCollection from matplotlib import cm from SiMon.simulation import Simulation f...
[((28, 49), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (42, 49), False, 'import matplotlib\n'), ((962, 974), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (970, 974), True, 'import numpy as np\n'), ((996, 1008), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1004, 1008), True, 'impo...
ChrisBarker-NOAA/tamoc
bin/psm/oil_jet.py
c797cbb6fee28d788b76d21cc5b0cc0df5444ba8
""" Particle Size Models: Pure Oil Jet =================================== Use the ``TAMOC`` `particle_size_models` module to simulate a laboratory scale pure oil jet into water. This script demonstrates the typical steps involved in using the `particle_size_models.PureJet` object, which requires specification of all...
[((587, 620), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (610, 620), False, 'import warnings\n'), ((1627, 1659), 'tamoc.seawater.density', 'seawater.density', (['T', 'S', '(101325.0)'], {}), '(T, S, 101325.0)\n', (1643, 1659), False, 'from tamoc import seawater, partic...
sdss/tron
tron/Nubs/hal.py
886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322
import os.path import tron.Misc from tron import g, hub from tron.Hub.Command.Encoders.ASCIICmdEncoder import ASCIICmdEncoder from tron.Hub.Nub.SocketActorNub import SocketActorNub from tron.Hub.Reply.Decoders.ASCIIReplyDecoder import ASCIIReplyDecoder name = 'hal' def start(poller): cfg = tron.Misc.cfg.get(g....
[((540, 581), 'tron.Hub.Reply.Decoders.ASCIIReplyDecoder.ASCIIReplyDecoder', 'ASCIIReplyDecoder', ([], {'cidFirst': '(True)', 'debug': '(1)'}), '(cidFirst=True, debug=1)\n', (557, 581), False, 'from tron.Hub.Reply.Decoders.ASCIIReplyDecoder import ASCIIReplyDecoder\n'), ((590, 648), 'tron.Hub.Command.Encoders.ASCIICmdE...
gramm/xsdata
tests/fixtures/defxmlschema/chapter15.py
082c780757c6d76a5c31a6757276ef6912901ed2
from dataclasses import dataclass, field from decimal import Decimal from typing import Optional from xsdata.models.datatype import XmlDate @dataclass class SizeType: value: Optional[int] = field( default=None, metadata={ "required": True, } ) system: Optional[str] = fi...
[((196, 244), 'dataclasses.field', 'field', ([], {'default': 'None', 'metadata': "{'required': True}"}), "(default=None, metadata={'required': True})\n", (201, 244), False, 'from dataclasses import dataclass, field\n'), ((318, 369), 'dataclasses.field', 'field', ([], {'default': 'None', 'metadata': "{'type': 'Attribute...
anubhavsinha98/oppia
extensions/domain.py
9a64ea2e91d2f471ce22bd39da77b43dccd5b51f
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
[]
LaudateCorpus1/oci-ansible-collection
plugins/modules/oci_database_management_object_privilege_facts.py
2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7
#!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
[((6222, 6274), 'ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils.get_custom_class', 'get_custom_class', (['"""ObjectPrivilegeFactsHelperCustom"""'], {}), "('ObjectPrivilegeFactsHelperCustom')\n", (6238, 6274), False, 'from ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils imp...
guilhermeleobas/rbc
rbc/externals/stdio.py
4b568b91c6ce3ef7727fee001169302c3803c4fd
"""https://en.cppreference.com/w/c/io """ from rbc import irutils from llvmlite import ir from rbc.targetinfo import TargetInfo from numba.core import cgutils, extending from numba.core import types as nb_types from rbc.errors import NumbaTypeError # some errors are available for Numba >= 0.55 int32_t = ir.IntType(3...
[((308, 322), 'llvmlite.ir.IntType', 'ir.IntType', (['(32)'], {}), '(32)\n', (318, 322), False, 'from llvmlite import ir\n'), ((362, 375), 'llvmlite.ir.IntType', 'ir.IntType', (['(8)'], {}), '(8)\n', (372, 375), False, 'from llvmlite import ir\n'), ((458, 532), 'rbc.irutils.get_or_insert_function', 'irutils.get_or_inse...
clach04/discoverhue
setup.py
8f35cbc8ff9b5aab80b8be0443427058c1da51ed
from setuptools import setup try: import pypandoc long_description = pypandoc.convert_file('README.md', 'rst', extra_args=()) except ImportError: import codecs long_description = codecs.open('README.md', encoding='utf-8').read() long_description = '\n'.join(long_description.splitlines()) setup( n...
[((308, 917), 'setuptools.setup', 'setup', ([], {'name': '"""discoverhue"""', 'description': '"""Auto discovery of Hue bridges"""', 'long_description': 'long_description', 'version': '"""1.0.2"""', 'url': '"""https://github.com/Overboard/discoverhue"""', 'author': '"""Overboard"""', 'author_email': '"""amwroute-git@yah...
dbonattoj/Real-Time-Voice-Cloning
utils/logmmse.py
7ce361b0e900cb0fad4289884f526578ba276481
# The MIT License (MIT) # # Copyright (c) 2015 braindead # # 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, modif...
[((1380, 1469), 'collections.namedtuple', 'namedtuple', (['"""NoiseProfile"""', '"""sampling_rate window_size len1 len2 win n_fft noise_mu2"""'], {}), "('NoiseProfile',\n 'sampling_rate window_size len1 len2 win n_fft noise_mu2')\n", (1390, 1469), False, 'from collections import namedtuple\n'), ((2259, 2282), 'numpy...
6un9-h0-Dan/CIRTKit
lib/core/session.py
58b8793ada69320ffdbdd4ecdc04a3bb2fa83c37
# This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. import time import datetime from lib.common.out import * from lib.common.objects import File from lib.core.database import Database from lib.core.investigation import __project__ class Session(ob...
[((1970, 1980), 'lib.common.objects.File', 'File', (['path'], {}), '(path)\n', (1974, 1980), False, 'from lib.common.objects import File\n'), ((610, 621), 'time.time', 'time.time', ([], {}), '()\n', (619, 621), False, 'import time\n'), ((2113, 2123), 'lib.core.database.Database', 'Database', ([], {}), '()\n', (2121, 21...
glibin/simple-report
src/simple_report/xls/document.py
1e68b2fe568d6f7a7d9332d0e83b9a21661419e0
#coding: utf-8 import xlrd from simple_report.core.document_wrap import BaseDocument, SpreadsheetDocument from simple_report.xls.workbook import Workbook from simple_report.xls.output_options import XSL_OUTPUT_SETTINGS class DocumentXLS(BaseDocument, SpreadsheetDocument): """ Обертка для отчетов в ...
[((449, 474), 'simple_report.xls.workbook.Workbook', 'Workbook', (['ffile'], {}), '(ffile, **kwargs)\n', (457, 474), False, 'from simple_report.xls.workbook import Workbook\n')]
zengchen1024/mindinsight
tests/ut/datavisual/common/test_error_handler.py
228a448b46707e889efc1fb23502158e27ab56ca
# Copyright 2019 Huawei Technologies Co., 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 agreed to...
[((1172, 1223), 'unittest.mock.patch.object', 'patch.object', (['ScalarsProcessor', '"""get_metadata_list"""'], {}), "(ScalarsProcessor, 'get_metadata_list')\n", (1184, 1223), False, 'from unittest.mock import patch\n'), ((2030, 2081), 'unittest.mock.patch.object', 'patch.object', (['ScalarsProcessor', '"""get_metadata...
easyopsapis/easyops-api-python
pipeline_sdk/api/build/cancel_build_pb2.py
adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: cancel_build.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobu...
[((466, 492), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (490, 492), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((4184, 4333), 'google.protobuf.reflection.GeneratedProtocolMessageType', '_reflection.GeneratedProtocolMessageType', (['"""Cance...
geochri/Intel_Edge_AI-Computer_Pointer_controller
src/.ipynb_checkpoints/headpose_model-checkpoint.py
068947fa0cbe0c5d1b74e2c0eb69a85bbc439131
''' This is a sample class for a model. You may choose to use it as-is or make any changes to it. This has been provided just to give you an idea of how to structure your model class. ''' from openvino.inference_engine import IENetwork, IECore import numpy as np import os import cv2 import sys class Model_HeadPose: ...
[((4261, 4322), 'cv2.resize', 'cv2.resize', (['image', '(self.input_shape[3], self.input_shape[2])'], {}), '(image, (self.input_shape[3], self.input_shape[2]))\n', (4271, 4322), False, 'import cv2\n'), ((1382, 1390), 'openvino.inference_engine.IECore', 'IECore', ([], {}), '()\n', (1388, 1390), False, 'from openvino.inf...
HENNGE/minisaml
src/minisaml/internal/constants.py
d96aa5d294eee60521ad3c7084e8659b25935cee
NAMES_SAML2_PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol" NAMES_SAML2_ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion" NAMEID_FORMAT_UNSPECIFIED = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" BINDINGS_HTTP_POST = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" DATE_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" ...
[]
PK-100/Competitive_Programming
Contests/Snackdown19_Qualifier/CHEFPRMS.py
d0863feaaa99462b2999e85dcf115f7a6c08bb8d
import math def square(n): tmp=round(math.sqrt(n)) if tmp*tmp==n: return False else: return True def semprime(n): ch = 0 if square(n)==False: return False for i in range(2, int(math.sqrt(n)) + 1): while n%i==0: n//=i ch+=1 if ch...
[((41, 53), 'math.sqrt', 'math.sqrt', (['n'], {}), '(n)\n', (50, 53), False, 'import math\n'), ((226, 238), 'math.sqrt', 'math.sqrt', (['n'], {}), '(n)\n', (235, 238), False, 'import math\n')]
arokem/afq-deep-learning
setup.py
61d7746f03914d63c56253d10d0f6a21e6c78e90
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='This repository hosts some work-in-progress experiments applying deep learning to predict age using tractometry data.', author='Joanna Qiao', license='BSD-3', )
[((81, 96), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (94, 96), False, 'from setuptools import find_packages, setup\n')]
thiagodasilva/runway
make_base_container.py
a5455e885302df534fcfff0470881fbd2ad8eed5
#!/usr/bin/env python3 import argparse import os import random import requests import sys import tempfile import uuid from libs import colorprint from libs.cli import run_command SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) # assume well-known lvm volume group on host # ...later we'll figure out how to ...
[((211, 236), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (226, 236), False, 'import os\n'), ((699, 727), 'libs.colorprint.error', 'colorprint.error', (['error_text'], {}), '(error_text)\n', (715, 727), False, 'from libs import colorprint\n'), ((732, 743), 'sys.exit', 'sys.exit', (['(1)'],...
jfklima/prog_pratica
exercicios_antigos/ex_01.py
72c795e3372e46f04ce0c92c05187aec651777cf
"""Criar uma função que retorne min e max de uma sequência numérica aleatória. Só pode usar if, comparações, recursão e funções que sejam de sua autoria. Se quiser usar laços também pode. Deve informar via docstring qual é a complexidade de tempo e espaço da sua solução """ from math import inf def minimo_e_maxim...
[]
harisbal/dash-bootstrap-components
docs/demos/theme_explorer/util.py
d7c91c08e0821ccfd81330db912cde71ec57c171
import dash_bootstrap_components as dbc import dash_html_components as html DBC_DOCS = ( "https://dash-bootstrap-components.opensource.faculty.ai/docs/components/" ) def make_subheading(label, link): slug = label.replace(" ", "") heading = html.H2( html.Span( [ label,...
[((657, 731), 'dash_bootstrap_components.Tooltip', 'dbc.Tooltip', (['f"""See {label} documentation"""'], {'target': 'f"""tooltip_target_{slug}"""'}), "(f'See {label} documentation', target=f'tooltip_target_{slug}')\n", (668, 731), True, 'import dash_bootstrap_components as dbc\n'), ((365, 407), 'dash_html_components.I'...
MathGaron/pytorch_toolbox
pytorch_toolbox/visualization/visdom_logger.py
2afd13e50ba71dfce66467a4b070d9b922668502
''' The visualization class provides an easy access to some of the visdom functionalities Accept as input a number that will be ploted over time or an image of type np.ndarray ''' from visdom import Visdom import numpy as np import numbers class VisdomLogger: items_iterator = {} items_to_visualize = {} w...
[((342, 350), 'visdom.Visdom', 'Visdom', ([], {}), '()\n', (348, 350), False, 'from visdom import Visdom\n'), ((1624, 1660), 'numpy.array', 'np.array', (['[cls.items_iterator[name]]'], {}), '([cls.items_iterator[name]])\n', (1632, 1660), True, 'import numpy as np\n'), ((1680, 1696), 'numpy.array', 'np.array', (['[item]...
gyyang/olfaction_evolution
analytical/conditionnumber.py
434baa85b91f450e1ab63c6b9eafb8d370f1df96
"""Analyze condition number of the network.""" import numpy as np import matplotlib.pyplot as plt # import model def _get_sparse_mask(nx, ny, non, complex=False, nOR=50): """Generate a binary mask. The mask will be of size (nx, ny) For all the nx connections to each 1 of the ny units, only non connectio...
[((2495, 2511), 'numpy.arange', 'np.arange', (['(1)', '(50)'], {}), '(1, 50)\n', (2504, 2511), True, 'import numpy as np\n'), ((2578, 2590), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (2588, 2590), True, 'import matplotlib.pyplot as plt\n'), ((2591, 2624), 'matplotlib.pyplot.plot', 'plt.plot', (['n_kc_...