repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
lokal-profil/isfdb_site
edit/editpublisher.py
0ce20d6347849926d4eda961ea9249c31519eea5
#!_PYTHONLOC # # (C) COPYRIGHT 2004-2021 Al von Ruff and Ahasuerus # ALL RIGHTS RESERVED # # The copyright notice above does not evidence any actual or # intended publication of such source code. # # Version: $Revision$ # Date: $Date$ from isfdblib import * from isfdblib_help import * fr...
[]
vj-codes/dispatch
src/dispatch/incident_cost/views.py
f9354781956380cac290be02fb987eb50ddc1a5d
from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.orm import Session from dispatch.database.core import get_db from dispatch.database.service import common_parameters, search_filter_sort_paginate from dispatch.auth.permissions import SensitiveProjectActionPermission, PermissionsDependency from .mo...
[((494, 505), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (503, 505), False, 'from fastapi import APIRouter, Depends, HTTPException\n'), ((604, 630), 'fastapi.Depends', 'Depends', (['common_parameters'], {}), '(common_parameters)\n', (611, 630), False, 'from fastapi import APIRouter, Depends, HTTPException\n'),...
Lunga001/pmg-cms-2
tests/views/test_admin_committee_questions.py
10cea3979711716817b0ba2a41987df73f2c7642
import os from urllib.parse import urlparse, parse_qs from builtins import str from tests import PMGLiveServerTestCase from pmg.models import db, Committee, CommitteeQuestion from tests.fixtures import dbfixture, UserData, CommitteeData, MembershipData from flask import escape from io import BytesIO class TestAdminCo...
[((425, 449), 'tests.fixtures.dbfixture.data', 'dbfixture.data', (['UserData'], {}), '(UserData)\n', (439, 449), False, 'from tests.fixtures import dbfixture, UserData, CommitteeData, MembershipData\n'), ((1424, 1451), 'urllib.parse.urlparse', 'urlparse', (['response.location'], {}), '(response.location)\n', (1432, 145...
tiaotiao/applets
audioanalysis_demo/test_audio_analysis.py
c583a4405ed18c7d74bfba49884525c43d114398
import sys, wave import AudioAnalysis FILE_NAME = "snippet.wav" def testWavWrite(): try: f = wave.open(FILE_NAME, "rb") except Exception, e: print e print "File type is not wav!" return c = wave.open("cnv_" + FILE_NAME, "wb") print f.getnchannels() print ...
[]
xaedes/python-symbolic-logic-to-gate
syloga/transform/evaluation.py
a0dc9be9e04290008cf709fac789d224ab8c14b0
from syloga.core.map_expression_args import map_expression_args from syloga.utils.identity import identity from syloga.ast.BooleanNot import BooleanNot from syloga.ast.BooleanValue import BooleanValue from syloga.ast.BooleanOr import BooleanOr from syloga.ast.BooleanAnd import BooleanAnd from syloga.ast.BooleanNand i...
[((1555, 1570), 'syloga.ast.BooleanNot.BooleanNot', 'BooleanNot', (['arg'], {}), '(arg)\n', (1565, 1570), False, 'from syloga.ast.BooleanNot import BooleanNot\n'), ((2036, 2054), 'syloga.ast.BooleanValue.BooleanValue', 'BooleanValue', (['(True)'], {}), '(True)\n', (2048, 2054), False, 'from syloga.ast.BooleanValue impo...
Idematica/django-oscar
oscar/apps/customer/mixins.py
242a0654210d63ba75f798788916c8b2f7abb7fb
from django.conf import settings from django.contrib.auth import authenticate, login as auth_login from django.contrib.sites.models import get_current_site from django.db.models import get_model from oscar.apps.customer.signals import user_registered from oscar.core.loading import get_class from oscar.core.compat impor...
[((345, 361), 'oscar.core.compat.get_user_model', 'get_user_model', ([], {}), '()\n', (359, 361), False, 'from oscar.core.compat import get_user_model\n'), ((387, 434), 'django.db.models.get_model', 'get_model', (['"""customer"""', '"""CommunicationEventType"""'], {}), "('customer', 'CommunicationEventType')\n", (396, ...
vfloeser/TumorDelivery
plot_integral.py
a48252c17b50397b1f51be21c0cf65ade87e9000
from parameters import * from library_time import * from paths import * import numpy as np import pylab as plt import matplotlib.pyplot as mplt mplt.rc('text', usetex=True) mplt.rcParams.update({'font.size': 16}) import logging, getopt, sys import time import os #####################################################...
[((145, 173), 'matplotlib.pyplot.rc', 'mplt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (152, 173), True, 'import matplotlib.pyplot as mplt\n'), ((174, 213), 'matplotlib.pyplot.rcParams.update', 'mplt.rcParams.update', (["{'font.size': 16}"], {}), "({'font.size': 16})\n", (194, 213), True, '...
wangjeaf/CSSCheckStyle
tests/unit/combiner/Try.py
d1b1ed89c61ca80d65f398ec4a07d73789197b04
from helper import * def doTest(): msg = doCssFileCompress('_test.css') equal(msg, '@import (url-here);.test,.test2,.test3,.test4,.test5{_width:100px;*height:100px}.test6{display:none;_width:100px;*height:100px}', 'totally compressed') msg = doCssFileCompress('_test_different_order.css') equal(msg, '....
[]
desdelgado/rheology-data-toolkit
tests/tests.py
054b1659c914b8eed86239d27a746e26404395ec
import sys, os sys.path.append("C:/Users/Delgado/Documents/Research/rheology-data-toolkit/rheodata/extractors") import h5py import pandas as pd from antonpaar import AntonPaarExtractor as APE from ARES_G2 import ARES_G2Extractor # %% sys.path.append("C:/Users/Delgado/Documents/Research/rheology-data-toolkit/rheodata"...
[((15, 121), 'sys.path.append', 'sys.path.append', (['"""C:/Users/Delgado/Documents/Research/rheology-data-toolkit/rheodata/extractors"""'], {}), "(\n 'C:/Users/Delgado/Documents/Research/rheology-data-toolkit/rheodata/extractors'\n )\n", (30, 121), False, 'import sys, os\n'), ((236, 326), 'sys.path.append', 'sys...
reiterl/openslides-backend
openslides_backend/action/topic/delete.py
d36667f00087ae8baf25853d4cef18a5e6dc7b3b
from ...models.models import Topic from ..default_schema import DefaultSchema from ..generics import DeleteAction from ..register import register_action @register_action("topic.delete") class TopicDelete(DeleteAction): """ Action to delete simple topics that can be shown in the agenda. """ model = To...
[]
Dr3xler/CookieConsentChecker
main.py
816cdfb9d9dc741c57dbcd5e9c9ef59837196631
from core import file_handling as file_h, driver_handling as driver_h from website_handling import website_check as wc from cookie_handling import cookie_compare websites = file_h.website_reader() driver = driver_h.webdriver_setup() try: wc.load_with_addon(driver, websites) except: print('ERROR: IN FIREFO...
[((174, 197), 'core.file_handling.website_reader', 'file_h.website_reader', ([], {}), '()\n', (195, 197), True, 'from core import file_handling as file_h, driver_handling as driver_h\n'), ((207, 233), 'core.driver_handling.webdriver_setup', 'driver_h.webdriver_setup', ([], {}), '()\n', (231, 233), True, 'from core impo...
photonbec/PyPBEC
PyPBEC/OpticalMedium.py
fd68fa3e6206671e731bc0c2973af1f67d704f05
import numpy as np from scipy import constants as sc from scipy.interpolate import interp1d from pathlib import Path from scipy.special import erf as Erf import pandas as pd import sys import os import csv class OpticalMedium(): available_media = list() available_media.append("Rhodamine6G") def __init__(self, opt...
[((1835, 1876), 'pandas.read_csv', 'pd.read_csv', (['absorption_spectrum_datafile'], {}), '(absorption_spectrum_datafile)\n', (1846, 1876), True, 'import pandas as pd\n'), ((2576, 2661), 'scipy.interpolate.interp1d', 'interp1d', (['absorption_spectrum[(0), :]', 'absorption_spectrum[(1), :]'], {'kind': '"""cubic"""'}), ...
dslowikowski/commcare-hq
corehq/apps/appstore/urls.py
ad8885cf8dab69dc85cb64f37aeaf06106124797
from django.conf.urls.defaults import url, include, patterns from corehq.apps.appstore.dispatcher import AppstoreDispatcher store_urls = patterns('corehq.apps.appstore.views', url(r'^$', 'appstore_default', name="appstore_interfaces_default"), AppstoreDispatcher.url_pattern(), ) urlpatterns = patterns('corehq...
[((181, 246), 'django.conf.urls.defaults.url', 'url', (['"""^$"""', '"""appstore_default"""'], {'name': '"""appstore_interfaces_default"""'}), "('^$', 'appstore_default', name='appstore_interfaces_default')\n", (184, 246), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((253, 285), 'corehq.ap...
fengkaibit/faster-rcnn_vgg16_fpn
faster-rcnn-vgg16-fpn/model/fpn.py
354efd4b5f4d4a42e9c92f48501e02cd7f0c0cdb
from __future__ import absolute_import import torch from torch.nn import functional class FPN(torch.nn.Module): def __init__(self, out_channels): super(FPN, self).__init__() self.out_channels = out_channels self.P5 = torch.nn.MaxPool2d(kernel_size=1, stride=2, padding=0) self.P4_c...
[((247, 301), 'torch.nn.MaxPool2d', 'torch.nn.MaxPool2d', ([], {'kernel_size': '(1)', 'stride': '(2)', 'padding': '(0)'}), '(kernel_size=1, stride=2, padding=0)\n', (265, 301), False, 'import torch\n'), ((327, 402), 'torch.nn.Conv2d', 'torch.nn.Conv2d', (['(512)', 'self.out_channels'], {'kernel_size': '(1)', 'stride': ...
bowlofstew/client
test/setups/finders/finders_test.py
0d5ae42aaf9863e3871828b6df06170aad17c560
import unittest from biicode.common.settings.version import Version from mock import patch from biicode.client.setups.finders.finders import gnu_version from biicode.client.setups.rpi_cross_compiler import find_gnu_arm from biicode.client.workspace.bii_paths import get_biicode_env_folder_path GCC_VERSION_MAC = '''Con...
[((1116, 1170), 'mock.patch', 'patch', (['"""biicode.client.setups.finders.finders.execute"""'], {}), "('biicode.client.setups.finders.finders.execute')\n", (1121, 1170), False, 'from mock import patch\n'), ((1602, 1625), 'mock.patch', 'patch', (['"""os.path.exists"""'], {}), "('os.path.exists')\n", (1607, 1625), False...
mintmachine/arweave-python-client
setup.py
69e8e2d32090de5fd276efdb9b9103d91b4182f6
from distutils.core import setup setup( name="arweave-python-client", packages = ['arweave'], # this must be the same as the name above version="1.0.15.dev0", description="Client interface for sending transactions on the Arweave permaweb", author="Mike Hibbert", author_email="mike@hibbertitsolutions.co.uk"...
[((34, 712), 'distutils.core.setup', 'setup', ([], {'name': '"""arweave-python-client"""', 'packages': "['arweave']", 'version': '"""1.0.15.dev0"""', 'description': '"""Client interface for sending transactions on the Arweave permaweb"""', 'author': '"""Mike Hibbert"""', 'author_email': '"""mike@hibbertitsolutions.co.u...
syonoki/exchange_calendars
exchange_calendars/extensions/exchange_calendar_krx.py
639ab0f88a874af99bb601824a8ffef2572820d4
""" Last update: 2018-10-26 """ from exchange_calendars.extensions.calendar_extension import ExtendedExchangeCalendar from pandas import ( Timestamp, ) from pandas.tseries.holiday import ( Holiday, previous_friday, ) from exchange_calendars.exchange_calendar import HolidayCalendar from datetime import tim...
[((393, 433), 'pandas.tseries.holiday.Holiday', 'Holiday', (['"""New Years Day"""'], {'month': '(1)', 'day': '(1)'}), "('New Years Day', month=1, day=1)\n", (400, 433), False, 'from pandas.tseries.holiday import Holiday, previous_friday\n'), ((468, 511), 'pandas.tseries.holiday.Holiday', 'Holiday', (['"""Independence D...
ameldocena/StratifiedAggregation
utilities.py
0031fea120bff00c739eb6c3d654a5c6d3f094bb
import random import numpy #import tensorflow as tf #import torch from abc import abstractmethod from sklearn.decomposition import PCA from aggregators import FedAvg, MultiKrum, AlignedAvg, TrimmedMean, Median, StratifiedAggr class SelectionStrategy: # Unchanged from original work @abstractmethod def select_ro...
[((2339, 2371), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': 'num_components'}), '(n_components=num_components)\n', (2342, 2371), False, 'from sklearn.decomposition import PCA\n'), ((943, 998), 'random.sample', 'random.sample', (['workers', "kwargs['NUM_WORKERS_PER_ROUND']"], {}), "(workers, kwargs['NUM_WO...
b1naryth1ef/mmo
game/player.py
400f66b0ac76896af2d7108ff3540c42614a32f0
from sprites import PlayerSprite import time class Player(object): def __init__(self, name, game): self.name = name self.pos = [50, 50] self.do_blit = False self.game = game self.surf = game.SCREEN self.lastMove = 99999999999 self.velo_def = [0, 0] ...
[((383, 401), 'sprites.PlayerSprite', 'PlayerSprite', (['self'], {}), '(self)\n', (395, 401), False, 'from sprites import PlayerSprite\n'), ((826, 837), 'time.time', 'time.time', ([], {}), '()\n', (835, 837), False, 'import time\n'), ((777, 788), 'time.time', 'time.time', ([], {}), '()\n', (786, 788), False, 'import ti...
cbarrick/toys
toys/layers/pool.py
0368036ddb7594c0b6e7cdc704aeec918786e58a
from typing import Sequence import torch from torch import nn class MaxPool2d(nn.Module): def __init__(self, kernel_size, **kwargs): super().__init__() stride = kwargs.setdefault('stride', kernel_size) padding = kwargs.setdefault('padding', 0) dilation = kwargs.setdefault('dilatio...
[((474, 606), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', (['kernel_size'], {'stride': 'stride', 'padding': 'padding', 'dilation': 'dilation', 'return_indices': 'return_indices', 'ceil_mode': 'ceil_mode'}), '(kernel_size, stride=stride, padding=padding, dilation=dilation,\n return_indices=return_indices, ceil_mode=ceil_mo...
vvladych/forecastmgmt
src/forecastmgmt/ui/masterdata/person_window.py
9eea272d00bb42031f49b5bb5af01388ecce31cf
from gi.repository import Gtk from masterdata_abstract_window import MasterdataAbstractWindow from person_add_mask import PersonAddMask from person_list_mask import PersonListMask class PersonWindow(MasterdataAbstractWindow): def __init__(self, main_window): super(PersonWindow, self).__init__(main_windo...
[((323, 339), 'person_list_mask.PersonListMask', 'PersonListMask', ([], {}), '()\n', (337, 339), False, 'from person_list_mask import PersonListMask\n'), ((341, 390), 'person_add_mask.PersonAddMask', 'PersonAddMask', (['main_window', 'self.add_working_area'], {}), '(main_window, self.add_working_area)\n', (354, 390), F...
SeockHwa/Segmentation_mobileV3
fastseg/model/utils.py
01d90eeb32232346b8ed071eaf5d03322049be11
import torch.nn as nn from .efficientnet import EfficientNet_B4, EfficientNet_B0 from .mobilenetv3 import MobileNetV3_Large, MobileNetV3_Small def get_trunk(trunk_name): """Retrieve the pretrained network trunk and channel counts""" if trunk_name == 'efficientnet_b4': backbone = EfficientNet_B4(pretra...
[((1450, 1555), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_planes', 'out_planes'], {'kernel_size': 'kernel_size', 'stride': 'stride', 'padding': 'padding', 'bias': '(False)'}), '(in_planes, out_planes, kernel_size=kernel_size, stride=stride,\n padding=padding, bias=False)\n', (1459, 1555), True, 'import torch.nn as nn\n'...
06needhamt/intellij-community
python/testData/inspections/PyTypeCheckerInspection/ModuleTypeParameter/a.py
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
import module from types import ModuleType def foo(m: ModuleType): pass def bar(m): return m.__name__ foo(module) bar(module)
[]
proofdock/chaos-azure
tests/webapp/test_webapp_actions.py
85302f8be18153862656c587988eafb5dd37ddf7
from unittest.mock import patch, MagicMock from pdchaosazure.webapp.actions import stop, restart, delete from tests.data import config_provider, secrets_provider, webapp_provider @patch('pdchaosazure.webapp.actions.fetch_webapps', autospec=True) @patch('pdchaosazure.webapp.actions.client.init', autospec=True) def te...
[((183, 248), 'unittest.mock.patch', 'patch', (['"""pdchaosazure.webapp.actions.fetch_webapps"""'], {'autospec': '(True)'}), "('pdchaosazure.webapp.actions.fetch_webapps', autospec=True)\n", (188, 248), False, 'from unittest.mock import patch, MagicMock\n'), ((250, 313), 'unittest.mock.patch', 'patch', (['"""pdchaosazu...
lbesnard/subimporter
utils.py
66affbca2acdb3c25e70dac23290b5e7b956c2d7
def stringifySong(song): return f"<'{song['title']}' by '{song['artist']}' in '{song['album']}'>"
[]
leewujung/echopype-lfs-test
echopype/model/modelbase.py
b76dcf42631d0ac9cef0efeced9be4afdc15e659
""" echopype data model that keeps tracks of echo data and its connection to data files. """ import os import warnings import datetime as dt from echopype.utils import uwa import numpy as np import xarray as xr class ModelBase(object): """Class for manipulating echo data that is already converted to netCDF.""" ...
[((2910, 2929), 'os.path.basename', 'os.path.basename', (['p'], {}), '(p)\n', (2926, 2929), False, 'import os\n'), ((2947, 2967), 'os.path.splitext', 'os.path.splitext', (['pp'], {}), '(pp)\n', (2963, 2967), False, 'import os\n'), ((8945, 8977), 'os.path.join', 'os.path.join', (['save_dir', 'file_out'], {}), '(save_dir...
abondar24/OpenCVBase
Python/face_detect_camera/managers.py
9b23e3b31304e77ad1135d90efb41e3dc069194a
import cv2 import numpy as np import time class CaptureManager(object): def __init__(self, capture, preview_window_manager=None, should_mirror_preview = False): self.preview_window_manager = preview_window_manager self.should_mirror_preview = should_mirror_preview self._capture = capture...
[((2291, 2325), 'cv2.namedWindow', 'cv2.namedWindow', (['self._window_name'], {}), '(self._window_name)\n', (2306, 2325), False, 'import cv2\n'), ((2401, 2437), 'cv2.imshow', 'cv2.imshow', (['self._window_name', 'frame'], {}), '(self._window_name, frame)\n', (2411, 2437), False, 'import cv2\n'), ((2477, 2513), 'cv2.des...
micaelverissimo/lifelong_ringer
ELLA/ELLA.py
d2e7173ce08d1c087e811f6451cae1cb0e381076
""" Alpha version of a version of ELLA that plays nicely with sklearn @author: Paul Ruvolo """ from math import log import numpy as np from scipy.special import logsumexp from scipy.linalg import sqrtm, inv, norm from sklearn.linear_model import LinearRegression, Ridge, LogisticRegression, Lasso import matplotlib.pyp...
[((1314, 1335), 'numpy.random.randn', 'np.random.randn', (['d', 'k'], {}), '(d, k)\n', (1329, 1335), True, 'import numpy as np\n'), ((1352, 1376), 'numpy.zeros', 'np.zeros', (['(d * k, d * k)'], {}), '((d * k, d * k))\n', (1360, 1376), True, 'import numpy as np\n'), ((1394, 1414), 'numpy.zeros', 'np.zeros', (['(d * k, ...
Myst1c-a/phen-cogs
webhook/utils.py
672f9022ddbbd9a84b0a05357347e99e64a776fc
""" MIT License Copyright (c) 2020-present phenom4n4n 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, pub...
[((1168, 1198), 'discord.AllowedMentions.none', 'discord.AllowedMentions.none', ([], {}), '()\n', (1196, 1198), False, 'import discord\n'), ((1240, 1356), 're.compile', 're.compile', (['"""discord(?:app)?.com/api/webhooks/(?P<id>[0-9]{17,21})/(?P<token>[A-Za-z0-9\\\\.\\\\-\\\\_]{60,68})"""'], {}), "(\n 'discord(?:ap...
jwise/pebble-caltrain
scripts/generate.py
770497cb38205827fee2e4e4cfdd79bcf60ceb65
__author__ = 'katharine' import csv import struct import time import datetime def generate_files(source_dir, target_dir): stops_txt = [x for x in csv.DictReader(open("%s/stops.txt" % source_dir, 'rb')) if x['location_type'] == '0'] print "%d stops" % len(stops_txt) name_replacements = ( ('Caltra...
[]
gerardroche/sublime-phpunit
tests/test_is_valid_php_version_file_version.py
73e96ec5e4ac573c5d5247cf87c38e8243da906b
from PHPUnitKit.tests import unittest from PHPUnitKit.plugin import is_valid_php_version_file_version class TestIsValidPhpVersionFileVersion(unittest.TestCase): def test_invalid_values(self): self.assertFalse(is_valid_php_version_file_version('')) self.assertFalse(is_valid_php_version_file_versi...
[((225, 262), 'PHPUnitKit.plugin.is_valid_php_version_file_version', 'is_valid_php_version_file_version', (['""""""'], {}), "('')\n", (258, 262), False, 'from PHPUnitKit.plugin import is_valid_php_version_file_version\n'), ((289, 327), 'PHPUnitKit.plugin.is_valid_php_version_file_version', 'is_valid_php_version_file_ve...
cul-it/arxiv-rss
feed/tests/test_consts.py
40c0e859528119cc8ba3700312cb8df095d95cdd
import pytest from feed.consts import FeedVersion from feed.utils import randomize_case from feed.errors import FeedVersionError # FeedVersion.supported def test_feed_version_supported(): assert FeedVersion.supported() == { FeedVersion.RSS_2_0, FeedVersion.ATOM_1_0, } # FeedVersion.get ...
[((904, 940), 'feed.utils.randomize_case', 'randomize_case', (['FeedVersion.RSS_0_91'], {}), '(FeedVersion.RSS_0_91)\n', (918, 940), False, 'from feed.utils import randomize_case\n'), ((1439, 1474), 'feed.utils.randomize_case', 'randomize_case', (['FeedVersion.RSS_1_0'], {}), '(FeedVersion.RSS_1_0)\n', (1453, 1474), Fa...
teklager/djangocms-cascade
cmsplugin_cascade/migrations/0007_add_proxy_models.py
adc461f7054c6c0f88bc732aefd03b157df2f514
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cmsplugin_cascade', '0006_bootstrapgallerypluginmodel'), ] operations = [ ]
[]
ralphwetzel/theonionbox
theonionbox/tob/credits.py
9812fce48153955e179755ea7a58413c3bee182f
Credits = [ ('Bootstrap', 'https://getbootstrap.com', 'The Bootstrap team', 'MIT'), ('Bottle', 'http://bottlepy.org', 'Marcel Hellkamp', 'MIT'), ('Cheroot', 'https://github.com/cherrypy/cheroot', 'CherryPy Team', 'BSD 3-Clause "New" or "Revised" License'), ('Click', 'https://github.com/pallets/click', '...
[]
Ubpa/LearnTF
turorials/Google/projects/01_02_TextClassification/01_02_main.py
2c9f5d790a9911a860da1e0db4c7bb56a9eee5cb
#---------------- # 01_02 文本分类 #---------------- # TensorFlow and tf.keras import tensorflow as tf from tensorflow import keras # Helper libraries import numpy as np import matplotlib.pyplot as plt # TensorFlow's version : 1.12.0 print('TensorFlow\'s version : ', tf.__version__) #---------------- # 1 下载 IMDB 数据集 #-...
[((1257, 1371), 'tensorflow.keras.preprocessing.sequence.pad_sequences', 'keras.preprocessing.sequence.pad_sequences', (['train_data'], {'value': "word_index['<PAD>']", 'padding': '"""post"""', 'maxlen': '(256)'}), "(train_data, value=word_index[\n '<PAD>'], padding='post', maxlen=256)\n", (1299, 1371), False, 'from...
12xiaoni/text-label
backend/api/urls.py
7456c5e73d32bcfc81a02be7e0d748f162934d35
from django.urls import include, path from .views import (annotation, auto_labeling, comment, example, example_state, health, label, project, tag, task) from .views.tasks import category, relation, span, text urlpatterns_project = [ path( route='category-types', view=label.Cate...
[((6102, 6130), 'django.urls.include', 'include', (['urlpatterns_project'], {}), '(urlpatterns_project)\n', (6109, 6130), False, 'from django.urls import include, path\n')]
d-sot/nwb-jupyter-widgets
nwbwidgets/test/test_base.py
f9bf5c036c39f29e26b3cdb78198cccfa1b13cef
import numpy as np import matplotlib.pyplot as plt import pandas as pd from pynwb import TimeSeries from datetime import datetime from dateutil.tz import tzlocal from pynwb import NWBFile from ipywidgets import widgets from pynwb.core import DynamicTable from pynwb.file import Subject from nwbwidgets.view import defaul...
[((830, 1072), 'pynwb.NWBFile', 'NWBFile', ([], {'session_description': '"""demonstrate NWBFile basics"""', 'identifier': '"""NWB123"""', 'session_start_time': 'start_time', 'file_create_date': 'create_date', 'related_publications': '"""https://doi.org/10.1088/1741-2552/aaa904"""', 'experimenter': '"""Dr. Pack"""'}), "...
orikad/subliminal
subliminal/video.py
5bd87a505f7a4cad2a3a872128110450c69da4f0
# -*- coding: utf-8 -*- from __future__ import division from datetime import datetime, timedelta import logging import os from guessit import guessit logger = logging.getLogger(__name__) #: Video extensions VIDEO_EXTENSIONS = ('.3g2', '.3gp', '.3gp2', '.3gpp', '.60d', '.ajp', '.asf', '.asx', '.avchd', '.avi', '.bik'...
[((161, 188), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (178, 188), False, 'import logging\n'), ((2830, 2855), 'os.path.exists', 'os.path.exists', (['self.name'], {}), '(self.name)\n', (2844, 2855), False, 'import os\n'), ((3055, 3066), 'datetime.timedelta', 'timedelta', ([], {}), '(...
juniorosorio47/client-order
backend/app/migrations/0001_initial.py
ec429436d822d07d0ec1e0be0c2615087eec6e65
# Generated by Django 3.2.7 on 2021-10-18 23:21 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
[((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((2437, 2505), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'through'...
vadam5/NeMo
nemo/collections/nlp/models/machine_translation/mt_enc_dec_config.py
3c5db09539293c3c19a6bb7437011f91261119af
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[((2471, 2510), 'nemo.collections.nlp.modules.common.token_classifier.TokenClassifierConfig', 'TokenClassifierConfig', ([], {'log_softmax': '(True)'}), '(log_softmax=True)\n', (2492, 2510), False, 'from nemo.collections.nlp.modules.common.token_classifier import TokenClassifierConfig\n'), ((2589, 2745), 'nemo.collectio...
MaxSherry/ssr-command-client
shadowsocksr_cli/main.py
e52ea0a74e2a1bbdd7e816e0e2670d66ebdbf159
""" @author: tyrantlucifer @contact: tyrantlucifer@gmail.com @blog: https://tyrantlucifer.com @file: main.py @time: 2021/2/18 21:36 @desc: shadowsocksr-cli入口函数 """ import argparse import traceback from shadowsocksr_cli.functions import * def get_parser(): parser = argparse.ArgumentParser(description=color.blue(...
[((5308, 5330), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (5328, 5330), False, 'import traceback\n')]
jcjveraa/EDDN
examples/Python 2.7/Client_Complete.py
d0cbae6b7a2cac180dd414cbc324c2d84c867cd8
import zlib import zmq import simplejson import sys, os, datetime, time """ " Configuration """ __relayEDDN = 'tcp://eddn.edcd.io:9500' #__timeoutEDDN = 600000 # 10 minuts __timeoutEDDN = 60000 # 1 minut # Set False to listen to production stream; True to listen to debug stream __deb...
[]
nadkkka/H8PW
zad1.py
21b5d28bb42af163e7dad43368d21b550ae66618
def repleace_pattern(t,s,r): assert len(t) > 0 assert len(s) > 0 assert len(r) > 0 assert len(t) >= len(s) n = len(t) m = len(s) k = len(r) idx = -1 for i in range(0, n): if t[i] == s[0]: pattern = True for j in range(1,m): ...
[]
Matjordan/mycroft-core
mycroft/client/enclosure/weather.py
8b64930f3b3dae671535fc3b096ce9d846c54f6d
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
[]
cnwangfeng/algorithm-reference-library
tests/processing_components/test_image_iterators.py
9605eb01652fbfcb9ff003cc12b44c84093b7fb1
"""Unit tests for image iteration """ import logging import unittest import numpy from data_models.polarisation import PolarisationFrame from processing_components.image.iterators import image_raster_iter, image_channel_iter, image_null_iter from processing_components.image.operations import create_empty_image_li...
[((409, 436), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (426, 436), False, 'import logging\n'), ((6682, 6697), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6695, 6697), False, 'import unittest\n'), ((2604, 2640), 'processing_components.image.operations.create_empty_image_like...
alisure-fork/Video-Swin-Transformer
a_other_video/MCL-Motion-Focused-Contrastive-Learning/sts/motion_sts.py
aa0a31bd4df0ad2cebdcfb2ad53df712fce79809
import cv2 import numpy as np from scipy import ndimage def compute_motion_boudary(flow_clip): mx = np.array([[-1, 0, 1], [-1, 0, 1], [-1, 0, 1]]) my = np.array([[-1, -1, -1], [0, 0, 0], [1, 1, 1]]) dx_all = [] dy_all = [] mb_x = 0 mb_y = 0 for flow_img in flow_clip: d_x = ndimage...
[((106, 152), 'numpy.array', 'np.array', (['[[-1, 0, 1], [-1, 0, 1], [-1, 0, 1]]'], {}), '([[-1, 0, 1], [-1, 0, 1], [-1, 0, 1]])\n', (114, 152), True, 'import numpy as np\n'), ((162, 208), 'numpy.array', 'np.array', (['[[-1, -1, -1], [0, 0, 0], [1, 1, 1]]'], {}), '([[-1, -1, -1], [0, 0, 0], [1, 1, 1]])\n', (170, 208), ...
MSLNZ/msl-qt
tests/test_button.py
33abbb4807b54e3a06dbe9c0f9b343802ece9b97
import os import sys import pytest from msl.qt import convert, Button, QtWidgets, QtCore, Qt def test_text(): b = Button(text='hello') assert b.text() == 'hello' assert b.icon().isNull() assert b.toolButtonStyle() == Qt.ToolButtonTextOnly def test_icon(): path = os.path.dirname(__file__) + '/g...
[((122, 142), 'msl.qt.Button', 'Button', ([], {'text': '"""hello"""'}), "(text='hello')\n", (128, 142), False, 'from msl.qt import convert, Button, QtWidgets, QtCore, Qt\n'), ((347, 369), 'msl.qt.QtCore.QSize', 'QtCore.QSize', (['(191)', '(291)'], {}), '(191, 291)\n', (359, 369), False, 'from msl.qt import convert, But...
MateusBarboza99/Python-03-
Exercicios/ex028.py
9c6df88aaa8ba83d385b92722ed1df5873df3a77
from random import randint from time import sleep computador = randint(0, 5) # Faz o computador "PENSAR" print('-=-' * 20) print('Vou Pensar em Um Número Entre 0 e 5. Tente Adivinhar Paçoca...') print('-=-' * 20) jogador = int(input('Em que Número eu Pensei? ')) # Jogador tenta Adivinhar print('PROCESSANDO........') sl...
[((63, 76), 'random.randint', 'randint', (['(0)', '(5)'], {}), '(0, 5)\n', (70, 76), False, 'from random import randint\n'), ((318, 326), 'time.sleep', 'sleep', (['(3)'], {}), '(3)\n', (323, 326), False, 'from time import sleep\n')]
manas1410/Miscellaneous-Development
Student Database/input_details.py
8ffd2b586cb05b12ed0855d97c3015c8bb2a6c01
from tkinter import* import tkinter.font as font import sqlite3 name2='' regis2='' branch2='' def main(): inp=Tk() inp.geometry("430x300") inp.title("Enter The Details") inp.iconbitmap("logo/spectrumlogo.ico") f=font.Font(family='Bookman Old Style',size=15,weight='bold') f1=f...
[((251, 312), 'tkinter.font.Font', 'font.Font', ([], {'family': '"""Bookman Old Style"""', 'size': '(15)', 'weight': '"""bold"""'}), "(family='Bookman Old Style', size=15, weight='bold')\n", (260, 312), True, 'import tkinter.font as font\n'), ((319, 380), 'tkinter.font.Font', 'font.Font', ([], {'family': '"""Bookman Ol...
jakezimmerTHT/py_IQS5xx
IQS5xx/IQS5xx.py
5f90be17ea0429eeeb3726c7647f0b7ad1fb7b06
import unittest import time import logging logging.basicConfig() from intelhex import IntelHex import Adafruit_GPIO.I2C as i2c from gpiozero import OutputDevice from gpiozero import DigitalInputDevice from ctypes import c_uint8, c_uint16, c_uint32, cast, pointer, POINTER from ctypes import create_string_buffer, Struct...
[((43, 64), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (62, 64), False, 'import logging\n'), ((2025, 2051), 'struct.pack', 'struct.pack', (['""">H"""', 'address'], {}), "('>H', address)\n", (2036, 2051), False, 'import struct\n'), ((2483, 2511), 'ctypes.create_string_buffer', 'create_string_buffer'...
IBCNServices/StardogStreamReasoning
code/loader/lock.py
646db9cec7bd06ac8bfa75952b9a41773f35544d
import threading class RWLock: """Synchronization object used in a solution of so-called second readers-writers problem. In this problem, many readers can simultaneously access a share, and a writer has an exclusive access to this share. Additionally, the following constraints should be met: 1) no reader should b...
[((1092, 1108), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (1106, 1108), False, 'import threading\n'), ((1131, 1147), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (1145, 1147), False, 'import threading\n'), ((1173, 1189), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (1187, 1189), False, 'im...
Loodoor/UnamedPy
src/pyfmodex/channel_group.py
7d154c3a652992b3c1f28050f0353451f57b2a2d
from .fmodobject import * from .globalvars import dll as _dll from .globalvars import get_class class ChannelGroup(FmodObject): def add_dsp(self, dsp): check_type(dsp, get_class("DSP")) c_ptr = c_void_p() self._call_fmod("FMOD_ChannelGroup_AddDSP", d._ptr, byref(c_ptr)) return get_...
[]
siddhi117/ADB_Homework
program.py
1751b3cc2d5ec1584efdf7f8961507bc29179e49
import sqlite3 from bottle import route, run,debug,template,request,redirect @route('/todo') def todo_list(): conn = sqlite3.connect('todo.db') c = conn.cursor() c.execute("SELECT id, task FROM todo WHERE status LIKE '1'") result = c.fetchall() c.close() output = template('make_table', rows=res...
[((79, 93), 'bottle.route', 'route', (['"""/todo"""'], {}), "('/todo')\n", (84, 93), False, 'from bottle import route, run, debug, template, request, redirect\n'), ((347, 374), 'bottle.route', 'route', (['"""/new"""'], {'method': '"""GET"""'}), "('/new', method='GET')\n", (352, 374), False, 'from bottle import route, r...
censoredplanet/censoredplanet-analysis
pipeline/metadata/maxmind.py
f5e5d82f890e47599bc0baa9a9390f3c5147a6f7
"""Module to initialize Maxmind databases and lookup IP metadata.""" import logging import os from typing import Optional, Tuple, NamedTuple import geoip2.database from pipeline.metadata.mmdb_reader import mmdb_reader MAXMIND_CITY = 'GeoLite2-City.mmdb' MAXMIND_ASN = 'GeoLite2-ASN.mmdb' # Tuple(netblock, asn, as_n...
[((407, 546), 'typing.NamedTuple', 'NamedTuple', (['"""MaxmindReturnValues"""', "[('netblock', Optional[str]), ('asn', int), ('as_name', Optional[str]), (\n 'country', Optional[str])]"], {}), "('MaxmindReturnValues', [('netblock', Optional[str]), ('asn', int\n ), ('as_name', Optional[str]), ('country', Optional[s...
huyvo/gevent-websocket-py3.5
examples/plot_graph.py
b2eb3b5cfb020ac976ac0970508589020dce03ad
from __future__ import print_function """ This example generates random data and plots a graph in the browser. Run it using Gevent directly using: $ python plot_graph.py Or with an Gunicorn wrapper: $ gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" \ plot_graph:resource """ impo...
[((914, 976), 'geventwebsocket.Resource', 'Resource', (["[('/', static_wsgi_app), ('/data', PlotApplication)]"], {}), "([('/', static_wsgi_app), ('/data', PlotApplication)])\n", (922, 976), False, 'from geventwebsocket import WebSocketServer, WebSocketApplication, Resource\n'), ((1028, 1077), 'geventwebsocket.WebSocket...
deephyper/NASBigData
nas_big_data/combo/best/combo_4gpu_8_agebo/predict.py
18f083a402b80b1d006eada00db7287ff1802592
import os import numpy as np import tensorflow as tf from nas_big_data.combo.load_data import load_data_npz_gz from deephyper.nas.run.util import create_dir from deephyper.nas.train_utils import selectMetric os.environ["CUDA_VISIBLE_DEVICES"] = ",".join([str(i) for i in range(4)]) HERE = os.path.dirname(os.path.absp...
[((383, 405), 'deephyper.nas.run.util.create_dir', 'create_dir', (['output_dir'], {}), '(output_dir)\n', (393, 405), False, 'from deephyper.nas.run.util import create_dir\n'), ((424, 451), 'nas_big_data.combo.load_data.load_data_npz_gz', 'load_data_npz_gz', ([], {'test': '(True)'}), '(test=True)\n', (440, 451), False, ...
duncan-r/SHIP
ship/utils/utilfunctions.py
2c4c22c77f9c18ea545d3bce70a36aebbd18256a
""" Summary: Utility Functions that could be helpful in any part of the API. All functions that are likely to be called across a number of classes and Functions in the API should be grouped here for convenience. Author: Duncan Runnacles Created: 01 Apr 2016 Copyri...
[((922, 949), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (939, 949), False, 'import logging\n'), ((3301, 3328), 'os.path.splitext', 'os.path.splitext', (['file_path'], {}), '(file_path)\n', (3317, 3328), False, 'import os\n'), ((7229, 7255), 'os.path.splitext', 'os.path.splitext', (['...
goneri/ansible-navigator
src/ansible_navigator/ui_framework/content_defs.py
59c5c4e9758404bcf363face09cf46c325b01ad3
"""Definitions of UI content objects.""" from dataclasses import asdict from dataclasses import dataclass from enum import Enum from typing import Dict from typing import Generic from typing import TypeVar from ..utils.compatibility import TypeAlias from ..utils.serialize import SerializationFormat class ContentVie...
[((404, 416), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (411, 416), False, 'from typing import TypeVar\n'), ((2454, 2466), 'dataclasses.asdict', 'asdict', (['self'], {}), '(self)\n', (2460, 2466), False, 'from dataclasses import asdict\n'), ((2662, 2674), 'dataclasses.asdict', 'asdict', (['self'], {}),...
SWuchterl/cmssw
FWCore/MessageService/test/u28_cerr_cfg.py
769b4a7ef81796579af7d626da6039dfa0347b8e
# u28_cerr_cfg.py: # # Non-regression test configuration file for MessageLogger service: # distinct threshold level for linked destination, where # import FWCore.ParameterSet.Config as cms process = cms.Process("TEST") import FWCore.Framework.test.cmsExceptionsFatal_cff process.options = FWCore.Framework.test.cmsExc...
[((201, 220), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""TEST"""'], {}), "('TEST')\n", (212, 220), True, 'import FWCore.ParameterSet.Config as cms\n'), ((1107, 1132), 'FWCore.ParameterSet.Config.Source', 'cms.Source', (['"""EmptySource"""'], {}), "('EmptySource')\n", (1117, 1132), True, 'import FWCore.P...
Revibe-Music/core-services
content/browse/utils.py
6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2
""" Created:04 Mar. 2020 Author: Jordan Prechac """ from revibe._helpers import const from administration.utils import retrieve_variable from content.models import Song, Album, Artist from content.serializers import v1 as cnt_ser_v1 # ----------------------------------------------------------------------------- # _...
[((639, 692), 'administration.utils.retrieve_variable', 'retrieve_variable', (['"""browse_section_default_limit"""', '(50)'], {}), "('browse_section_default_limit', 50)\n", (656, 692), False, 'from administration.utils import retrieve_variable\n'), ((1278, 1321), 'content.serializers.v1.SongSerializer', 'cnt_ser_v1.Son...
vasetrendafilov/ComputerVision
Segmentation/model.py
5fcbe57fb1609ef44733aed0fab8c69d71fae21f
""" Authors: Elena Vasileva, Zoran Ivanovski E-mail: elenavasileva95@gmail.com, mars@feit.ukim.edu.mk Course: Mashinski vid, FEEIT, Spring 2021 Date: 09.03.2021 Description: function library model operations: construction, loading, saving Python version: 3.6 """ # python imports from keras.layers import ...
[((920, 947), 'keras.models.model_from_json', 'model_from_json', (['model_json'], {}), '(model_json)\n', (935, 947), False, 'from keras.models import Model, model_from_json\n'), ((1322, 1346), 'keras.layers.Input', 'Input', ([], {'shape': 'input_shape'}), '(shape=input_shape)\n', (1327, 1346), False, 'from keras.layers...
Rog3rSm1th/PolyglotOfCode
Day24_Python/part1.py
a70f50b5c882139727cbdf75144a8346cb6c538b
#!/usr/bin/env python3 #-*- coding: utf-8 -*- from itertools import combinations def solve(packages, groups): total = sum(packages) result = 9999999999999999 # we should use `for i in range(1, len(packages) - 2)` but it would # make the computation significantly slower for i in range(1, 7): ...
[((334, 359), 'itertools.combinations', 'combinations', (['packages', 'i'], {}), '(packages, i)\n', (346, 359), False, 'from itertools import combinations\n')]
atomicparade/photo-album
generate-album.py
437bc18bb00da5ce27216d03b48b78d60a0ad3fd
import configparser import math import re import urllib from pathlib import Path from PIL import Image def get_images(image_directory, thumbnail_directory, thumbnail_size): thumbnail_directory = Path(thumbnail_directory) for file in [file for file in thumbnail_directory.glob('*')]: file.unlink() ...
[((200, 225), 'pathlib.Path', 'Path', (['thumbnail_directory'], {}), '(thumbnail_directory)\n', (204, 225), False, 'from pathlib import Path\n'), ((5067, 5094), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (5092, 5094), False, 'import configparser\n'), ((503, 548), 'pathlib.Path', 'Path',...
LSSTDESC/sims_TruthCatalog
tests/test_sne_truth.py
348f5d231997eed387aaa6e3fd4218c126e14cdb
""" Unit tests for SNIa truth catalog code. """ import os import unittest import sqlite3 import numpy as np import pandas as pd from desc.sims_truthcatalog import SNeTruthWriter, SNSynthPhotFactory class SNSynthPhotFactoryTestCase(unittest.TestCase): """ Test case class for SNIa synthetic photometry factory c...
[((4369, 4384), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4382, 4384), False, 'import unittest\n'), ((524, 720), 'desc.sims_truthcatalog.SNSynthPhotFactory', 'SNSynthPhotFactory', ([], {'z': '(0.6322702169418335)', 't0': '(61719.9950436545)', 'x0': '(4.2832710977804034e-06)', 'x1': '(-1.207738485943195)', 'c...
gikoluo/djaodjin-saas
testsite/management/commands/load_test_transactions.py
badd7894ac327191008a1b3a0ebd0d07b55908c3
# Copyright (c) 2018, DjaoDjin inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
[((1800, 1827), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1817, 1827), False, 'import datetime, logging, random\n'), ((4443, 4511), 'datetime.datetime', 'datetime.datetime', ([], {'year': 'from_date.year', 'month': 'from_date.month', 'day': '(1)'}), '(year=from_date.year, month=from...
magic282/SEASS
seq2seq_pt/s2s/xutils.py
b780bf45b47d15145a148e5992bcd157c119d338
import sys import struct def save_sf_model(model): name_dicts = {'encoder.word_lut.weight': 'SrcWordEmbed_Embed_W', 'encoder.forward_gru.linear_input.weight': 'EncGRUL2R_GRU_W', 'encoder.forward_gru.linear_input.bias': 'EncGRUL2R_GRU_B', 'encoder.forward_gru.l...
[]
Novartis/Project-Mona-Lisa
pml-services/pml_storage.py
f8fcef5b434470e2a17e97fceaef46615eda1b31
# Copyright 2017 Novartis Institutes for BioMedical Research Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agre...
[((1019, 1059), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {'region_name': '"""TODO"""'}), "('s3', region_name='TODO')\n", (1033, 1059), False, 'import boto3\n'), ((2972, 2992), 'os.listdir', 'os.listdir', (['save_dir'], {}), '(save_dir)\n', (2982, 2992), False, 'import os\n')]
Nightleaf0512/PythonCryptoCurriencyPriceChecker
binan.py
9531d4a6978d280b4ca759d7ba24d3edf77fe5b2
from binance.client import Client import PySimpleGUI as sg api_key = "your_binance_apikey" secret_key = "your_binance_secretkey" client = Client(api_key=api_key, api_secret=secret_key) # price def get_price(coin): return round(float(client.get_symbol_ticker(symbol=f"{coin}USDT")['price']), 5) def colu...
[((144, 190), 'binance.client.Client', 'Client', ([], {'api_key': 'api_key', 'api_secret': 'secret_key'}), '(api_key=api_key, api_secret=secret_key)\n', (150, 190), False, 'from binance.client import Client\n'), ((1597, 1629), 'PySimpleGUI.theme', 'sg.theme', (['"""DefaultNoMoreNagging"""'], {}), "('DefaultNoMoreNaggin...
nlkhagva/saleor
saleor/graphql/ushop/bulk_mutations.py
0d75807d08ac49afcc904733724ac870e8359c10
import graphene from ...unurshop.ushop import models from ..core.mutations import BaseBulkMutation, ModelBulkDeleteMutation class UshopBulkDelete(ModelBulkDeleteMutation): class Arguments: ids = graphene.List( graphene.ID, required=True, description="List of ushop IDs to delete." ) ...
[((210, 300), 'graphene.List', 'graphene.List', (['graphene.ID'], {'required': '(True)', 'description': '"""List of ushop IDs to delete."""'}), "(graphene.ID, required=True, description=\n 'List of ushop IDs to delete.')\n", (223, 300), False, 'import graphene\n'), ((526, 621), 'graphene.List', 'graphene.List', (['g...
alvinajacquelyn/COMP0016_2
src/main/NLP/STRING_MATCH/scopus_ha_module_match.py
fd57706a992e1e47af7c802320890e93a15fc0c7
import os, sys, re import json import pandas as pd import pymongo from main.LOADERS.publication_loader import PublicationLoader from main.MONGODB_PUSHERS.mongodb_pusher import MongoDbPusher from main.NLP.PREPROCESSING.preprocessor import Preprocessor class ScopusStringMatch_HAmodule(): def __ini...
[((354, 373), 'main.LOADERS.publication_loader.PublicationLoader', 'PublicationLoader', ([], {}), '()\n', (371, 373), False, 'from main.LOADERS.publication_loader import PublicationLoader\n'), ((405, 420), 'main.MONGODB_PUSHERS.mongodb_pusher.MongoDbPusher', 'MongoDbPusher', ([], {}), '()\n', (418, 420), False, 'from m...
Cyberdeep/archerysec
tools/urls.py
a4b1a0c4f736bd70bdea693c7a7c479a69bb0f7d
# _ # /\ | | # / \ _ __ ___| |__ ___ _ __ _ _ # / /\ \ | '__/ __| '_ \ / _ \ '__| | | | # / ____ \| | | (__| | | | __/ | | |_| | # /_/ \_\_| \___|_| |_|\___|_| \__, | # __/ | # |___/ # Copyright (C) 20...
[((481, 529), 'django.conf.urls.url', 'url', (['"""^sslscan/$"""', 'views.sslscan'], {'name': '"""sslscan"""'}), "('^sslscan/$', views.sslscan, name='sslscan')\n", (484, 529), False, 'from django.conf.urls import url\n'), ((552, 621), 'django.conf.urls.url', 'url', (['"""^sslscan_result/$"""', 'views.sslscan_result'], ...
erigones/esdc-ce
api/vm/base/utils.py
2e39211a8f5132d66e574d3a657906c7d3c406fe
from core.celery.config import ERIGONES_TASK_USER from que.tasks import execute, get_task_logger from vms.models import SnapshotDefine, Snapshot, BackupDefine, Backup, IPAddress logger = get_task_logger(__name__) def is_vm_missing(vm, msg): """ Check failed command output and return True if VM is not on comp...
[((188, 213), 'que.tasks.get_task_logger', 'get_task_logger', (['__name__'], {}), '(__name__)\n', (203, 213), False, 'from que.tasks import execute, get_task_logger\n'), ((6278, 6447), 'que.tasks.execute', 'execute', (['ERIGONES_TASK_USER', 'None', 'cmd'], {'meta': 'meta', 'lock': 'lock', 'callback': 'callback', 'queue...
Coalin/Daily-LeetCode-Exercise
993_Cousins-in-Binary-Tree.py
a064dcdc3a82314be4571d342c4807291a24f69f
# 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 isCousins(self, root: TreeNode, x: int, y: int) -> bool: x_depth = None x_parent = None...
[]
mattcongy/itshop
docker-images/taigav2/taiga-back/tests/integration/test_tasks_tags.py
6be025a9eaa7fe7f495b5777d1f0e5a3184121c9
# -*- coding: utf-8 -*- # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # Copyright (C) 2014-2016 Anler Hernández ...
[((1500, 1547), 'django.core.urlresolvers.reverse', 'reverse', (['"""tasks-detail"""'], {'kwargs': "{'pk': task.pk}"}), "('tasks-detail', kwargs={'pk': task.pk})\n", (1507, 1547), False, 'from django.core.urlresolvers import reverse\n'), ((2645, 2692), 'django.core.urlresolvers.reverse', 'reverse', (['"""tasks-detail""...
satchelwu/PaddleOCR2Pytorch
pytorchocr/postprocess/cls_postprocess.py
6941565cfd4c45470cc3bf9d434c8c32267a33ef
import torch class ClsPostProcess(object): """ Convert between text-label and text-index """ def __init__(self, label_list, **kwargs): super(ClsPostProcess, self).__init__() self.label_list = label_list def __call__(self, preds, label=None, *args, **kwargs): if isinstance(preds, ...
[]
aba-ai-learning/Single-Human-Parsing-LIP
inference_folder.py
b1c0c91cef34dabf598231127886b669838fc085
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- import os import argparse import logging import numpy as np from PIL import Image import matplotlib import matplotlib.pyplot as plt import torch import torch.nn as nn from torchvision import transforms import cv2 import tqdm from net.pspnet import PSPNet models = { ...
[((1113, 1181), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Pyramid Scene Parsing Network"""'}), "(description='Pyramid Scene Parsing Network')\n", (1136, 1181), False, 'import argparse\n'), ((1679, 1699), 'torch.nn.DataParallel', 'nn.DataParallel', (['net'], {}), '(net)\n', (1694, 16...
shuvoxcd01/Policy-Evaluation
src/random_policy.py
6bfdfdaa67e1dd67edb75fcf5b4664f2584345ac
from src.gridworld_mdp import GridWorld class EquiprobableRandomPolicy: def __init__(self): self.world_model = GridWorld() def get_prob(self, selected_action, state): assert state in self.world_model.states assert selected_action in self.world_model.actions num_all_possible_a...
[((125, 136), 'src.gridworld_mdp.GridWorld', 'GridWorld', ([], {}), '()\n', (134, 136), False, 'from src.gridworld_mdp import GridWorld\n')]
Rubiel1/sktime
sktime/classification/feature_based/_summary_classifier.py
2fd2290fb438224f11ddf202148917eaf9b73a87
# -*- coding: utf-8 -*- """Summary Classifier. Pipeline classifier using the basic summary statistics and an estimator. """ __author__ = ["MatthewMiddlehurst"] __all__ = ["SummaryClassifier"] import numpy as np from sklearn.ensemble import RandomForestClassifier from sktime.base._base import _clone_estimator from s...
[((3713, 3811), 'sktime.transformations.series.summarize.SummaryTransformer', 'SummaryTransformer', ([], {'summary_function': 'self.summary_functions', 'quantiles': 'self.summary_quantiles'}), '(summary_function=self.summary_functions, quantiles=self.\n summary_quantiles)\n', (3731, 3811), False, 'from sktime.transf...
skumaravelan/tech-interview-questions
coding/reverse_bits/starter.py
637dfbf131123c77a8e2e4e45ba420355dcb381f
class Solution: # @param n, an integer # @return an integer def reverseBits(self, n):
[]
valenciarichards/hypernews-portal
Topics/Submitting data/POST Request With Several Keys/main.py
0b6c4d8aefe4f8fc7dc90d6542716e98f52515b3
from django.shortcuts import redirect from django.views import View class TodoView(View): all_todos = [] def post(self, request, *args, **kwargs): todo = request.POST.get("todo") important = request.POST.get("important") if todo not in self.all_todos: if important: ...
[((447, 460), 'django.shortcuts.redirect', 'redirect', (['"""/"""'], {}), "('/')\n", (455, 460), False, 'from django.shortcuts import redirect\n')]
quarckster/pypeln
pypeln/thread/api/to_iterable_thread_test.py
f4160d0f4d4718b67f79a0707d7261d249459a4b
import typing as tp from unittest import TestCase import hypothesis as hp from hypothesis import strategies as st import pypeln as pl import cytoolz as cz MAX_EXAMPLES = 10 T = tp.TypeVar("T") @hp.given(nums=st.lists(st.integers())) @hp.settings(max_examples=MAX_EXAMPLES) def test_from_to_iterable(nums: tp.List[int...
[((179, 194), 'typing.TypeVar', 'tp.TypeVar', (['"""T"""'], {}), "('T')\n", (189, 194), True, 'import typing as tp\n'), ((238, 276), 'hypothesis.settings', 'hp.settings', ([], {'max_examples': 'MAX_EXAMPLES'}), '(max_examples=MAX_EXAMPLES)\n', (249, 276), True, 'import hypothesis as hp\n'), ((358, 390), 'pypeln.thread....
sem-onyalo/dnn-training-monitoring-flask
app/datastore/test.py
6a81e06a6871b0d6e890f9fd92f4ab79ac8ee639
import json from app.model import TrainMetrics, TrainPlots class DatastoreTest: def getRuns(self): return [ "20211210T132017", "20211209T132017", "20211208T132017" ] def getEvals(self, run): return [40, 30, 20, 10] def getHyperparameters(self, ...
[((341, 373), 'json.loads', 'json.loads', (['TEST_HYPERPARAMETERS'], {}), '(TEST_HYPERPARAMETERS)\n', (351, 373), False, 'import json\n'), ((427, 451), 'json.loads', 'json.loads', (['TEST_SUMMARY'], {}), '(TEST_SUMMARY)\n', (437, 451), False, 'import json\n'), ((852, 879), 'app.model.TrainMetrics', 'TrainMetrics', (['h...
fkleinTUI/pyBinSim
pybinsim/pose.py
5320f62422e0a92154272f8167b87cabdcafe27f
import logging from collections import namedtuple logger = logging.getLogger("pybinsim.Pose") class Orientation(namedtuple('Orientation', ['yaw', 'pitch', 'roll'])): pass class Position(namedtuple('Position', ['x', 'y', 'z'])): pass class Custom(namedtuple('CustomValues', ['a', 'b', 'c'])): pass cl...
[((60, 94), 'logging.getLogger', 'logging.getLogger', (['"""pybinsim.Pose"""'], {}), "('pybinsim.Pose')\n", (77, 94), False, 'import logging\n'), ((115, 166), 'collections.namedtuple', 'namedtuple', (['"""Orientation"""', "['yaw', 'pitch', 'roll']"], {}), "('Orientation', ['yaw', 'pitch', 'roll'])\n", (125, 166), False...
madelinetharp/morphocut-server
morphocut_server/extensions.py
a82ad5916adbd168816f7b26432b4a98d978c299
from flask_sqlalchemy import SQLAlchemy from flask_redis import FlaskRedis from flask_migrate import Migrate # from flask_rq2 import RQ from rq import Queue from morphocut_server.worker import redis_conn database = SQLAlchemy() redis_store = FlaskRedis() migrate = Migrate() redis_queue = Queue(connection=redis_conn)...
[((218, 230), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (228, 230), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((245, 257), 'flask_redis.FlaskRedis', 'FlaskRedis', ([], {}), '()\n', (255, 257), False, 'from flask_redis import FlaskRedis\n'), ((268, 277), 'flask_migrate.Migrate', 'Migrate'...
aleonlein/acq4
acq4/drivers/ThorlabsMFC1/tmcm.py
4b1fcb9ad2c5e8d4595a2b9cf99d50ece0c0f555
from __future__ import print_function """ Low-level serial communication for Trinamic TMCM-140-42-SE controller (used internally for the Thorlabs MFC1) """ import serial, struct, time, collections try: # this is nicer because it provides deadlock debugging information from acq4.util.Mutex import RecursiveMut...
[((4354, 4371), 'threading.RLock', 'RLock', ([], {'debug': '(True)'}), '(debug=True)\n', (4359, 4371), False, 'from threading import RLock\n'), ((4605, 4667), 'SerialDevice.SerialDevice.__init__', 'SerialDevice.__init__', (['self'], {'port': 'self.port', 'baudrate': 'baudrate'}), '(self, port=self.port, baudrate=baudra...
brianleungwh/signals
tests/generators/ios/test_core_data.py
d28d2722d681d390ebd21cd668d0b19f2f184451
import unittest from signals.generators.ios.core_data import get_current_version, get_core_data_from_folder class CoreDataTestCase(unittest.TestCase): def test_get_current_version(self): version_name = get_current_version('./tests/files/doubledummy.xcdatamodeld') self.assertEqual(version_name, 'du...
[((216, 277), 'signals.generators.ios.core_data.get_current_version', 'get_current_version', (['"""./tests/files/doubledummy.xcdatamodeld"""'], {}), "('./tests/files/doubledummy.xcdatamodeld')\n", (235, 277), False, 'from signals.generators.ios.core_data import get_current_version, get_core_data_from_folder\n'), ((363,...
hudalao/mcmc
mcmc/plot_graph.py
148d9fbb9ebd85ee5bfd3601d80ebbd96bc25791
# commend the lines for plotting using import matplotlib.pyplot as plt import networkx as nx def plot_graph(G, N, time_point, posi): #setting up for graph plotting #setting the positions for all nodes pos = {} for ii in range(N): pos[ii] = posi[ii] # plt.figure(time_point + 1) elarge=[(...
[]
mishrakeshav/Competitive-Programming
Number Theory/Sieve_of_Eratosthenes.py
b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2
from sys import stdin input = stdin.readline N = int(input()) primes = [1]*(N+1) primes[0] = 0 primes[1] = 0 for i in range(2,int(N**0.5)+1): if primes[i]: for j in range(i*i,N+1,i): primes[j] = 0 for i in range(N+1): if primes[i]: print(i,end = " ")
[]
kruton/powerline
powerline/lib/tree_watcher.py
f6ddb95da5f41b8285cffd1d17c1ef46dc08a7d6
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, absolute_import, print_function) __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' import sys import os import errno from time import sleep from powerline.lib.monotonic import monotonic from powe...
[((705, 727), 'os.path.realpath', 'os.path.realpath', (['path'], {}), '(path)\n', (721, 727), False, 'import os\n'), ((5131, 5142), 'powerline.lib.monotonic.monotonic', 'monotonic', ([], {}), '()\n', (5140, 5142), False, 'from powerline.lib.monotonic import monotonic\n'), ((5446, 5457), 'powerline.lib.monotonic.monoton...
PrashantKumar-sudo/qibuild
python/qisys/test/fake_interact.py
a16ce425cf25127ceff29507feeeeca37af23351
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). """ Fake Interact """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import...
[]
kowalej/muse-lsl
muselsl/cli.py
9086f2588bee3b2858b0ff853b7a08cdcd0e7612
#!/usr/bin/python import sys import argparse class main: def __init__(self): parser = argparse.ArgumentParser( description='Python package for streaming, recording, and visualizing EEG data from the Muse 2016 headset.', usage='''muselsl <command> [<args>] Available commands: ...
[((98, 1950), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Python package for streaming, recording, and visualizing EEG data from the Muse 2016 headset."""', 'usage': '"""muselsl <command> [<args>]\n Available commands:\n list List available Muse devices.\n ...
Quantum-OCS/QuOCS-pyside2interface
src/quocspyside2interface/gui/freegradients/GeneralSettingsNM.py
69436666a67da6884aed1ddd087b7062dcd2ad90
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Copyright 2021- QuOCS Team # # 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://ww...
[((1557, 1610), 'quocspyside2interface.logic.OptimalAlgorithmDictionaries.NelderMeadDictionary.NelderMeadDictionary', 'NelderMeadDictionary', ([], {'loaded_dictionary': 'nm_dictionary'}), '(loaded_dictionary=nm_dictionary)\n', (1577, 1610), False, 'from quocspyside2interface.logic.OptimalAlgorithmDictionaries.NelderMea...
divyamamgai/integrations-extras
pulsar/datadog_checks/pulsar/check.py
8c40a9cf870578687cc224ee91d3c70cd3a435a4
from datadog_checks.base import ConfigurationError, OpenMetricsBaseCheck EVENT_TYPE = SOURCE_TYPE_NAME = 'pulsar' class PulsarCheck(OpenMetricsBaseCheck): """ PulsarCheck derives from AgentCheck that provides the required check method """ def __init__(self, name, init_config, instances=None): ...
[((433, 500), 'datadog_checks.base.ConfigurationError', 'ConfigurationError', (['"""Unable to find prometheus_url in config file."""'], {}), "('Unable to find prometheus_url in config file.')\n", (451, 500), False, 'from datadog_checks.base import ConfigurationError, OpenMetricsBaseCheck\n')]
HowToBeCalculated/Hands-On-Blockchain-for-Python-Developers
Chapter11/publish_horoscope1_in_another_ipns.py
f9634259dd3dc509f36a5ccf3a5182c0d2ec79c4
import ipfsapi c = ipfsapi.connect() peer_id = c.key_list()['Keys'][1]['Id'] c.name_publish('QmYjYGKXqo36GDt6f6qvp9qKAsrc72R9y88mQSLvogu8Ub', key='another_key') result = c.cat('/ipns/' + peer_id) print(result)
[((21, 38), 'ipfsapi.connect', 'ipfsapi.connect', ([], {}), '()\n', (36, 38), False, 'import ipfsapi\n')]
NiumXp/Magie
magie/window.py
f0dc1d135274b5453fde659ba46f09f4b303c099
import pygame class Window: def __init__(self, title: str, dimension: tuple): self.surface = None self.initial_title = title self.initial_dimension = dimension @property def title(self) -> str: """Returns the title of the window.""" return pygame.disp...
[((309, 337), 'pygame.display.get_caption', 'pygame.display.get_caption', ([], {}), '()\n', (335, 337), False, 'import pygame\n'), ((444, 481), 'pygame.display.set_caption', 'pygame.display.set_caption', (['new_title'], {}), '(new_title)\n', (470, 481), False, 'import pygame\n'), ((1640, 1687), 'pygame.display.set_mode...
dwillmer/fastats
tests/optimize/test_newton_raphson_hypo.py
5915423714b32ed7e953e1e3a311fe50c3f30943
from hypothesis import given, assume, settings from hypothesis.strategies import floats from numpy import cos from pytest import approx from fastats.optimise.newton_raphson import newton_raphson def func(x): return x**3 - x - 1 def less_or_equal(x, compared_to, rel=1e-6): return ((x < compared_to) ...
[((426, 483), 'fastats.optimise.newton_raphson.newton_raphson', 'newton_raphson', (['(1)', '(1e-06)'], {'root': 'func', 'return_callable': '(True)'}), '(1, 1e-06, root=func, return_callable=True)\n', (440, 483), False, 'from fastats.optimise.newton_raphson import newton_raphson\n'), ((858, 921), 'fastats.optimise.newto...
sequery/Face-Recognition-Project
faceRecognition.py
84d29322228e140c3d18c9c4d169819375a8e256
import cv2 import os import numpy as np # This module contains all common functions that are called in tester.py file # Given an image below function returns rectangle for face detected alongwith gray scale image def faceDetection(test_img): gray_img = cv2.cvtColor(test_img, cv2.COLOR_BGR2GRAY) # convert color...
[((261, 303), 'cv2.cvtColor', 'cv2.cvtColor', (['test_img', 'cv2.COLOR_BGR2GRAY'], {}), '(test_img, cv2.COLOR_BGR2GRAY)\n', (273, 303), False, 'import cv2\n'), ((364, 436), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""HaarCascade/haarcascade_frontalface_default.xml"""'], {}), "('HaarCascade/haarcascade_front...
hsiehkl/pdffigures2
evaluation/datasets/build_dataset_images.py
9ff2978a097f3d500dcb840d31587c26d994cb68
import argparse from os import listdir, mkdir from os.path import join, isdir from subprocess import call import sys import datasets from shutil import which """ Script to use pdftoppm to turn the pdfs into single images per page """ def get_images(pdf_dir, output_dir, dpi, mono=True): if which("pdftoppm") is N...
[((725, 744), 'os.listdir', 'listdir', (['output_dir'], {}), '(output_dir)\n', (732, 744), False, 'from os import listdir, mkdir\n'), ((1992, 2078), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Cache rasterized page images for a dataset"""'}), "(description=\n 'Cache rasterized page...
utkarshdeorah/sympy
sympy/physics/__init__.py
dcdf59bbc6b13ddbc329431adf72fcee294b6389
""" A module that helps solving problems in physics. """ from . import units from .matrices import mgamma, msigma, minkowski_tensor, mdft __all__ = [ 'units', 'mgamma', 'msigma', 'minkowski_tensor', 'mdft', ]
[]
avr8082/Hadoop
py.py
64b2036e752ac01b9e2256e20b659b1b56a274c9
printf("Hello world")
[]