repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
sht47/mmtracking
configs/mot/tracktor/tracktor_faster-rcnn_r50_fpn_4e_mot17-public.py
5a25e418e9c598d1b576bce8702f5e156cbbefe7
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-public-half.py'] model = dict( pretrains=dict( detector= # noqa: E251 'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501 )) data_root = 'data/MOT17/' test_set = 'test' data = dict...
[]
Shaimyst/scrive_test
browserstack/first_sample_build.py
38e3ea0192885d1776d24afdbea110d73adc4e8b
from threading import Thread from time import sleep from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWai...
[((1243, 1407), 'selenium.webdriver.Remote', 'webdriver.Remote', ([], {'command_executor': '"""https://jessicasadler_RbBTVv:xE8t7EaT7QqcLDMfzfvz@hub-cloud.browserstack.com/wd/hub"""', 'desired_capabilities': 'desired_cap'}), "(command_executor=\n 'https://jessicasadler_RbBTVv:xE8t7EaT7QqcLDMfzfvz@hub-cloud.browserst...
suutari-ai/mvj
sanitizers/mvj.py
c39dbc692afcb3b26366783414c2d5a88a57b25a
# -*- coding: utf-8 -*- from __future__ import unicode_literals import random from random import choice from string import digits from faker import Faker fake = Faker("fi_FI") def sanitize_address(value): return fake.address() def sanitize_address_if_exist(value): if value: return sanitize_addres...
[((164, 178), 'faker.Faker', 'Faker', (['"""fi_FI"""'], {}), "('fi_FI')\n", (169, 178), False, 'from faker import Faker\n'), ((1202, 1216), 'random.choice', 'choice', (['digits'], {}), '(digits)\n', (1208, 1216), False, 'from random import choice\n'), ((1232, 1253), 'random.randint', 'random.randint', (['(0)', '(10)'],...
rhmdnd/compliance-trestle-demos
ISM_catalog_profile/scripts/ISM/ISM.py
1d92c91cca1d23cf707f82f035b2d58ec67c953a
#!/usr/bin/env python3 # # -*- mode:python; coding:utf-8 -*- # Copyright (c) 2020 IBM Corp. 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 # # https://www.apache.org...
[((1811, 1838), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1828, 1838), False, 'import logging\n'), ((1888, 1921), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (1909, 1921), False, 'import logging\n'), ((7947, 7974), 'trestle.oscal.profile...
geo2tag-logistics/main
logistics/permissions.py
3b55185ea97481bbabe38497e4608abefbf1ece1
from rest_framework import permissions def is_owner(user): return user.groups.filter(name='OWNER').exists() def is_driver(user): return user.groups.filter(name='DRIVER').exists() class IsOwnerPermission(permissions.BasePermission): def has_permission(self, request, view): return is_owner(reque...
[]
blancKaty/alignmentFralework_and_classif
src/python/reduce_fps_parallel.py
192565a928dad0d98553e0602e91eed59c4a193d
import os import shutil import sys import multiprocessing import glob def copy(source, dest): shutil.copyfile(source, dest) def main(): input_folder = sys.argv[1] output_folder = sys.argv[2] print 'input reduce fps : ' , sys.argv fps = int(sys.argv[3]); final_length=float(sys.argv[4]) ; ...
[]
EnjoyLifeFund/macHighSierra-py36-pkgs
ansible/utils/module_docs_fragments/docker.py
5668b5785296b314ea1321057420bcd077dba9ea
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
[]
cyberjunky/python-garminconnect-aio
setup.py
fb913a15107edee5c5530f3bded7c553ec57923b
#!/usr/bin/env python from setuptools import setup with open("README.md") as readme_file: readme = readme_file.read() setup( author="Ron Klinkien", author_email="ron@cyberjunky.nl", classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", ...
[((125, 764), 'setuptools.setup', 'setup', ([], {'author': '"""Ron Klinkien"""', 'author_email': '"""ron@cyberjunky.nl"""', 'classifiers': "['Programming Language :: Python :: 3',\n 'License :: OSI Approved :: MIT License',\n 'Operating System :: OS Independent']", 'description': '"""Asynchronous Garmin Connect P...
ChameleonCloud/nova
nova/tests/unit/virt/libvirt/fake_imagebackend.py
4bb9421b02b71f2b218278aa6f97abace871b111
# Copyright 2012 Grid Dynamics # 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...
[((1711, 1751), 'collections.defaultdict', 'collections.defaultdict', (['self._mock_disk'], {}), '(self._mock_disk)\n', (1734, 1751), False, 'import collections\n'), ((2083, 2130), 'mock.create_autospec', 'mock.create_autospec', (['libvirt_utils.fetch_image'], {}), '(libvirt_utils.fetch_image)\n', (2103, 2130), False, ...
coolboi567/dnstwister
tests/test_email_subscriptions.py
b809ca721a13efc6b59e11587c582f6ba4b11587
"""Tests of the email subscription mechanism.""" import binascii import flask_webtest import mock import pytest import webtest.app import dnstwister import dnstwister.tools import patches @mock.patch('dnstwister.views.www.email.emailer', patches.NoEmailer()) @mock.patch('dnstwister.repository.db', patch...
[((253, 272), 'patches.NoEmailer', 'patches.NoEmailer', ([], {}), '()\n', (270, 272), False, 'import patches\n'), ((315, 341), 'patches.SimpleKVDatabase', 'patches.SimpleKVDatabase', ([], {}), '()\n', (339, 341), False, 'import patches\n'), ((1155, 1181), 'patches.SimpleKVDatabase', 'patches.SimpleKVDatabase', ([], {})...
zlikun/python-crawler-lianjia
ershoufang/crawler_v2.py
7e7bf0cbd333486ee62ac015e72b96d6003c8713
""" 第二版:多进程二手房信息爬虫 1. 将爬虫分解为下载任务和解析任务(可以继续分解,但在本案中意义不大)两部分,两部分各使用一个子进程,相互通过数据管道通信 2. 下载任务内部不使用队列,使用任务管道实现(在多进程:主进程、子进程、子进程内部进程池等场景下,队列并不好用)任务管理和通信 3. 解析任务从与下载任务间的管道中获取数据,解析并保存 问题:当目标被爬完后,怎样让爬虫停止? """ import csv import datetime import logging import multiprocessing as mp import re import time from collections import O...
[((530, 539), 'multiprocessing.Lock', 'mp.Lock', ([], {}), '()\n', (537, 539), True, 'import multiprocessing as mp\n'), ((578, 599), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (597, 599), False, 'import datetime\n'), ((804, 916), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging...
yetsun/hue
desktop/core/ext-py/pyu2f-0.1.4/pyu2f/convenience/customauthenticator.py
2e48f0cc70e233ee0e1b40733d4b2a18d8836c66
# Copyright 2016 Google Inc. 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 applicable law or ag...
[((2908, 2949), 'os.environ.get', 'os.environ.get', (['SK_SIGNING_PLUGIN_ENV_VAR'], {}), '(SK_SIGNING_PLUGIN_ENV_VAR)\n', (2922, 2949), False, 'import os\n'), ((5811, 5842), 'struct.pack', 'struct.pack', (['"""<I"""', 'input_length'], {}), "('<I', input_length)\n", (5822, 5842), False, 'import struct\n'), ((5933, 6001)...
dmacmillan/Kive
kive/portal/management/commands/graph_kive.py
76bc8f289f66fb133f78cb6d5689568b7d015915
import itertools import os from django.conf import settings from django.core.management import call_command from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Generates class diagrams.' def handle(self, *args, **options): if 'django_extensions' not in settings.IN...
[((442, 488), 'os.path.join', 'os.path.join', (['os.path.pardir', '"""docs"""', '"""models"""'], {}), "(os.path.pardir, 'docs', 'models')\n", (454, 488), False, 'import os\n'), ((1145, 1181), 'os.path.join', 'os.path.join', (['docs_path', '"""README.md"""'], {}), "(docs_path, 'README.md')\n", (1157, 1181), False, 'impo...
rpls/openlane_summary
summary.py
5057fab80a4acaf08e6503ced7abb932684145a5
#!/usr/bin/env python3 import argparse import os import glob import csv import sys import re from shutil import which import datetime def is_tool(name): return which(name) is not None def check_path(path): paths = glob.glob(path) if len(paths) == 0: exit("file not found: %s" % path) if len(pa...
[((225, 240), 'glob.glob', 'glob.glob', (['path'], {}), '(path)\n', (234, 240), False, 'import glob\n'), ((491, 510), 'os.path.basename', 'os.path.basename', (['e'], {}), '(e)\n', (507, 510), False, 'import os\n'), ((518, 568), 're.match', 're.match', (['"""^\\\\d+\\\\-\\\\d+\\\\_\\\\d+\\\\-\\\\d+$"""', 'datestamp'], {...
player1537-forks/spack
var/spack/repos/builtin/packages/py-cupy/package.py
822b7632222ec5a91dc7b7cda5fc0e08715bd47c
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyCupy(PythonPackage): """CuPy is an open-source array library accelerated with NVIDIA...
[]
cfytrok/python-simple-rest-client
simple_rest_client/decorators.py
4896e8226ffe194625c63773ea6f49531293b308
import logging from functools import wraps import status from httpx import exceptions from .exceptions import AuthError, ClientConnectionError, ClientError, NotFoundError, ServerError logger = logging.getLogger(__name__) def validate_response(response): error_suffix = " response={!r}".format(response) if r...
[((196, 223), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (213, 223), False, 'import logging\n'), ((624, 673), 'status.is_client_error', 'status.is_client_error', ([], {'code': 'response.status_code'}), '(code=response.status_code)\n', (646, 673), False, 'import status\n'), ((760, 809)...
PhMueller/TrajectoryParser
HPOBenchExperimentUtils/resource_manager/__init__.py
9c19d37a3ff29a593c9b6d3e7fd3857e8c2d724f
from HPOBenchExperimentUtils.resource_manager.file_resource_manager import FileBasedResourceManager
[]
kkiningh/slime
tools/mirrors.bzl
85853115e284bda35b3da10957823d23428b65d3
DEFAULT_MIRRORS = { "bitbucket": [ "https://bitbucket.org/{repository}/get/{commit}.tar.gz", ], "buildifier": [ "https://github.com/bazelbuild/buildtools/releases/download/{version}/{filename}", ], "github": [ "https://github.com/{repository}/archive/{commit}.tar.gz", ], ...
[]
ScrippsPipkinLab/GenomeTracks
201805_ChIP_ATAC/codes_old/read_txt.py
89824daceba82f7a52cf8a31149845548fe1aa76
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jun 6 21:15:23 2017 @author: yolandatiao """ import csv import glob import os from astropy.io import ascii # For using ascii table to open csv from astropy.table import Table, Column # For using astropy table functions os.chdir("/Volumes/Huitian/...
[]
josetaas/vendcrawler
tests/test_vendcrawler.py
5cb497d0741f6dbd29a6e41fa9f1cb3374e8f062
import unittest from vendcrawler.scripts.vendcrawler import VendCrawler class TestVendCrawlerMethods(unittest.TestCase): def test_get_links(self): links = VendCrawler('a', 'b', 'c').get_links(2) self.assertEqual(links, ['https://sarahserver.net/?module=vendor&p=1', ...
[((658, 673), 'unittest.main', 'unittest.main', ([], {}), '()\n', (671, 673), False, 'import unittest\n'), ((170, 196), 'vendcrawler.scripts.vendcrawler.VendCrawler', 'VendCrawler', (['"""a"""', '"""b"""', '"""c"""'], {}), "('a', 'b', 'c')\n", (181, 196), False, 'from vendcrawler.scripts.vendcrawler import VendCrawler\...
thk4711/mediamanager
services/spotify-service.py
8f6d21c220767aa9ee5d65635d2993dba07eceed
#!/usr/bin/python3 # -*- coding: utf-8 -*- import time import json import os import sys import time import urllib import socket import argparse import requests import lib.common as common base_url = 'http://localhost:24879/player/' #------------------------------------------------------------------------------# # ...
[((7049, 7070), 'lib.common.run_http', 'common.run_http', (['port'], {}), '(port)\n', (7064, 7070), True, 'import lib.common as common\n'), ((587, 608), 'os.chdir', 'os.chdir', (['script_path'], {}), '(script_path)\n', (595, 608), False, 'import os\n'), ((622, 698), 'argparse.ArgumentParser', 'argparse.ArgumentParser',...
YuHe0108/cvmodule
Segment/models/other/fcn.py
ea00a90fc9bbca5b2c7809791cbd1f7b0da526cd
# from tensorflow.keras import Model, Input # from tensorflow.keras.applications import vgg16, resnet50 # from tensorflow.keras.layers import (Conv2D, Conv2DTranspose, Cropping2D, add, Dropout, Reshape, Activation) # from tensorflow.keras import layers # import tensorflow as tf # # """ # FCN-8特点: # 1、不含全连接层...
[((7112, 7130), 'tensorflow.keras.Input', 'Input', (['input_shape'], {}), '(input_shape)\n', (7117, 7130), False, 'from tensorflow.keras import Model, Input\n'), ((7149, 7252), 'tensorflow.keras.applications.vgg16.VGG16', 'vgg16.VGG16', ([], {'input_tensor': 'inputs', 'include_top': '(False)', 'weights': 'weight_name',...
lopippo/IsoSpec
tests/Python/test_all_configs_output.py
dfc6d7dac213f174fb9c61a5ee018d3f6174febc
def binom(n, k): """Quickly adapted from https://stackoverflow.com/questions/26560726/python-binomial-coefficient""" if k < 0 or k > n: return 0 if k == 0 or k == n: return 1 total_ways = 1 for i in range(min(k, n - k)): total_ways = total_ways * (n - i) // (i + 1) return...
[((501, 530), 'IsoSpecPy.IsoParamsFromFormula', 'IsoParamsFromFormula', (['formula'], {}), '(formula)\n', (521, 530), False, 'from IsoSpecPy import IsoParamsFromFormula\n'), ((1150, 1203), 'IsoSpecPy.IsoThreshold', 'IsoThreshold', ([], {'formula': 'f', 'threshold': '(0.0)', 'absolute': '(True)'}), '(formula=f, threshol...
soichih/TractSeg
tractseg/models/UNet_Pytorch_Regression.py
f78d0c6dc998905e593cbf4346745467e30d1979
# Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ) # # 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 #...
[((1485, 1517), 'tractseg.libs.PytorchUtils.conv2d', 'conv2d', (['n_input_channels', 'n_filt'], {}), '(n_input_channels, n_filt)\n', (1491, 1517), False, 'from tractseg.libs.PytorchUtils import conv2d\n'), ((1543, 1565), 'tractseg.libs.PytorchUtils.conv2d', 'conv2d', (['n_filt', 'n_filt'], {}), '(n_filt, n_filt)\n', (1...
hackerwins/polyaxon
platform/core/polyaxon/sidecar/sidecar/__main__.py
ff56a098283ca872abfbaae6ba8abba479ffa394
import argparse import time from kubernetes.client.rest import ApiException from polyaxon_client.client import PolyaxonClient from polyaxon_k8s.manager import K8SManager from sidecar import settings from sidecar.monitor import is_pod_running if __name__ == '__main__': parser = argparse.ArgumentParser() pars...
[((285, 310), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (308, 310), False, 'import argparse\n'), ((920, 981), 'polyaxon_k8s.manager.K8SManager', 'K8SManager', ([], {'namespace': 'settings.K8S_NAMESPACE', 'in_cluster': '(True)'}), '(namespace=settings.K8S_NAMESPACE, in_cluster=True)\n', (93...
plusangel/simple_robot
simple_robot_tests/src/test_odometry.py
d9ad5ed8cd592f4aee14df13465435279b4d60d7
#! /usr/bin/env python import rospy from nav_msgs.msg import Odometry class OdomTopicReader(object): def __init__(self, topic_name = '/odom'): self._topic_name = topic_name self._sub = rospy.Subscriber(self._topic_name, Odometry, self.topic_callback) self._odomdata = Odometry() def to...
[((444, 484), 'rospy.init_node', 'rospy.init_node', (['"""odom_topic_subscriber"""'], {}), "('odom_topic_subscriber')\n", (459, 484), False, 'import rospy\n'), ((544, 558), 'rospy.Rate', 'rospy.Rate', (['(10)'], {}), '(10)\n', (554, 558), False, 'import rospy\n'), ((207, 272), 'rospy.Subscriber', 'rospy.Subscriber', ([...
kevinintel/neural-compressor
test/test_random.py
b57645566aeff8d3c18dc49d2739a583c072f940
"""Tests for quantization""" import numpy as np import unittest import os import shutil import yaml import tensorflow as tf def build_fake_yaml(): fake_yaml = ''' model: name: fake_yaml framework: tensorflow inputs: x outputs: op_to_store dev...
[((619, 663), 'yaml.load', 'yaml.load', (['fake_yaml'], {'Loader': 'yaml.SafeLoader'}), '(fake_yaml, Loader=yaml.SafeLoader)\n', (628, 663), False, 'import yaml\n'), ((1296, 1340), 'yaml.load', 'yaml.load', (['fake_yaml'], {'Loader': 'yaml.SafeLoader'}), '(fake_yaml, Loader=yaml.SafeLoader)\n', (1305, 1340), False, 'im...
lilies/Cirq
cirq/google/engine/engine_client_test.py
519b8b70ba4d2d92d1c034c398161ebdbd23e2e7
# Copyright 2020 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[((1222, 1293), 'unittest.mock.patch.object', 'mock.patch.object', (['quantum', '"""QuantumEngineServiceClient"""'], {'autospec': '(True)'}), "(quantum, 'QuantumEngineServiceClient', autospec=True)\n", (1239, 1293), False, 'from unittest import mock\n'), ((3338, 3409), 'unittest.mock.patch.object', 'mock.patch.object',...
jwygoda/google-ads-python
google/ads/google_ads/v0/proto/services/media_file_service_pb2_grpc.py
863892b533240cb45269d9c2cceec47e2c5a8b68
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from google.ads.google_ads.v0.proto.resources import media_file_pb2 as google_dot_ads_dot_googleads__v0_dot_proto_dot_resources_dot_media__file__pb2 from google.ads.google_ads.v0.proto.services import media_file_service_pb2 as google_dot...
[((2991, 3106), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""google.ads.googleads.v0.services.MediaFileService"""', 'rpc_method_handlers'], {}), "(\n 'google.ads.googleads.v0.services.MediaFileService', rpc_method_handlers)\n", (3027, 3106), False, 'import grpc\n'), ((2180, 2...
KhaledSharif/kornia
docs/generate_example_images.py
9bae28e032b092b065658117723a82816d09dbac
import importlib import math import os from pathlib import Path from typing import Optional, Tuple import cv2 import numpy as np import requests import torch import kornia as K def read_img_from_url(url: str, resize_to: Optional[Tuple[int, int]] = None) -> torch.Tensor: # perform request response = requests...
[((381, 414), 'numpy.frombuffer', 'np.frombuffer', (['response', 'np.uint8'], {}), '(response, np.uint8)\n', (394, 414), True, 'import numpy as np\n'), ((590, 633), 'kornia.utils.image_to_tensor', 'K.utils.image_to_tensor', (['img'], {'keepdim': '(False)'}), '(img, keepdim=False)\n', (613, 633), True, 'import kornia as...
Pushkar-Bhuse/forte
forte/processors/data_augment/algorithms/embedding_similarity_replacement_op.py
b7402330cf0b2b26fe56234f0ae43c89b31c0082
# Copyright 2020 The Forte Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
[((1846, 1879), 'texar.torch.data.Vocab', 'Vocab', (["self.configs['vocab_path']"], {}), "(self.configs['vocab_path'])\n", (1851, 1879), False, 'from texar.torch.data import Vocab, Embedding\n'), ((1954, 2009), 'texar.torch.data.Embedding', 'Embedding', (['self.vocab.token_to_id_map_py', 'embed_hparams'], {}), '(self.v...
FelixSchwarz/sentry
src/sentry/receivers/experiments.py
7c92c4fa2b6b9f214764f48c82594acae1549e52
from __future__ import print_function, absolute_import from sentry import analytics from sentry.signals import join_request_created, join_request_link_viewed @join_request_created.connect(weak=False) def record_join_request_created(member, **kwargs): analytics.record( "join_request.created", member_id=me...
[((162, 202), 'sentry.signals.join_request_created.connect', 'join_request_created.connect', ([], {'weak': '(False)'}), '(weak=False)\n', (190, 202), False, 'from sentry.signals import join_request_created, join_request_link_viewed\n'), ((377, 421), 'sentry.signals.join_request_link_viewed.connect', 'join_request_link_...
arturtamborski/arturtamborskipl
arturtamborskipl/urls.py
9b93be045f58d5802d9a61568d7ecfbb12042b59
from django.conf.urls import url, include from django.contrib import admin from django.views.generic import RedirectView from django.views.generic import TemplateView from django.contrib.sitemaps.views import sitemap from django.conf import settings from blog.sitemaps import ArticleSitemap urlpatterns = [ url(r'^...
[((313, 344), 'django.conf.urls.url', 'url', (['"""^admin/"""', 'admin.site.urls'], {}), "('^admin/', admin.site.urls)\n", (316, 344), False, 'from django.conf.urls import url, include\n'), ((456, 547), 'django.conf.urls.url', 'url', (['"""^sitemap\\\\.xml$"""', 'sitemap', "{'sitemaps': {'blog': ArticleSitemap}}"], {'n...
steinermg/ion-functions
ion_functions/qc/qc_functions.py
cea532ad9af51e86768572c8deb48547d99567c5
#!/usr/bin/env python """ @package ion_functions.qc_functions @file ion_functions/qc_functions.py @author Christopher Mueller @brief Module containing QC functions ported from matlab samples in DPS documents """ from ion_functions.qc.qc_extensions import stuckvalues, spikevalues, gradientvalues, ntp_to_month import ...
[((2816, 2834), 'numpy.atleast_1d', 'np.atleast_1d', (['dat'], {}), '(dat)\n', (2829, 2834), True, 'import numpy as np\n'), ((2848, 2869), 'numpy.atleast_1d', 'np.atleast_1d', (['datlim'], {}), '(datlim)\n', (2861, 2869), True, 'import numpy as np\n'), ((9428, 9450), 'numpy.max', 'np.max', (['datlim[:, (1)]'], {}), '(d...
avshalomt2/datatest
datatest/__past__/api08.py
f622b0e990b53c73f56730a9009b39af7653df20
"""Backward compatibility for version 0.8 API.""" from __future__ import absolute_import import inspect import datatest from datatest._compatibility import itertools from datatest._compatibility.collections.abc import Sequence from datatest._load.get_reader import get_reader from datatest._load.load_csv import load_cs...
[((5493, 5508), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (5506, 5508), False, 'import inspect\n'), ((7193, 7250), 'datatest._compatibility.itertools.zip_longest', 'itertools.zip_longest', (['data', 'sequence'], {'fillvalue': 'NOTFOUND'}), '(data, sequence, fillvalue=NOTFOUND)\n', (7214, 7250), False, 'from d...
jonkuhn/reinteract-jk
lib/reinteract/editor.py
319c8d930f142cf3c3b8693fbff1b84fd582387c
# Copyright 2008 Owen Taylor # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import os import gobject import gtk import pango fr...
[]
tvogels01/arthur-redshift-etl
python/scripts/compare_events.py
477f822d16cd3a86b3bf95cfa28915cb7470a6e4
""" This script compares events from two ETLs to highlight differences in elapsed times or row counts. * Pre-requisites You need to have a list of events for each ETL. Arthur can provide this using the "query_events" command. For example: ``` arthur.py query_events -p development 37ACEC7440AB4620 -q > 37ACEC7440AB46...
[((1145, 1170), 're.compile', 're.compile', (['"""\\\\s+\\\\|\\\\s+"""'], {}), "('\\\\s+\\\\|\\\\s+')\n", (1155, 1170), False, 'import re\n'), ((1188, 1220), 're.compile', 're.compile', (['"""\\\\(\\\\d+\\\\s*rows\\\\)"""'], {}), "('\\\\(\\\\d+\\\\s*rows\\\\)')\n", (1198, 1220), False, 'import re\n'), ((1673, 1705), 'c...
cmu-sei/augur-code
harness/drifter.py
d8c1e29ce3276037b26b65ea316d251752529449
# Augur: A Step Towards Realistic Drift Detection in Production MLSystems - Code # Copyright 2022 Carnegie Mellon University. # # NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITH...
[((2550, 2596), 'datasets.dataset.load_dataset_class', 'dataset.load_dataset_class', (['dataset_class_name'], {}), '(dataset_class_name)\n', (2576, 2596), False, 'from datasets import dataset\n'), ((2724, 2760), 'utils.logging.setup_logging', 'logging.setup_logging', (['LOG_FILE_NAME'], {}), '(LOG_FILE_NAME)\n', (2745,...
DSM-DMS/Project-DMS-Web
server/server-flask/app/docs/admin/survey/survey.py
73a5d8fc2310bca90169414abf50f541ca0724c7
SURVEY_POST = { 'tags': ['설문조사 관리'], 'description': '설문조사 등록', 'parameters': [ { 'name': 'Authorization', 'description': 'JWT Token', 'in': 'header', 'type': 'str', 'required': True }, { 'name': 'title', ...
[]
xuyu0010/ARID_v1
network/baselines_archive/resnet_3d101.py
b03d0975f41547e8aa78929b8e26a62248f8e18f
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import math from functools import partial import logging import os try: from . import initializer from .utils import load_state except: import initializer from utils import load_state __all__ = ['Re...
[((451, 540), 'torch.nn.Conv3d', 'nn.Conv3d', (['in_planes', 'out_planes'], {'kernel_size': '(3)', 'stride': 'stride', 'padding': '(1)', 'bias': '(False)'}), '(in_planes, out_planes, kernel_size=3, stride=stride, padding=1,\n bias=False)\n', (460, 540), True, 'import torch.nn as nn\n'), ((647, 721), 'torch.nn.Conv3d...
gecBurton/inference_logic
tests/ninety_nine_problems/test_miscellaneous_problems.py
2531d8f8fb0154b3bd42ac86eccc44d7038f6ef6
import pytest from inference_logic import Rule, Variable, search from inference_logic.data_structures import Assert, Assign @pytest.mark.xfail def test_90(): r""" P90 (**) Eight queens problem This is a classical problem in computer science. The objective is to place eight queens on a chessboard so ...
[((2700, 2797), 'inference_logic.Variable.factory', 'Variable.factory', (['"""N"""', '"""Qs"""', '"""N"""', '"""Rs"""', '"""Qs"""', '"""A"""', '"""B"""', '"""L"""', '"""A1"""', '"""Y"""', '"""Ys"""', '"""X"""', '"""Xs"""', '"""Zs"""'], {}), "('N', 'Qs', 'N', 'Rs', 'Qs', 'A', 'B', 'L', 'A1', 'Y', 'Ys',\n 'X', 'Xs', '...
ipa320/airbus_coop
airbus_cobot_gui/src/airbus_cobot_gui/diagnostics/diagnostics.py
974564807ba5d24096e237a9991311608a390da1
#!/usr/bin/env python # # Copyright 2015 Airbus # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA) # # 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 # # ...
[((1353, 1438), 'rospy.get_param', 'rospy.get_param', (['"""diagnostics_toplevel_topic_name"""', '"""/diagnostics_toplevel_state"""'], {}), "('diagnostics_toplevel_topic_name',\n '/diagnostics_toplevel_state')\n", (1368, 1438), False, 'import rospy\n'), ((1939, 2045), 'rospy.Subscriber', 'rospy.Subscriber', (['self....
KEZKA/YL-WEB-PROJECT
sanansaattaja/website/forms/comment_form.py
dcefb490bdd6a1ae8449b3cbd5d6b36219506e8f
from flask_wtf import FlaskForm from wtforms import SubmitField, TextAreaField from wtforms.validators import DataRequired class CommentForm(FlaskForm): text = TextAreaField("Text", validators=[DataRequired()]) submit = SubmitField('Publish')
[((230, 252), 'wtforms.SubmitField', 'SubmitField', (['"""Publish"""'], {}), "('Publish')\n", (241, 252), False, 'from wtforms import SubmitField, TextAreaField\n'), ((200, 214), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (212, 214), False, 'from wtforms.validators import DataRequired\n')]
dongzizhu/GraphGallery
graphgallery/functional/dense/onehot.py
c65eab42daeb52de5019609fe7b368e30863b4ae
import numpy as np from ..transform import DenseTransform from ..decorators import multiple from ..transform import Transform __all__ = ['onehot', 'Onehot'] @Transform.register() class Onehot(DenseTransform): def __init__(self, depth=None): super().__init__() self.collect(locals()...
[((508, 541), 'numpy.asarray', 'np.asarray', (['label'], {'dtype': 'np.int32'}), '(label, dtype=np.int32)\n', (518, 541), True, 'import numpy as np\n'), ((621, 653), 'numpy.eye', 'np.eye', (['depth'], {'dtype': 'label.dtype'}), '(depth, dtype=label.dtype)\n', (627, 653), True, 'import numpy as np\n')]
Bileonaire/api-ridemyway
models.py
af5a669c811356998e1935ace555ba955de1e8d0
"""Handles data storage for Users, rides and requests """ # pylint: disable=E1101 import datetime from flask import make_response, jsonify, current_app from werkzeug.security import generate_password_hash import psycopg2 import config from databasesetup import db class User(): """Contains user columns and method...
[((502, 551), 'werkzeug.security.generate_password_hash', 'generate_password_hash', (['password'], {'method': '"""sha256"""'}), "(password, method='sha256')\n", (524, 551), False, 'from werkzeug.security import generate_password_hash\n'), ((872, 880), 'databasesetup.db.con', 'db.con', ([], {}), '()\n', (878, 880), Fals...
herrywen-nanj/51reboot
lesson06/liqi/test.py
1130c79a360e1b548a6eaad176eb60f8bed22f40
import configparser ''' config = configparser.ConfigParser() config.read('db.ini') print(config.sections()) print(dict(config['mysqld'])['symbolic-links']) ''' def ReadConfig(filename, section, key=None): print(filename) config = configparser.ConfigParser() config.read(filename) print(config.section...
[((242, 269), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (267, 269), False, 'import configparser\n')]
xUndero/noc
core/forms.py
9fb34627721149fcf7064860bd63887e38849131
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Forms wrapper # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # ------------------------------------------------------------------...
[((1815, 1841), 'six.iteritems', 'six.iteritems', (['self.fields'], {}), '(self.fields)\n', (1828, 1841), False, 'import six\n'), ((893, 952), 'django.utils.html.escape', 'escape', (['(self.field.label if self.field.label else self.name)'], {}), '(self.field.label if self.field.label else self.name)\n', (899, 952), Fal...
Prescrypto/ErsteOps
ersteops/unit/views.py
0b744173fb4f500003c96c4dcb26fb67d6eaa5ec
import json from django.shortcuts import get_object_or_404 from django.core import serializers from django.http import HttpResponse from .models import Unit from .utils import UNIT_LIST_FIELD BAD_REQUEST = HttpResponse(json.dumps({'error': 'Bad Request'}), status=400, content_type='application/json') def unit_json_li...
[((220, 256), 'json.dumps', 'json.dumps', (["{'error': 'Bad Request'}"], {}), "({'error': 'Bad Request'})\n", (230, 256), False, 'import json\n'), ((561, 577), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (571, 577), False, 'import json\n'), ((1257, 1316), 'django.core.serializers.serialize', 'serializers.se...
gabrielviticov/exercicios-python
olamundo.py/exercicios_refeitos/ex029.py
4068cb0029513f8ab8bd12fa3a9055f37b4040d4
''' ex029: Escreva um programa que leia a velocidade de uma carro. Se ele ultrapassar 80 km/h, mostre uma mensagem dizendo que ele foi multado. A multa vai custar R$ 7,00 por cada Km acima do limite. ''' from colorise import set_color, reset_color cor = { 'limpa':'\033[m', 'white':'\033[1;97m' } set_color(fg='...
[((306, 327), 'colorise.set_color', 'set_color', ([], {'fg': '"""green"""'}), "(fg='green')\n", (315, 327), False, 'from colorise import set_color, reset_color\n'), ((561, 574), 'colorise.reset_color', 'reset_color', ([], {}), '()\n', (572, 574), False, 'from colorise import set_color, reset_color\n'), ((653, 674), 'co...
felko/fruit
fruit/mixin/drawable.py
4768fd333ac3b7c0bd6d339304b23e20e312d2d1
#!/usr/bin/env python3.4 # coding: utf-8 class Drawable: """ Base class for drawable objects. """ def draw(self): """ Returns a Surface object. """ raise NotImplementedError( "Method `draw` is not implemented for {}".format(type(self)))
[]
uts-cic/ontask_b
src/action/tests/test_logic.py
b313e2352c77b40655f41dd5acba3a7635e6f3b3
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import os from django.conf import settings from django.shortcuts import reverse from django.core.management import call_command import test from dataops import pandas_db from workflow.models import Workflow class EmailActionTracking(te...
[((416, 435), 'django.conf.settings.BASE_DIR', 'settings.BASE_DIR', ([], {}), '()\n', (433, 435), False, 'from django.conf import settings\n'), ((1387, 1427), 'dataops.pandas_db.pg_restore_table', 'pandas_db.pg_restore_table', (['cls.filename'], {}), '(cls.filename)\n', (1413, 1427), False, 'from dataops import pandas_...
izm51/obniz-python-sdk
obniz/parts/Moving/StepperMotor/__init__.py
40a738b5fe2c0a415cdc09f46d28c143982bfb07
from attrdict import AttrDefault import asyncio class StepperMotor: def __init__(self): self.keys = ['a', 'b', 'aa', 'bb', 'common'] self.required_keys = ['a', 'b', 'aa', 'bb'] self._step_instructions = AttrDefault(bool, { '1': [[0, 1, 1, 1], [1, 0, 1, 1], [1, 1...
[((233, 512), 'attrdict.AttrDefault', 'AttrDefault', (['bool', "{'1': [[0, 1, 1, 1], [1, 0, 1, 1], [1, 1, 0, 1], [1, 1, 1, 0]], '2': [[0, 0,\n 1, 1], [1, 0, 0, 1], [1, 1, 0, 0], [0, 1, 1, 0]], '1-2': [[0, 1, 1, 1],\n [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 0, 1], [1, 1, 0, 1], [1, 1, 0, 0], [\n 1, 1, 1, 0], [0, 1, ...
1212091/python-learning
basic_assignment/39.py
30fad66460daf73fd3961cf667ee25b91dee923d
input_num = raw_input() print(str(eval(input_num)))
[]
SimonGreenhill/Language5
website/website/apps/entry/admin.py
c59f502dda7be27fc338f0338cc3b03e63bad9c8
from django.contrib import admin from django.db.models import Count from reversion.admin import VersionAdmin from website.apps.lexicon.models import Lexicon from website.apps.entry.models import Task, TaskLog, Wordlist, WordlistMember from website.apps.core.admin import TrackedModelAdmin class CheckpointListFilter(adm...
[((2677, 2713), 'django.contrib.admin.site.register', 'admin.site.register', (['Task', 'TaskAdmin'], {}), '(Task, TaskAdmin)\n', (2696, 2713), False, 'from django.contrib import admin\n'), ((2714, 2756), 'django.contrib.admin.site.register', 'admin.site.register', (['TaskLog', 'TaskLogAdmin'], {}), '(TaskLog, TaskLogAd...
fest2bash/fest2bash
src/modules/python.py
008282f67d4d4415c27b3b9b6162daf54f8d6028
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re import sys sys.dont_write_bytecode = True from pprint import pprint from base import BaseFest2Bash class Fest2Bash(BaseFest2Bash): def __init__(self, manifest): super(Fest2Bash, self).__init__(manifest) def generate(self, *args, **kw...
[]
paulculmsee/opennem
opennem/utils/scrapyd.py
9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1
#!/usr/bin/env python """ Srapyd control methods """ import logging from typing import Any, Dict, List from urllib.parse import urljoin from opennem.settings import settings from opennem.utils.http import http from opennem.utils.scrapy import get_spiders logger = logging.getLogger("scrapyd.client") def get_jobs() ...
[((267, 302), 'logging.getLogger', 'logging.getLogger', (['"""scrapyd.client"""'], {}), "('scrapyd.client')\n", (284, 302), False, 'import logging\n'), ((582, 626), 'urllib.parse.urljoin', 'urljoin', (['settings.scrapyd_url', '"""cancel.json"""'], {}), "(settings.scrapyd_url, 'cancel.json')\n", (589, 626), False, 'from...
Haiiliin/PyAbaqus
src/abaqus/Material/Elastic/Linear/Elastic.py
f20db6ebea19b73059fe875a53be370253381078
from abaqusConstants import * from .FailStrain import FailStrain from .FailStress import FailStress class Elastic: """The Elastic object specifies elastic material properties. Notes ----- This object can be accessed by: .. code-block:: python import material ...
[]
UWSysLab/diamond
apps/pyscrabble/pyscrabble-hatchet/setup.py
1beec323c084d9d477c770ca6b9625c8f5682a39
# setup.py for pyscrabble from distutils.core import setup try: import py2exe HAS_PY2EXE = True except ImportError: HAS_PY2EXE = False import glob import os import pkg_resources import sys from pyscrabble.constants import VERSION from pyscrabble import util from pyscrabble import dist def fi...
[]
liuxiaomiao123/NeuroMathAcademy
tutorials/W2D2_LinearSystems/solutions/W2D2_Tutorial1_Solution_437c0b24.py
16a7969604a300bf9fbb86f8a5b26050ebd14c65
def integrate_exponential(a, x0, dt, T): """Compute solution of the differential equation xdot=a*x with initial condition x0 for a duration T. Use time step dt for numerical solution. Args: a (scalar): parameter of xdot (xdot=a*x) x0 (scalar): initial condition (x at time 0) dt (scalar): timeste...
[]
SwaggerKhan/PatrolGis
PyTemp/gis/shapefile_to_geojson.py
89b1a398ffd6171ac35ea9d023bce98a0fc7e930
import json import geojson import geopandas as gpd class SaveToGeoJSON: __name_counter = 0 def file_name(self): if self.__name_counter == 0: self.__name_counter = 1 return "./out"+str(self.__name_counter)+".json" elif self.__name_counter == 1: self.__name_co...
[((548, 567), 'geopandas.read_file', 'gpd.read_file', (['name'], {}), '(name)\n', (561, 567), True, 'import geopandas as gpd\n'), ((1015, 1033), 'json.dumps', 'json.dumps', (['merged'], {}), '(merged)\n', (1025, 1033), False, 'import json\n'), ((1101, 1137), 'json.dump', 'json.dump', (['merged', 'outfile'], {'indent': ...
JoshuaMeyers/ssbio
ssbio/databases/pdbflex.py
624618602437e2c2e4adf90962adcef3af2d5b40
import requests import ssbio.utils import os.path as op # #### PDB stats # Request flexibility data about one particular PDB. # # http://pdbflex.org/php/api/PDBStats.php?pdbID=1a50&chainID=A # # pdbID of structure you are interested in # chainID of chain you are interested in # # [{"pdbID":"1a50", # ...
[]
manisharmagarg/qymatix
api/insights/insights/infrastructure/mysql/read/modify_notes.py
0dc240970359429ae5105db79f9aebf1a99ba6fd
""" Modify Notes """ # pylint: disable=too-few-public-methods from ...mysql.mysql_connection import MySqlConnection from ...mysql.orm.autogen_entities import Task class ModifyNotes(object): """ ModifyNotes responsible to update the record in db """ def __init__(self, db_name, notes_id, title=None, co...
[]
yetsun/hue
desktop/core/ext-py/pyasn1-0.4.6/tests/type/test_namedval.py
2e48f0cc70e233ee0e1b40733d4b2a18d8836c66
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # import sys try: import unittest2 as unittest except ImportError: import unittest from tests.base import BaseTestCase from pyasn1.type import namedval ...
[((391, 415), 'tests.base.BaseTestCase.setUp', 'BaseTestCase.setUp', (['self'], {}), '(self)\n', (409, 415), False, 'from tests.base import BaseTestCase\n'), ((433, 476), 'pyasn1.type.namedval.NamedValues', 'namedval.NamedValues', (["('off', 0)", "('on', 1)"], {}), "(('off', 0), ('on', 1))\n", (453, 476), False, 'from ...
methane/pymemcache
setup.py
0ff5430cdcef7ed52fb3edc2a90c1c7d208ad77f
#!/usr/bin/env python from setuptools import setup, find_packages from pymemcache import __version__ setup( name = 'pymemcache', version = __version__, author = 'Charles Gordon', author_email = 'charles@pinterest.com', packages = find_packages(), tests_require = ['nose>=1.0'], install_req...
[((253, 268), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (266, 268), False, 'from setuptools import setup, find_packages\n')]
DL-85/pytorch_geometric
torch_geometric/read/ply.py
eb12a94a667e881c4a6bff26b0453428bcb72393
import torch from plyfile import PlyData from torch_geometric.data import Data def read_ply(path): with open(path, 'rb') as f: data = PlyData.read(f) pos = ([torch.tensor(data['vertex'][axis]) for axis in ['x', 'y', 'z']]) pos = torch.stack(pos, dim=-1) face = None if 'face' in data: ...
[((252, 276), 'torch.stack', 'torch.stack', (['pos'], {'dim': '(-1)'}), '(pos, dim=-1)\n', (263, 276), False, 'import torch\n'), ((491, 504), 'torch_geometric.data.Data', 'Data', ([], {'pos': 'pos'}), '(pos=pos)\n', (495, 504), False, 'from torch_geometric.data import Data\n'), ((148, 163), 'plyfile.PlyData.read', 'Ply...
ranguera/ml-agents
ml-agents/mlagents/trainers/brain_conversion_utils.py
68779b407b32fce2ea14b16ef1bc26dea7d5e5a8
from mlagents.trainers.brain import BrainInfo, BrainParameters, CameraResolution from mlagents.envs.base_env import BatchedStepResult, AgentGroupSpec from mlagents.envs.exception import UnityEnvironmentException import numpy as np from typing import List def step_result_to_brain_info( step_result: BatchedStepResu...
[((990, 1031), 'numpy.zeros', 'np.zeros', (['(n_agents, 0)'], {'dtype': 'np.float32'}), '((n_agents, 0), dtype=np.float32)\n', (998, 1031), True, 'import numpy as np\n'), ((1060, 1129), 'numpy.concatenate', 'np.concatenate', (['[step_result.obs[i] for i in vec_obs_indices]'], {'axis': '(1)'}), '([step_result.obs[i] for...
SoonerRobotics/MRDC22
mrdc_ws/src/mrdc_serial/setup.py
00c1360138e468bf313eefc93fbde11f289ece82
from setuptools import find_packages, setup from glob import glob import os package_name = 'mrdc_serial' setup( name=package_name, version='1.0.0', packages=find_packages(), data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + p...
[((171, 186), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (184, 186), False, 'from setuptools import find_packages, setup\n'), ((360, 405), 'os.path.join', 'os.path.join', (['"""share"""', 'package_name', '"""launch"""'], {}), "('share', package_name, 'launch')\n", (372, 405), False, 'import os\n'), ...
DobromirZlatkov/anteya
orders/views.py
9c66c64643350ad1710bcf60e2e38169e389a66b
from django.core.urlresolvers import reverse_lazy from django.views import generic from django.shortcuts import redirect, render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from . import forms from . import models from custommixins import mixins class OrderView(generic.V...
[((588, 675), 'django.shortcuts.render', 'render', (['request', 'self.template_name', "{'formset': formset, 'order_form': order_form}"], {}), "(request, self.template_name, {'formset': formset, 'order_form':\n order_form})\n", (594, 675), False, 'from django.shortcuts import redirect, render\n'), ((1836, 1923), 'dja...
oleksost/RoutingNetworks
PytorchRouting/Examples/run_experiments.py
7e3e9219b7389d5af2a832a4882bc9fda0e7fd21
""" This file defines some simple experiments to illustrate how Pytorch-Routing functions. """ import numpy as np import tqdm import torch from PytorchRouting.DecisionLayers import REINFORCE, QLearning, SARSA, ActorCritic, GumbelSoftmax, PerTaskAssignment, \ WPL, AAC, AdvantageLearning, RELAX, EGreedyREINFORCE, EGr...
[((4118, 4226), 'PytorchRouting.Examples.Datasets.CIFAR100MTL', 'CIFAR100MTL', (['(10)'], {'data_files': "['./Datasets/cifar-100-py/train', './Datasets/cifar-100-py/test']", 'cuda': 'cuda'}), "(10, data_files=['./Datasets/cifar-100-py/train',\n './Datasets/cifar-100-py/test'], cuda=cuda)\n", (4129, 4226), False, 'fr...
tefra/xsdata-w3c-tests
output/models/ms_data/regex/re_g22_xsd/__init__.py
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
from output.models.ms_data.regex.re_g22_xsd.re_g22 import ( Regex, Doc, ) __all__ = [ "Regex", "Doc", ]
[]
rgeirhos/object-recognition
code/image-manipulation.py
4679f7c60665bd9fb274c6c4372fc0fa34b51485
#!/usr/bin/env python from skimage.color import rgb2gray from skimage.io import imread, imsave from scipy.misc import toimage import numpy as np import wrapper as wr ########################################################### # IMAGE IO ########################################################### def imload_rgb(pa...
[((2702, 2731), 'numpy.where', 'np.where', (['(image < 0)', '(0)', 'image'], {}), '(image < 0, 0, image)\n', (2710, 2731), True, 'import numpy as np\n'), ((2744, 2773), 'numpy.where', 'np.where', (['(image > 1)', '(1)', 'image'], {}), '(image > 1, 1, image)\n', (2752, 2773), True, 'import numpy as np\n'), ((5095, 5108)...
AlishKZ/ITMO_ICT_WebDevelopment_2020-2021
students/K33402/Akhmetzhanov Alisher/lr2/main/forms.py
b3ce82e17392d26d815e64343f5103f1bd46cd81
from django.db.models import fields from main.models import RoomReservation, UserRoom from django import forms from django.core.exceptions import ValidationError from django.contrib.auth import authenticate, login from django.contrib.auth import get_user_model class ReservateRoomForm(forms.Form): begin_date = for...
[((317, 334), 'django.forms.DateField', 'forms.DateField', ([], {}), '()\n', (332, 334), False, 'from django import forms\n'), ((350, 367), 'django.forms.DateField', 'forms.DateField', ([], {}), '()\n', (365, 367), False, 'from django import forms\n'), ((414, 445), 'django.forms.CharField', 'forms.CharField', ([], {'ma...
espottesmith/emmet
emmet-core/emmet/core/vasp/calc_types.py
bd28b91d240da9f0c996a2b2efb7e67da9176a09
""" Module to define various calculation types as Enums for VASP """ import datetime from itertools import groupby, product from pathlib import Path from typing import Dict, Iterator, List import bson import numpy as np from monty.json import MSONable from monty.serialization import loadfn from pydantic import BaseMod...
[((1674, 1706), 'itertools.product', 'product', (['_RUN_TYPES', '_TASK_TYPES'], {}), '(_RUN_TYPES, _TASK_TYPES)\n', (1681, 1706), False, 'from itertools import groupby, product\n'), ((592, 606), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (596, 606), False, 'from pathlib import Path\n')]
dawnos/robotcar-to-rosbag
sensors/__init__.py
c51035d7fd7e08487629a9b06d84a86890f7cc03
from mono_left import MonoLeft from mono_right import MonoRight from mono_rear import MonoRear from stereo_left import StereoLeft from stereo_right import StereoRight from stereo_centre import StereoCentre
[]
YiWang-Evonne/disaster_response
models/train_classifier.py
824f646920ac85a01419101e17e92f592a505782
import sys import pandas as pd from sqlalchemy import create_engine import nltk nltk.download(['punkt', 'wordnet', 'averaged_perceptron_tagger']) import re from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer from sklearn.metrics import classification_report from sklearn.metrics import confus...
[((80, 145), 'nltk.download', 'nltk.download', (["['punkt', 'wordnet', 'averaged_perceptron_tagger']"], {}), "(['punkt', 'wordnet', 'averaged_perceptron_tagger'])\n", (93, 145), False, 'import nltk\n'), ((848, 895), 'sqlalchemy.create_engine', 'create_engine', (["('sqlite:///' + database_filepath)"], {}), "('sqlite:///...
dymaxionlabs/platform
terra/terra/emails.py
98fe893d4632d62fea3e2357f16d970014037cdf
import os from datetime import date from django.conf import settings from django.core.mail import send_mail from django.template.loader import render_to_string from django.utils import translation from django.utils.translation import ugettext as _ from mailchimp3 import MailChimp class Email: from_email = settin...
[((436, 480), 'os.path.join', 'os.path.join', (['settings.BASE_DIR', '"""templates"""'], {}), "(settings.BASE_DIR, 'templates')\n", (448, 480), False, 'import os\n'), ((6117, 6203), 'django.core.mail.send_mail', 'send_mail', (['subject', 'body', '"""damian@dymaxionlabs.com"""', "['monitor@dymaxionlabs.com']"], {}), "(s...
miksu/edward2
experimental/attentive_uncertainty/toy_regression/datasets.py
973acdb23701f320ebaee8a56fc44d4414acfa4e
# coding=utf-8 # Copyright 2019 The Edward2 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[((871, 976), 'collections.namedtuple', 'collections.namedtuple', (['"""NPRegressionDescription"""', "('context_x', 'context_y', 'target_x', 'target_y')"], {}), "('NPRegressionDescription', ('context_x', 'context_y',\n 'target_x', 'target_y'))\n", (893, 976), False, 'import collections\n'), ((3274, 3303), 'tensorflo...
shagun6/critiquebrainz
critiquebrainz/frontend/views/index.py
b7ae41fb09ff4dd4e34847b294fbee4ccc76bad5
from flask import Blueprint, render_template from flask_babel import format_number import critiquebrainz.db.users as db_users import critiquebrainz.db.review as db_review from bs4 import BeautifulSoup from markdown import markdown DEFAULT_CACHE_EXPIRATION = 10 * 60 # seconds frontend_bp = Blueprint('frontend', __nam...
[((293, 324), 'flask.Blueprint', 'Blueprint', (['"""frontend"""', '__name__'], {}), "('frontend', __name__)\n", (302, 324), False, 'from flask import Blueprint, render_template\n'), ((408, 432), 'critiquebrainz.db.review.get_popular', 'db_review.get_popular', (['(6)'], {}), '(6)\n', (429, 432), True, 'import critiquebr...
Q-Alpha/Hackathon2020
Enigma/Enigma-master/GBS/gbsHelper.py
c0ed45b4c1cc4f475f83786e641b859dad94f863
import strawberryfields as sf from strawberryfields import ops from strawberryfields.utils import random_interferometer from strawberryfields.apps import data, sample, subgraph, plot import plotly import networkx as nx import numpy as np class GBS: def __init__(self, samples =[], min_pho = 16, max_pho = 30, subgra...
[((621, 700), 'strawberryfields.apps.subgraph.search', 'subgraph.search', (['samples', 'pl_graph', 'subgraph_size', 'min_pho'], {'max_count': 'max_count'}), '(samples, pl_graph, subgraph_size, min_pho, max_count=max_count)\n', (636, 700), False, 'from strawberryfields.apps import data, sample, subgraph, plot\n'), ((121...
jenniexie/happy
happy/HappyNodeJoin.py
6ba01586e20bb3e4f92e180fd8dce3752519f7c9
#!/usr/bin/env python # # Copyright (c) 2015-2017 Nest Labs, Inc. # 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/licen...
[((3020, 3047), 'happy.HappyNetwork.HappyNetwork.__init__', 'HappyNetwork.__init__', (['self'], {}), '(self)\n', (3041, 3047), False, 'from happy.HappyNetwork import HappyNetwork\n'), ((3056, 3080), 'happy.HappyNode.HappyNode.__init__', 'HappyNode.__init__', (['self'], {}), '(self)\n', (3074, 3080), False, 'from happy....
SDRAST/Data_Reduction
__init__.py
f007d716b5c28c086910a81206cffaf37ff6368c
# -*- coding: utf-8 -*- """ Modules to support data reduction in Python. The main purpose of the base module ``Data_Reduction`` is to provide a suplerclass with a good set of attributes and methods to cover all common needs. The base module is also able to read data from a text file as a ``numpy`` structured array. ...
[((2597, 2637), 'readline.parse_and_bind', 'readline.parse_and_bind', (['"""tab: complete"""'], {}), "('tab: complete')\n", (2620, 2637), False, 'import readline\n'), ((2648, 2675), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2665, 2675), False, 'import logging\n'), ((43188, 43265), '...
HughPaynter/PyGRB
PyGRB/__init__.py
2eaf834cf3c62a639a056285ca9518456daa4b7c
""" PyGRB. A GRB light-curve analysis package. """ __version__ = "0.0.5" __author__ = 'James Paynter' from . import backend from . import fetch from . import main from . import postprocess from . import preprocess
[]
john9384/PyblogRestAPI
src/config.py
f8cd42b6ffd5ccc3224d18f71cbea654f05023d0
import os from dotenv import load_dotenv load_dotenv() class Config: SECRET_KEY = os.environ.get('SECRET_KEY') SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URI') MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 587 MAIL_USE_TLS = True MAIL_USERNAME = os.environ.get('EMAIL_USERNAME') MAIL_P...
[((41, 54), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (52, 54), False, 'from dotenv import load_dotenv\n'), ((88, 116), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (102, 116), False, 'import os\n'), ((147, 177), 'os.environ.get', 'os.environ.get', (['"""DATABASE_URI"...
Huda-Hakami/Context-Guided-Relation-Embeddings
Context_Guided_RelRep/train.py
520ce89fe7bad3aba2f3eb112329300625bb55f7
import numpy as np from wordreps import WordReps from algebra import cosine, normalize import tensorflow as tf import random from dataset import DataSet import CGRE_Model from Eval import eval_SemEval import sklearn.preprocessing # ============ End Imports ============ class Training(): def __init__(self): # Compo...
[((7593, 7603), 'wordreps.WordReps', 'WordReps', ([], {}), '()\n', (7601, 7603), False, 'from wordreps import WordReps\n'), ((7714, 7730), 'numpy.zeros', 'np.zeros', (['WR.dim'], {}), '(WR.dim)\n', (7722, 7730), True, 'import numpy as np\n'), ((8127, 8199), 'dataset.DataSet', 'DataSet', (['corpus', 'Train_dataset', 'Te...
HerculesJack/grtrans
synch_integrate.py
bc005307d81dac1bdb9520e776e7627126dd690a
from radtrans_integrate import radtrans_integrate from polsynchemis import polsynchemis import numpy as np import scipy.integrate # calculate synchrotron emissivity for given coefficients def synch_jarho(nu,n,B,T,theta): if ((np.isscalar(nu)==False) & (np.isscalar(n)==True)): n = n + np.zeros(len(nu)) ...
[((434, 477), 'polsynchemis.polsynchemis.polsynchth', 'polsynchemis.polsynchth', (['nu', 'n', 'B', 'T', 'theta'], {}), '(nu, n, B, T, theta)\n', (457, 477), False, 'from polsynchemis import polsynchemis\n'), ((800, 831), 'numpy.append', 'np.append', (['aarr', 'rhoarr'], {'axis': '(1)'}), '(aarr, rhoarr, axis=1)\n', (80...
pjimmybrcd/campus_ztp_nps
actions/lib/Template_Parser.py
2ab266b32fbcddcbdf9031138aabc40942914c3a
""" Copyright 2016 Brocade Communications Systems, 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 i...
[((1376, 1389), 'jinja2.Environment', 'Environment', ([], {}), '()\n', (1387, 1389), False, 'from jinja2 import Template, Environment, StrictUndefined, UndefinedError, meta\n'), ((1543, 1592), 'jinja2.Template', 'Template', (['self.profile'], {'undefined': 'StrictUndefined'}), '(self.profile, undefined=StrictUndefined)...
line-mind/lca_writer
lca_writer/data/loader.py
0f356cf20285ba684826dfdd18b75d0f0ebea120
import os __all__ = ['DATA_FOLDER', 'load_data'] DATA_FOLDER = os.path.dirname(os.path.abspath(__file__)) def load_data(name): """ Loads an Excel form from the data folder with the specified name. Parameters ---------- name : str The name of the form without file extension. """ ...
[((82, 107), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (97, 107), False, 'import os\n'), ((395, 436), 'os.path.join', 'os.path.join', (['DATA_FOLDER', "(name + '.xlsx')"], {}), "(DATA_FOLDER, name + '.xlsx')\n", (407, 436), False, 'import os\n')]
Dephilia/pipenv-docker-development
main.py
3be5f63120638922fe98336b6ee5b3b0f6f182dc
var = "Docker" print(f"Hello {var} world!")
[]
pndemo/yummy-recipes-api
app/v1/utils/mixins.py
ae6729bd1c886ce9872d83488a6eaa99e92be513
""" Model mixin classes for auth, category and recipe modules """ from app import db # pylint: disable=C0103 # pylint: disable=E1101 class BaseMixin(object): """ Define the 'BaseModel' mapped to all database tables. """ id = db.Column(db.Integer, primary_key=True, autoincrement=True) def save(self): ...
[((237, 296), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(db.Integer, primary_key=True, autoincrement=True)\n', (246, 296), False, 'from app import db\n'), ((363, 383), 'app.db.session.add', 'db.session.add', (['self'], {}), '(self)\n', (377, 383), False, 'fro...
JeroenvdSande/dash-sample-apps
apps/dash-port-analytics/app/ui/tab_map_controls.py
106fa24693cfdaf47c06466a0aed78e642344f91
import dash_core_components as dcc import dash_html_components as html from config import strings def make_tab_port_map_controls( port_arr: list, port_val: str, vessel_types_arr: list, vessel_type_val: str, year_arr: list, year_val: int, month_arr: list, month_val: int, ) -> html.Div: ...
[((1491, 1557), 'dash_html_components.Div', 'html.Div', ([], {'className': '"""tab-port-map-single-control-separator area-b"""'}), "(className='tab-port-map-single-control-separator area-b')\n", (1499, 1557), True, 'import dash_html_components as html\n'), ((2269, 2335), 'dash_html_components.Div', 'html.Div', ([], {'c...
TFarla/subs2srs-cross-platform
subs2srs/gui/state.py
79158a313ca4099adb20df97207b19d7bc948697
from typing import List from subs2srs.core.preview_item import PreviewItem class StatePreview: items: List[PreviewItem] = [] inactive_items = set() def __init__(self): super().__init__() self.items = [] self.inactive_items = set() self.audio = None class State: deck_...
[]
nirav1997/sync_ends
sync_ends/main.py
04e39ec26ac43ad4e6d4e1bdf685eb73c03b1dbb
import sys sys.path.append("..") from src.sync_ends_service import SyncEnd from src.parser import Parser def main(): # get the arguments from commadn line parser = Parser() collection_name, api_key, trigger_interval, slack_channel, slack_token = parser.get_argumenets() sync_end = SyncEnd(api_key, co...
[((12, 33), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (27, 33), False, 'import sys\n'), ((176, 184), 'src.parser.Parser', 'Parser', ([], {}), '()\n', (182, 184), False, 'from src.parser import Parser\n'), ((301, 380), 'src.sync_ends_service.SyncEnd', 'SyncEnd', (['api_key', 'collection_name'...
0xflotus/graphql-compiler
graphql_compiler/compiler/workarounds/orientdb_query_execution.py
0c892f5254d0cf3d03a68012080d0b736bc49913
# Copyright 2018-present Kensho Technologies, LLC. """Workarounds for OrientDB scheduler issue that causes poor query planning for certain queries. For purposes of query planning, the OrientDB query planner ignores "where:" clauses that hit indexes but do not use the "=" operator. For example, "CONTAINS" can be used t...
[]
ofalk/cleware-traffic-light
traffic_light/core.py
be319fec8e190811463ade8aabc37ca2b4f17e57
from enum import IntEnum import functools import usb.core import usb.util from traffic_light.error import TrafficLightError, MultipleTrafficLightsError BM_REQUEST_TYPE = 0x21 B_REQUEST = 0x09 W_VALUE = 0x200 W_INDEX = 0x00 ID_VENDOR = 0x0d50 ID_PRODUCT = 0x0008 INTERFACE = 0 class Color(IntEnum): RED = 0x10 ...
[((3429, 3474), 'functools.partial', 'functools.partial', (['self.set_led', 'color', 'state'], {}), '(self.set_led, color, state)\n', (3446, 3474), False, 'import functools\n'), ((1131, 1184), 'traffic_light.error.TrafficLightError', 'TrafficLightError', (['"""Cleware traffic light not found!"""'], {}), "('Cleware traf...
dubiety/azure-sdk-for-python
sdk/cognitivelanguage/azure-ai-language-conversations/samples/async/sample_analyze_orchestration_app_luis_response_async.py
62ffa839f5d753594cf0fe63668f454a9d87a346
# coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ """ FILE: sample_analyze_orchestration_app_luis_response_async.py DESCRIPTION: This sample demonstrates how to analyze user query using an orchestra...
[((3586, 3610), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (3608, 3610), False, 'import asyncio\n'), ((1731, 1758), 'azure.core.credentials.AzureKeyCredential', 'AzureKeyCredential', (['clu_key'], {}), '(clu_key)\n', (1749, 1758), False, 'from azure.core.credentials import AzureKeyCredential\...
la-mar/sunstruck-api
src/sunstruck/schemas/__init__.py
90074a55d3b243f7f0eee6e897a98699d2cebc43
# flake8: noqa from schemas.client_credentials import * from schemas.message import * from schemas.token import * from schemas.user import *
[]
terziev-viktor/SolidityCourse
intro/deploy.py
6f10852e94eec69438c5e577795d317694227337
import json from web3 import Web3 from solcx import compile_standard, install_solc with open("./SimpleStorage.sol", "r") as file: simple_storage_src = file.read() # install solcx install_solc("0.8.0") # compile the source compiled_sol = compile_standard( { "language": "Solidity", "sources": ...
[((186, 207), 'solcx.install_solc', 'install_solc', (['"""0.8.0"""'], {}), "('0.8.0')\n", (198, 207), False, 'from solcx import compile_standard, install_solc\n'), ((245, 489), 'solcx.compile_standard', 'compile_standard', (["{'language': 'Solidity', 'sources': {'SimpleStorage.sol': {'content':\n simple_storage_src}...
mgp25/noise
noise/extras/meta/protocol/protocol.py
8560849fa4a1d6e938adde27d26572f4da16e422
from noise.dh.dh import DH from noise.cipher.cipher import Cipher from noise.hash.hash import Hash from noise.processing.handshakepatterns.handshakepattern import HandshakePattern from noise.processing.impl.handshakestate import HandshakeState from noise.processing.impl.symmetricstate import SymmetricState from noise....
[((1424, 1459), 'noise.processing.impl.cipherstate.CipherState', 'CipherState', (['(cipher or self._cipher)'], {}), '(cipher or self._cipher)\n', (1435, 1459), False, 'from noise.processing.impl.cipherstate import CipherState\n'), ((848, 901), 'noise.processing.handshakepatterns.handshakepattern.HandshakePattern.parse_...
cartazio/SublimeHaskell
info_popup.py
e6f12ea69de939d12212a6ec594bf0aae0603f6d
import urllib.parse import webbrowser import json from xml.etree import ElementTree import sublime import SublimeHaskell.sublime_haskell_common as Common import SublimeHaskell.internals.utils as Utils import SublimeHaskell.internals.unicode_opers as UnicodeOpers import SublimeHaskell.symbols as symbols import Sublim...
[((8691, 8716), 'SublimeHaskell.internals.utils.head_of', 'Utils.head_of', (['filt_types'], {}), '(filt_types)\n', (8704, 8716), True, 'import SublimeHaskell.internals.utils as Utils\n'), ((1436, 1470), 'sublime.load_resource', 'sublime.load_resource', (['scheme_path'], {}), '(scheme_path)\n', (1457, 1470), False, 'imp...
artizanatweb/ghome-assistant
modules/google_home_lights.py
dba2bc58979ebae48afc71c356ae2d40b8830eee
#!/usr/bin/env python # Copyright (C) 2017 Seeed Technology Limited # # 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 ...
[((4110, 4126), 'modules.pixel_ring.pixel_ring.off', 'pixel_ring.off', ([], {}), '()\n', (4124, 4126), False, 'from modules.pixel_ring import pixel_ring\n'), ((849, 874), 'numpy.array', 'numpy.array', (['([0] * 4 * 12)'], {}), '([0] * 4 * 12)\n', (860, 874), False, 'import numpy\n'), ((1124, 1157), 'modules.pixel_ring....