repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
MTES-MCT/sparte
public_data/serializers.py
3b8ae6d21da81ca761d64ae9dfe2c8f54487211c
from rest_framework_gis import serializers from rest_framework import serializers as s from .models import ( Artificialisee2015to2018, Artificielle2018, CommunesSybarval, CouvertureSol, EnveloppeUrbaine2018, Ocsge, Renaturee2018to2015, Sybarval, Voirie2018, ZonesBaties2018, ...
[((590, 615), 'rest_framework.serializers.SerializerMethodField', 's.SerializerMethodField', ([], {}), '()\n', (613, 615), True, 'from rest_framework import serializers as s\n'), ((633, 658), 'rest_framework.serializers.SerializerMethodField', 's.SerializerMethodField', ([], {}), '()\n', (656, 658), True, 'from rest_fr...
naman1901/django-quick-search
quick_search/admin.py
7b93554ed9fa4721e52372f9fd1a395d94cc04a7
from django.contrib import admin from .models import SearchResult # Register your models here. class SearchResultAdmin(admin.ModelAdmin): fields = ["query", "heading", "url", "text"] admin.site.register(SearchResult, SearchResultAdmin)
[((189, 241), 'django.contrib.admin.site.register', 'admin.site.register', (['SearchResult', 'SearchResultAdmin'], {}), '(SearchResult, SearchResultAdmin)\n', (208, 241), False, 'from django.contrib import admin\n')]
Amirali-Shirkh/rasa-for-botfront
rasa/train.py
36aa24ad31241c5d1a180bbe34e1c8c50da40ff7
import asyncio import os import tempfile from contextlib import ExitStack from typing import Text, Optional, List, Union, Dict from rasa.importers.importer import TrainingDataImporter from rasa import model from rasa.model import FingerprintComparisonResult from rasa.core.domain import Domain from rasa.utils.common im...
[((3729, 3952), 'rasa.cli.utils.print_warning', 'print_warning', (['"""Core training was skipped because no valid domain file was found. Only an nlu-model was created.Please specify a valid domain using \'--domain\' argument or check if the provided domain file exists."""'], {}), '(\n "Core training was skipped beca...
Jahidul007/Python-Bootcamp
coding_intereview/1475. Final Prices With a Special Discount in a Shop.py
3c870587465ff66c2c1871c8d3c4eea72463abda
class Solution: def finalPrices(self, prices: List[int]) -> List[int]: res = [] for i in range(len(prices)): for j in range(i+1,len(prices)): if prices[j]<=prices[i]: res.append(prices[i]-prices[j]) break if j==len(p...
[]
timgates42/denite.nvim
rplugin/python3/denite/ui/default.py
12a9b5456f5a4600afeb0ba284ce1098bd35e501
# ============================================================================ # FILE: default.py # AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com> # License: MIT license # ============================================================================ import re import typing from denite.util import echo, error, c...
[((5612, 5675), 're.search', 're.search', (['"""\\\\[Command Line\\\\]$"""', 'self._vim.current.buffer.name'], {}), "('\\\\[Command Line\\\\]$', self._vim.current.buffer.name)\n", (5621, 5675), False, 'import re\n'), ((31002, 31023), 'denite.util.clearmatch', 'clearmatch', (['self._vim'], {}), '(self._vim)\n', (31012, ...
yuanz271/PyDSTool
PyDSTool/core/context_managers.py
886c143cdd192aea204285f3a1cb4968c763c646
# -*- coding: utf-8 -*- """Context managers implemented for (mostly) internal use""" import contextlib import functools from io import UnsupportedOperation import os import sys __all__ = ["RedirectStdout", "RedirectStderr"] @contextlib.contextmanager def _stdchannel_redirected(stdchannel, dest_filename, mode="w")...
[((1137, 1190), 'functools.partial', 'functools.partial', (['_stdchannel_redirected', 'sys.stdout'], {}), '(_stdchannel_redirected, sys.stdout)\n', (1154, 1190), False, 'import functools\n'), ((1208, 1261), 'functools.partial', 'functools.partial', (['_stdchannel_redirected', 'sys.stderr'], {}), '(_stdchannel_redirecte...
Muzzy73/pos_kiosk
pos_kiosk/hooks.py
1ed42cfaeb15f009293b76d05dd85bd322b42f03
# -*- coding: utf-8 -*- from __future__ import unicode_literals from . import __version__ as app_version app_name = "pos_kiosk" app_title = "Pos Kiosk" app_publisher = "9t9it" app_description = "Kiosk App" app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "info@9t9it.com" app_license = "MIT" ...
[]
gcouti/pypagAI
pypagai/models/model_lstm.py
d08fac95361dcc036d890a88cb86ce090322a612
from keras import Model, Input from keras.layers import Dense, concatenate, LSTM, Reshape, Permute, Embedding, Dropout, Convolution1D, Flatten from keras.optimizers import Adam from pypagai.models.base import KerasModel class SimpleLSTM(KerasModel): """ Use a simple lstm neural network """ @staticmet...
[((367, 394), 'pypagai.models.base.KerasModel.default_config', 'KerasModel.default_config', ([], {}), '()\n', (392, 394), False, 'from pypagai.models.base import KerasModel\n'), ((620, 662), 'keras.Input', 'Input', (['(self._story_maxlen,)'], {'name': '"""story"""'}), "((self._story_maxlen,), name='story')\n", (625, 66...
joelouismarino/variational_rl
lib/variables/latent_variables/__init__.py
11dc14bfb56f3ebbfccd5de206b78712a8039a9a
from .fully_connected import FullyConnectedLatentVariable from .convolutional import ConvolutionalLatentVariable
[]
lpj0822/image_point_cloud_det
easyai/model/backbone/cls/pnasnet.py
7b20e2f42f3f2ff4881485da58ad188a1f0d0e0f
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: ''' PNASNet in PyTorch. Paper: Progressive Neural Architecture Search ''' from easyai.base_name.block_name import NormalizationType, ActivationType from easyai.base_name.backbone_name import BackboneName from easyai.model.backbone.utility.base_backbone import * fr...
[((1225, 1425), 'easyai.model.base_block.utility.utility_block.ConvBNActivationBlock', 'ConvBNActivationBlock', ([], {'in_channels': 'self.data_channel', 'out_channels': 'self.first_output', 'kernel_size': '(3)', 'stride': '(1)', 'padding': '(1)', 'bias': '(False)', 'bnName': 'self.bn_name', 'activationName': 'self.act...
cugxy/map_download
map_download/cmd/TerrainDownloader.py
02142b33edb2bc163f7ae971f443efe84c13e029
# -*- coding: utf-8 -*- # coding=utf-8 import json import os import math import logging import requests import time from map_download.cmd.BaseDownloader import DownloadEngine, BaseDownloaderThread, latlng2tile_terrain, BoundBox def get_access_token(token): resp = None request_count = 0 url = "https://ap...
[((1646, 1671), 'os.path.exists', 'os.path.exists', (['file_path'], {}), '(file_path)\n', (1660, 1671), False, 'import os\n'), ((3201, 3251), 'map_download.cmd.BaseDownloader.latlng2tile_terrain', 'latlng2tile_terrain', (['bbox.min_lat', 'bbox.min_lng', 'z'], {}), '(bbox.min_lat, bbox.min_lng, z)\n', (3220, 3251), Fals...
dineshsonachalam/kubernetes_asyncio
kubernetes_asyncio/client/api/rbac_authorization_v1_api.py
d57e9e9be11f6789e1ce8d5b161acb64d29acf35
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1.12.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import r...
[((3640, 3671), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (3653, 3671), False, 'import six\n'), ((8908, 8939), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (8921, 8939), False, 'import six\n'), ((14361, 14392), 'six.iteritems', 'six.it...
vahini01/electoral_rolls
tools/utils.py
82e42a6ee68844b1c8ac7899e8e7bf7a24e48d44
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 10 23:28:58 2017 @author: dhingratul """ import urllib.request import os from selenium import webdriver from selenium.webdriver.support.ui import Select from bs4 import BeautifulSoup import ssl import requests import wget from PyPDF2 import PdfFileR...
[((859, 903), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', ([], {}), '()\n', (901, 903), False, 'import requests\n'), ((1734, 1766), 'wget.download', 'wget.download', (['pdf_url', 'filename'], {}), '(pdf_url, filename)\n', (1747, 1766), False, 'import wget\n'), ((1901, 191...
ellencwade/coronavirus-2020
exp/viz_raw_manhattan.py
b71e018deb8df8450b4d88ddbcd6ded6497aa8f9
""" Experiment summary ------------------ Treat each province/state in a country cases over time as a vector, do a simple K-Nearest Neighbor between countries. What country has the most similar trajectory to a given country? Plots similar countries """ import sys sys.path.insert(0, '..') from utils import data impor...
[((266, 290), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (281, 290), False, 'import sys\n'), ((404, 436), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (417, 436), True, 'import matplotlib.pyplot as plt\n'), ((587, 687), 'o...
steven-lang/rational_activations
rational/mxnet/rationals.py
234623dbb9360c215c430185b09e2237d5186b54
""" Rational Activation Functions for MXNET ======================================= This module allows you to create Rational Neural Networks using Learnable Rational activation functions with MXNET networks. """ import mxnet as mx from mxnet import initializer from mxnet.gluon import HybridBlock from rational.utils....
[((2290, 2335), 'rational.utils.get_weights.get_parameters', 'get_parameters', (['version', 'degrees', 'approx_func'], {}), '(version, degrees, approx_func)\n', (2304, 2335), False, 'from rational.utils.get_weights import get_parameters\n'), ((2436, 2460), 'mxnet.nd.array', 'mx.nd.array', (['w_numerator'], {}), '(w_num...
Neklaustares-tPtwP/torchflare
torchflare/criterion/utils.py
7af6b01ef7c26f0277a041619081f6df4eb1e42c
"""Utils for criterion.""" import torch import torch.nn.functional as F def normalize(x, axis=-1): """Performs L2-Norm.""" num = x denom = torch.norm(x, 2, axis, keepdim=True).expand_as(x) + 1e-12 return num / denom # Source : https://github.com/earhian/Humpback-Whale-Identification-1st-/blob/master...
[((738, 759), 'torch.nn.functional.normalize', 'F.normalize', (['x'], {'dim': '(1)'}), '(x, dim=1)\n', (749, 759), True, 'import torch.nn.functional as F\n'), ((768, 789), 'torch.nn.functional.normalize', 'F.normalize', (['y'], {'dim': '(1)'}), '(y, dim=1)\n', (779, 789), True, 'import torch.nn.functional as F\n'), ((1...
eloo/sensor.sbahn_munich
tests/__init__.py
05e05a845178ab529dc4c80e924035fe1d072b55
"""Tests for the sbahn_munich integration""" line_dict = { "name": "S3", "color": "#333333", "text_color": "#444444", }
[]
geudrik/hautomation
app/views/web/homestack.py
0baae29e85cd68658a0f8578de2e36e42945053f
#! /usr/bin/env python2.7 # -*- coding: latin-1 -*- from flask import Blueprint from flask import current_app from flask import render_template from flask_login import login_required homestack = Blueprint("homestack", __name__, url_prefix="/homestack") @homestack.route("/", methods=["GET"]) @login_required def hom...
[((198, 255), 'flask.Blueprint', 'Blueprint', (['"""homestack"""', '__name__'], {'url_prefix': '"""/homestack"""'}), "('homestack', __name__, url_prefix='/homestack')\n", (207, 255), False, 'from flask import Blueprint\n'), ((336, 374), 'flask.render_template', 'render_template', (['"""homestack/home.html"""'], {}), "(...
gamearming/readthedocs
readthedocs/donate/forms.py
53d0094f657f549326a86b8bd0ccf924c2126941
"""Forms for RTD donations""" import logging from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from readthedocs.payments.forms import StripeModelForm, StripeResourceMixin from readthedocs.payments.utils import stripe from .models import Supporter log ...
[((322, 349), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (339, 349), False, 'import logging\n'), ((2007, 2037), 'django.forms.CharField', 'forms.CharField', ([], {'required': '(True)'}), '(required=True)\n', (2022, 2037), False, 'from django import forms\n'), ((2050, 2080), 'django.fo...
movermeyer/pandas_datareaders_unofficial
pandas_datareaders_unofficial/datareaders/google_finance_options.py
458dcf473d070cd7686d53d4a9b479cbe0ab9218
#!/usr/bin/env python # -*- coding: utf-8 -*- from .base import DataReaderBase from ..tools import COL, _get_dates, to_float, to_int import pandas as pd #from pandas.tseries.frequencies import to_offset from six.moves import cStringIO as StringIO import logging import traceback import datetime import json import tok...
[((588, 625), 'datetime.date', 'datetime.date', ([], {'year': 'y', 'month': 'm', 'day': 'd'}), '(year=y, month=m, day=d)\n', (601, 625), False, 'import datetime\n'), ((2146, 2173), 'tokenize.untokenize', 'tokenize.untokenize', (['result'], {}), '(result)\n', (2165, 2173), False, 'import token, tokenize\n'), ((6240, 625...
Vail-qin/Keras-TextClassification
keras_textclassification/data_preprocess/generator_preprocess.py
8acda5ae37db2647c8ecaa70027ffc6003d2abca
# !/usr/bin/python # -*- coding: utf-8 -*- # @time : 2019/11/2 21:08 # @author : Mo # @function: from keras_textclassification.data_preprocess.text_preprocess import load_json, save_json from keras_textclassification.conf.path_config import path_model_dir path_fast_text_model_vocab2index = path_model_dir + 'vocab...
[((572, 616), 'os.path.exists', 'os.path.exists', (['path_fast_text_model_l2i_i2l'], {}), '(path_fast_text_model_l2i_i2l)\n', (586, 616), False, 'import os\n'), ((733, 777), 'os.path.exists', 'os.path.exists', (['path_fast_text_model_l2i_i2l'], {}), '(path_fast_text_model_l2i_i2l)\n', (747, 777), False, 'import os\n'),...
metux/chromium-deb
content/test/gpu/gpu_tests/pixel_expectations.py
3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_tests.gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpec...
[]
18F/data-federation-ingest
examples/p02_budgets/budget_data_ingest/migrations/0001_initial.py
a896ef2da1faf3966f018366b26a338bb66cc717
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-06-08 22:54 from __future__ import unicode_literals from django.conf import settings import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial ...
[((357, 414), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (388, 414), False, 'from django.db import migrations, models\n'), ((2688, 2787), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'djang...
Kaslanarian/PythonSVM
setup.py
715eeef2a245736167addf45a6aee8b40b54d0c7
import setuptools #enables develop setuptools.setup( name='pysvm', version='0.1', description='PySVM : A NumPy implementation of SVM based on SMO algorithm', author_email="191300064@smail.nju.edu.cn", packages=['pysvm'], license='MIT License', long_description=open('README.md', encoding='u...
[]
hiperus0988/pyao
Object_detection_image.py
72c56975a3d45aa033bdf7650b5369d59240395f
######## Image Object Detection Using Tensorflow-trained Classifier ######### # # Author: Evan Juras # Date: 1/15/18 # Description: # This program uses a TensorFlow-trained classifier to perform object detection. # It loads the classifier uses it to perform object detection on an image. # It draws boxes and scores aro...
[((897, 918), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (912, 918), False, 'import sys\n'), ((1206, 1217), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1215, 1217), False, 'import os\n'), ((1339, 1402), 'os.path.join', 'os.path.join', (['CWD_PATH', 'MODEL_NAME', '"""frozen_inference_graph.pb...
chris48s/UK-Polling-Stations
polling_stations/apps/data_collection/management/commands/import_torbay.py
4742b527dae94f0276d35c80460837be743b7d17
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E06000027' addresses_name = 'parl.2017-06-08/Version 1/Torbay Democracy_Club__08June2017.tsv' stations_name = 'parl.2017-06-08/Version 1/Torbay Democracy_Club_...
[]
Bhavya0020/Readopolis
Backend/product/views.py
a0053e4fae97dc8291b50c746f3dc3e6b454ad95
from django.db.models import Q from django.shortcuts import render from django.http import Http404 # Create your views here. from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.decorators import api_view from .models import Product, Category from .serializers imp...
[((1481, 1499), 'rest_framework.decorators.api_view', 'api_view', (["['POST']"], {}), "(['POST'])\n", (1489, 1499), False, 'from rest_framework.decorators import api_view\n'), ((559, 584), 'rest_framework.response.Response', 'Response', (['serializer.data'], {}), '(serializer.data)\n', (567, 584), False, 'from rest_fra...
hubogeri/python_training
model/contact.py
7a918040e4c8bae5a031134911bc8b465f322699
from sys import maxsize class Contact: def __init__(self, fname=None, mname=None, lname=None, nick=None, title=None, comp=None, addr=None, home=None, mobile=None, work=None, fax=None, email1=None, email2=None, email3=None, homepage=None, bday=None, bmonth=None, byear=None, aday=...
[]
ericmehl/cortex
test/IECore/BasicPreset.py
054839cc709ce153d1bcaaefe7f340ebe641ec82
########################################################################## # # Copyright (c) 2010-2012, Image Engine Design 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: # # * Redis...
[((11326, 11341), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11339, 11341), False, 'import unittest\n'), ((1977, 2019), 'IECore.Parameterised', 'IECore.Parameterised', (['"""testParameterised1"""'], {}), "('testParameterised1')\n", (1997, 2019), False, 'import IECore\n'), ((2174, 2216), 'IECore.Parameterised'...
imanolarrieta/RL
rlpy/Domains/Pacman.py
072a8c328652f45e053baecd640f04adf7f84b49
"""Pacman game domain.""" from rlpy.Tools import __rlpy_location__ from .Domain import Domain from .PacmanPackage import layout, pacman, game, ghostAgents from .PacmanPackage import graphicsDisplay import numpy as np from copy import deepcopy import os import time __copyright__ = "Copyright 2013, RLPy http://acl.mit.e...
[((2321, 2391), 'os.path.join', 'os.path.join', (['__rlpy_location__', '"""Domains"""', '"""PacmanPackage"""', '"""layouts"""'], {}), "(__rlpy_location__, 'Domains', 'PacmanPackage', 'layouts')\n", (2333, 2391), False, 'import os\n'), ((2483, 2536), 'os.path.join', 'os.path.join', (['default_layout_dir', '"""trickyClas...
rickdg/vivi
core/src/zeit/cms/settings/interfaces.py
16134ac954bf8425646d4ad47bdd1f372e089355
from zeit.cms.i18n import MessageFactory as _ import zope.interface import zope.schema class IGlobalSettings(zope.interface.Interface): """Global CMS settings.""" default_year = zope.schema.Int( title=_("Default year"), min=1900, max=2100) default_volume = zope.schema.Int( ...
[((220, 237), 'zeit.cms.i18n.MessageFactory', '_', (['"""Default year"""'], {}), "('Default year')\n", (221, 237), True, 'from zeit.cms.i18n import MessageFactory as _\n'), ((328, 347), 'zeit.cms.i18n.MessageFactory', '_', (['"""Default volume"""'], {}), "('Default volume')\n", (329, 347), True, 'from zeit.cms.i18n imp...
c-yan/atcoder
abc/abc165/abc165e.py
940e49d576e6a2d734288fadaf368e486480a948
N, M = map(int, input().split()) for i in range(1, M + 1): if i % 2 == 1: j = (i - 1) // 2 print(1 + j, M + 1 - j) else: j = (i - 2) // 2 print(M + 2 + j, 2 * M + 1 - j)
[]
giggslam/python-messengerbot-sdk
setup.py
4a6fadf96fe3425da9abc4726fbb84db6d84f7b5
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
[((787, 840), 're.compile', 're.compile', (['"""__version__ = [\\\\\'"]([^\\\\\'"]*)[\\\\\'"]"""'], {}), '(\'__version__ = [\\\\\\\'"]([^\\\\\\\'"]*)[\\\\\\\'"]\')\n', (797, 840), False, 'import re\n')]
MaximovaIrina/transformers
src/transformers/models/mmbt/modeling_mmbt.py
033c3ed95a14b58f5a657f5124bc5988e4109c9f
# coding=utf-8 # Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) HuggingFace Inc. 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://www.apache.org/licenses...
[((1407, 1462), 'torch.nn.Linear', 'nn.Linear', (['config.modal_hidden_size', 'config.hidden_size'], {}), '(config.modal_hidden_size, config.hidden_size)\n', (1416, 1462), False, 'from torch import nn\n'), ((1726, 1766), 'torch.nn.Dropout', 'nn.Dropout', ([], {'p': 'config.hidden_dropout_prob'}), '(p=config.hidden_drop...
mhchia/trinity
eth2/beacon/chains/base.py
e40e475064ca4605887706e9b0e4f8e2349b10cd
from abc import ( ABC, abstractmethod, ) import logging from typing import ( TYPE_CHECKING, Tuple, Type, ) from eth._utils.datatypes import ( Configurable, ) from eth.db.backends.base import ( BaseAtomicDB, ) from eth.exceptions import ( BlockNotFound, ) from eth.validation import ( ...
[((3951, 4002), 'logging.getLogger', 'logging.getLogger', (['"""eth2.beacon.chains.BeaconChain"""'], {}), "('eth2.beacon.chains.BeaconChain')\n", (3968, 4002), False, 'import logging\n'), ((6761, 6780), 'eth2.beacon.validation.validate_slot', 'validate_slot', (['slot'], {}), '(slot)\n', (6774, 6780), False, 'from eth2....
allupramodreddy/cisco_py
using_paramiko.py
5488b56d9324011860b78998e694dcce6da5e3d1
#!/usr/local/bin/python3 import paramiko,time #using as SSH Client client = paramiko.SSHClient() # check dir(client) to find available options. # auto adjust host key verification with yes or no client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # time for connecting to remote Cisco IOS """ Manually taki...
[((79, 99), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (97, 99), False, 'import paramiko, time\n'), ((234, 258), 'paramiko.AutoAddPolicy', 'paramiko.AutoAddPolicy', ([], {}), '()\n', (256, 258), False, 'import paramiko, time\n'), ((564, 584), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\...
pscly/bisai1
old/.history/a_20201125192943.py
e619186cec5053a8e02bd59e48fc3ad3af47d19a
# for n in range(400,500): # i = n // 100 # j = n // 10 % 10 # k = n % 10 # if n == i ** 3 + j ** 3 + k ** 3: # print(n) # 第一道题(16) # input("请输入(第一次):") # s1 = input("请输入(第二次):") # l1 = s1.split(' ') # l2 = [] # for i in l1: # if i.isdigit(): # l2.append(int(i)) # for i in l2: # ...
[]
muggat0n/graphdb
graphdb/transformer.py
56dfd5ef8a3321abc6a919faee47494bbe059080
""" A query transformer is a function that accepts a program and returns a program, plus a priority level. Higher priority transformers are placed closer to the front of the list. We’re ensuring is a function, because we’re going to evaluate it later 31 . We’ll assume there won’t be an enormous number of transformer ad...
[]
lixuemin13/yz-core
yzcore/templates/project_template/src/const/_job.py
82774f807ac1002b77d0cc90f6695b1cc6ba0820
#!/usr/bin/python3.6.8+ # -*- coding:utf-8 -*- """ @auth: cml @date: 2020-12-2 @desc: ... """ class JobStatus(object): PENDING = 0 # 任务等待执行 STARTED = 100 # 任务执行开始 PROCESS = 110 POLLING = 120 CALLBACK = 130 SUCCESS = 200 # 任务执行成功 RETRY = 300 # 任务重试 FAILURE = 400 # 任务执行失败 ...
[]
RenanPalmeira/pyboleto
pyboleto/html.py
7b12a7a2f7e92cad5f35f843ae67c397b6f7e36e
# -*- coding: utf-8 -*- """ pyboleto.html ~~~~~~~~~~~~~ Classe Responsável por fazer o output do boleto em html. :copyright: © 2012 by Artur Felipe de Sousa :license: BSD, see LICENSE for more details. """ import os import string import sys import codecs import base64 from itertools import chain...
[((2242, 2291), 'os.path.join', 'os.path.join', (['pyboleto_dir', '"""templates"""', 'template'], {}), "(pyboleto_dir, 'templates', template)\n", (2254, 2291), False, 'import os\n'), ((2539, 2586), 'os.path.join', 'os.path.join', (['pyboleto_dir', '"""media"""', 'logo_image'], {}), "(pyboleto_dir, 'media', logo_image)\...
emir-naiz/first_git_lesson
Courses/1 month/2 week/day 6/Formula.py
1fecf712290f6da3ef03deff518870d91638eb69
summary = 0 i = 0 while i < 5: summary = summary + i print(summary) i = i + 1
[]
Vicken-Ghoubiguian/Imtreat
tests/image_saver/image_saver_7.py
1f8e8406dc48af3b1e8e0c138a09aa1faee0b8a0
import imtreat img = imtreat.imageManagerClass.openImageFunction("../images/soleil.png", 0) img = imtreat.definedModesClass.detailEnhanceFunction(img) imtreat.imageManagerClass.saveImageFunction("/Téléchargements/", "image_1", ".png", img)
[((22, 92), 'imtreat.imageManagerClass.openImageFunction', 'imtreat.imageManagerClass.openImageFunction', (['"""../images/soleil.png"""', '(0)'], {}), "('../images/soleil.png', 0)\n", (65, 92), False, 'import imtreat\n'), ((100, 152), 'imtreat.definedModesClass.detailEnhanceFunction', 'imtreat.definedModesClass.detailE...
raubvogel/nova
nova/conf/hyperv.py
b78be4e83cdc191e20a4a61b6aae72cb2b37f62b
# Copyright (c) 2016 TUBITAK BILGEM # 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 requir...
[((682, 873), 'oslo_config.cfg.OptGroup', 'cfg.OptGroup', (['"""hyperv"""'], {'title': '"""The Hyper-V feature"""', 'help': '"""\nThe hyperv feature allows you to configure the Hyper-V hypervisor\ndriver to be used within an OpenStack deployment.\n"""'}), '(\'hyperv\', title=\'The Hyper-V feature\', help=\n """\nThe...
theyadev/thierry-bot
src/fetchWords.py
f3c72998d4c16afbca77baf4cabaf0f547d51e94
import requests words_list = requests.get("https://raw.githubusercontent.com/atebits/Words/master/Words/fr.txt").text words_list = filter(lambda x: len(x) > 4, words_list.split('\n')) path = input("Chemin d'écriture ? (words.txt) ") if path == "": path = "./words.txt" with open(path, "w", encoding="utf-8") as ...
[((30, 118), 'requests.get', 'requests.get', (['"""https://raw.githubusercontent.com/atebits/Words/master/Words/fr.txt"""'], {}), "(\n 'https://raw.githubusercontent.com/atebits/Words/master/Words/fr.txt')\n", (42, 118), False, 'import requests\n')]
Zenahr/simple-music-gallery
inspiration/simplegallery/test/upload/variants/test_aws_uploader.py
2cf6e81208b721a91dcbf77e047c7f77182dd194
import unittest from unittest import mock import os import subprocess from testfixtures import TempDirectory from simplegallery.upload.uploader_factory import get_uploader class AWSUploaderTestCase(unittest.TestCase): def test_no_location(self): uploader = get_uploader('aws') self.assertFalse(upl...
[((352, 380), 'unittest.mock.patch', 'mock.patch', (['"""subprocess.run"""'], {}), "('subprocess.run')\n", (362, 380), False, 'from unittest import mock\n'), ((1607, 1622), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1620, 1622), False, 'import unittest\n'), ((272, 291), 'simplegallery.upload.uploader_factory....
kithsirij/NLP-based-Syllabus-Coverage-Exam-paper-checker-Tool
Qt_interface/add_subject.py
b7b38a7b7c6d0a2ad5264df32acd75cdef552bd0
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'add_subject.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: de...
[((6274, 6302), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (6292, 6302), False, 'from PyQt4 import QtCore, QtGui\n'), ((6329, 6344), 'PyQt4.QtGui.QDialog', 'QtGui.QDialog', ([], {}), '()\n', (6342, 6344), False, 'from PyQt4 import QtCore, QtGui\n'), ((472, 536), 'PyQt4.QtGui.Q...
mdj2/django
tests/syncdb_signals/tests.py
e71b63e280559122371d125d75a593dc2435c394
from django.db.models import signals from django.test import TestCase from django.core import management from django.utils import six from shared_models import models PRE_SYNCDB_ARGS = ['app', 'create_models', 'verbosity', 'interactive', 'db'] SYNCDB_DATABASE = 'default' SYNCDB_VERBOSITY = 1 SYNCDB_INTERACTIVE = Fal...
[((1676, 1738), 'django.db.models.signals.pre_syncdb.connect', 'signals.pre_syncdb.connect', (['pre_syncdb_receiver'], {'sender': 'models'}), '(pre_syncdb_receiver, sender=models)\n', (1702, 1738), False, 'from django.db.models import signals\n'), ((1956, 2000), 'django.db.models.signals.pre_syncdb.connect', 'signals.p...
gianscarpe/pytorch-lightning
pytorch_lightning/plugins/environments/slurm_environment.py
261ea90822e2bf1cfa5d56171ab1f95a81d5c571
# Copyright The PyTorch Lightning 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
[((720, 747), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (737, 747), False, 'import logging\n'), ((1246, 1278), 'os.environ.get', 'os.environ.get', (['"""SLURM_NODELIST"""'], {}), "('SLURM_NODELIST')\n", (1260, 1278), False, 'import os\n'), ((1848, 1878), 'os.environ.get', 'os.environ...
ginkage/trackball-python
examples/mouse.py
06439ac77935f7fd9374bd4f535822e859734729
#!/usr/bin/env python import time import os import math from trackball import TrackBall print("""Trackball: Mouse Use the trackball as a mouse in Raspbian, with right-click when the switch is pressed. Press Ctrl+C to exit! """) trackball = TrackBall(interrupt_pin=4) trackball.set_rgbw(0, 0, 0, 0) # Check for xte (...
[((244, 270), 'trackball.TrackBall', 'TrackBall', ([], {'interrupt_pin': '(4)'}), '(interrupt_pin=4)\n', (253, 270), False, 'from trackball import TrackBall\n'), ((353, 375), 'os.system', 'os.system', (['"""which xte"""'], {}), "('which xte')\n", (362, 375), False, 'import os\n'), ((909, 927), 'time.sleep', 'time.sleep...
artberryx/LSD
garaged/src/garage/tf/regressors/gaussian_mlp_regressor_model.py
99ee081de2502b4d13c140b474f772db8a5f92fe
"""GaussianMLPRegressorModel.""" import numpy as np import tensorflow as tf import tensorflow_probability as tfp from garage.experiment import deterministic from garage.tf.models import GaussianMLPModel class GaussianMLPRegressorModel(GaussianMLPModel): """GaussianMLPRegressor based on garage.tf.models.Model cla...
[((4085, 4107), 'tensorflow.zeros_initializer', 'tf.zeros_initializer', ([], {}), '()\n', (4105, 4107), True, 'import tensorflow as tf\n'), ((4309, 4331), 'tensorflow.zeros_initializer', 'tf.zeros_initializer', ([], {}), '()\n', (4329, 4331), True, 'import tensorflow as tf\n'), ((4800, 4822), 'tensorflow.zeros_initiali...
kim-sunghoon/DiracDeltaNet
test.py
7bcc0575f28715d9c7f737f8a239718320f9c05b
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision import torchvision.transforms as transforms import torchvision.datasets as datasets import os import argparse from torch.autograd import Variable from e...
[((574, 639), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch imagenet inference"""'}), "(description='PyTorch imagenet inference')\n", (597, 639), False, 'import argparse\n'), ((863, 896), 'os.path.join', 'os.path.join', (['args.datadir', '"""val"""'], {}), "(args.datadir, 'val')...
PaccMann/paccmann_chemistry
paccmann_chemistry/utils/hyperparams.py
f7e9735aafb936f837c38b5055c654be178f385f
"""Model Parameters Module.""" import torch.optim as optim from .search import SamplingSearch, GreedySearch, BeamSearch SEARCH_FACTORY = { 'sampling': SamplingSearch, 'greedy': GreedySearch, 'beam': BeamSearch, } OPTIMIZER_FACTORY = { 'adadelta': optim.Adadelta, 'adagrad': optim.Adagrad, 'adam...
[]
francescodonato/GPflux
tests/gpflux/layers/test_latent_variable_layer.py
fe45b353243b31d9fa0ec0daeb1d39a2e78ba094
# # Copyright (c) 2021 The GPflux Contributors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
[((897, 935), 'tensorflow.keras.backend.set_floatx', 'tf.keras.backend.set_floatx', (['"""float64"""'], {}), "('float64')\n", (924, 935), True, 'import tensorflow as tf\n'), ((2330, 2370), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""w_dim"""', '[1, 5]'], {}), "('w_dim', [1, 5])\n", (2353, 2370), False, ...
actingweb/box-actingweb
aw-actor-trust.py
f586458484649aba927cd78c60b4d0fec7b82ca6
#!/usr/bin/env python # from actingweb import actor from actingweb import config from actingweb import trust from actingweb import auth import webapp2 import os from google.appengine.ext.webapp import template import json import logging import datetime import time # /trust handlers # # GET /trust with query paramet...
[((1525, 1578), 'actingweb.auth.init_actingweb', 'auth.init_actingweb', ([], {'appreq': 'self', 'id': 'id', 'path': '"""trust"""'}), "(appreq=self, id=id, path='trust')\n", (1544, 1578), False, 'from actingweb import auth\n'), ((2778, 2795), 'json.dumps', 'json.dumps', (['pairs'], {}), '(pairs)\n', (2788, 2795), False,...
IamEld3st/RLBot
src/main/python/rlbot/version.py
36195ffd3a836ed910ce63aed8ba103b98b7b361
# Store the version here so: # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason # 3) we can import it into your module module # https://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package __version__ = '1.6.1' release_note...
[]
muffin-rice/pad-cogs
dungeoncog/enemy_skills_pb2.py
820ecf08f9569a3d7cf3264d0eb9567264b42edf
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: enemy_skills.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.pr...
[((418, 444), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (442, 444), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((459, 3368), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""enemy_skills.proto"""'...
dlegor/ClassyVision
classy_vision/heads/fully_connected_head.py
9c82d533b66b0a5fbb11f8ab3567a9c70aa4e013
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Dict import torch.nn as nn from classy_vision.generic.util import is_pos_int from classy_visio...
[((364, 396), 'classy_vision.heads.register_head', 'register_head', (['"""fully_connected"""'], {}), "('fully_connected')\n", (377, 396), False, 'from classy_vision.heads import ClassyHead, register_head\n'), ((1345, 1365), 'classy_vision.generic.util.is_pos_int', 'is_pos_int', (['in_plane'], {}), '(in_plane)\n', (1355...
StanleyHou117/group66_LentTermProject
Task2C.py
0255310cb202f21cada8cf7c0f45a045a9b72c1f
from floodsystem.stationdata import build_station_list from floodsystem.flood import stations_highest_rel_level def run(): stations = build_station_list() warning_stations = stations_highest_rel_level(stations,10) for entry in warning_stations: print(entry[0].name,entry[1]) if __name__ == "__mai...
[((139, 159), 'floodsystem.stationdata.build_station_list', 'build_station_list', ([], {}), '()\n', (157, 159), False, 'from floodsystem.stationdata import build_station_list\n'), ((183, 223), 'floodsystem.flood.stations_highest_rel_level', 'stations_highest_rel_level', (['stations', '(10)'], {}), '(stations, 10)\n', (...
danijoo/biotite
src/biotite/copyable.py
22072e64676e4e917236eac8493eed4c6a22cc33
# This source code is part of the Biotite package and is distributed # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further # information. __name__ = "biotite" __author__ = "Patrick Kunzmann" __all__ = ["Copyable"] import abc class Copyable(metaclass=abc.ABCMeta): """ Base class for all obje...
[]
np-hacs/ha-wyzeapi
custom_components/wyzeapi/binary_sensor.py
8abc6af59d36514008f696310b290a046d7c7a72
import logging import time from datetime import timedelta from typing import List from homeassistant.components.binary_sensor import ( BinarySensorEntity, DEVICE_CLASS_MOTION ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ATTR_ATTRIBUTION from homeassistant.core import H...
[((500, 527), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (517, 527), False, 'import logging\n'), ((582, 603), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(10)'}), '(seconds=10)\n', (591, 603), False, 'from datetime import timedelta\n'), ((1476, 1487), 'time.time', 'time.time'...
GEOS-ESM/AeroApps
src/Components/missions/GEMS/mcd43c.py
874dad6f34420c014d98eccbe81a061bdc0110cf
""" Reads climate modeling grid 0.05 degree MCD43 BRDF files. """ import os import sys from numpy import loadtxt, array, tile, where, concatenate, flipud from numpy import ones from datetime import date, datetime, timedelta from glob import glob from pyhdf.SD import SD, HDF4Error MISSING = 32.767 SDS = dict...
[]
kalyc/keras-apache-mxnet
tests/keras/layers/wrappers_test.py
5497ebd50a45ccc446b8944ebbe11fb7721a5533
import pytest import numpy as np import copy from numpy.testing import assert_allclose from keras.utils import CustomObjectScope from keras.layers import wrappers, Input, Layer from keras.layers import RNN from keras import layers from keras.models import Sequential, Model, model_from_json from keras import backend as ...
[((13283, 13359), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""merge_mode"""', "['sum', 'mul', 'ave', 'concat', None]"], {}), "('merge_mode', ['sum', 'mul', 'ave', 'concat', None])\n", (13306, 13359), False, 'import pytest\n'), ((15765, 15827), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""...
code-annotator/tornado-annotated
src/tornado-3.2.2/tornado/platform/common.py
78fa3ab3b87a559c1db9ec11d86d79f6bf47853c
"""Lowest-common-denominator implementations of platform functionality.""" from __future__ import absolute_import, division, print_function, with_statement import errno import socket from tornado.platform import interface class Waker(interface.Waker): """Create an OS independent asynchronous pipe. For use ...
[((612, 627), 'socket.socket', 'socket.socket', ([], {}), '()\n', (625, 627), False, 'import socket\n'), ((1503, 1518), 'socket.socket', 'socket.socket', ([], {}), '()\n', (1516, 1518), False, 'import socket\n'), ((2408, 2444), 'socket.error', 'socket.error', (['"""Cannot bind trigger!"""'], {}), "('Cannot bind trigger...
poster515/BlinkyTape_Python
bathymetry_blink/bathymetry_blink.py
edc2f7e43fbf07dbfdeba60da7acb7ae7a3707d0
""" This script will modulate the blinky lights using the following algorithm: 1) uses user-provided location to obtain row of pixel data from bathy image 2) samples a 'number of LEDs' number of pixels from that row 3) shifts the sampled row data to center it at the location specified by user 4) displays resulting pix...
[((1950, 1973), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (1971, 1973), False, 'import optparse\n'), ((3309, 3333), 'blinkytape.BlinkyTape', 'BlinkyTape', (['port', 'n_leds'], {}), '(port, n_leds)\n', (3319, 3333), False, 'from blinkytape import BlinkyTape\n'), ((3371, 3379), 'time.sleep', 'sl...
SFDigitalServices/pts-dispatcher-microservice-py
service/transforms/export_submissions.py
80ec68d9d7f3f120a708717ed92c8b5a16742ff3
""" Export Submissions Transform module """ #pylint: disable=too-few-public-methods import pandas as pd from .transform import TransformBase from ..resources.field_configs import FieldConfigs from ..resources.field_maps import FieldMaps class ExportSubmissionsTransform(TransformBase): """ Transform for Export Subm...
[((3189, 3212), 'pandas.json_normalize', 'pd.json_normalize', (['data'], {}), '(data)\n', (3206, 3212), True, 'import pandas as pd\n')]
mgelbart/ray
python/ray/ml/tests/test_torch_trainer.py
4cec2286572e368a4bd64aae467751a384eff62d
import pytest import torch import ray from ray.ml.predictors.integrations.torch import TorchPredictor from ray.ml.train.integrations.torch import TorchTrainer from ray import train from ray.ml.examples.pytorch.torch_linear_example import train_func as linear_train_func @pytest.fixture def ray_start_4_cpus(): add...
[((456, 502), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""num_workers"""', '[1, 2]'], {}), "('num_workers', [1, 2])\n", (479, 502), False, 'import pytest\n'), ((332, 352), 'ray.init', 'ray.init', ([], {'num_cpus': '(4)'}), '(num_cpus=4)\n', (340, 352), False, 'import ray\n'), ((438, 452), 'ray.shutdown'...
OpenIxia/ixnetwork_restpy
uhd_restpy/testplatform/sessions/ixnetwork/quicktest/learnframes_58e01d83db5d99bcabff902f5cf6ec51.py
f628db450573a104f327cf3c737ca25586e067ae
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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,...
[]
telminov/sonm-cdn-cms
core/serializers.py
e51107e3baed9e633e54db6cd7f784178f531b4a
from rest_framework import serializers from core import models class AssetSerializer(serializers.ModelSerializer): class Meta: model = models.Asset fields = '__all__'
[]
bernardocuteri/wasp
tests/wasp1/AllAnswerSets/aggregates_count_boundvariables_1.test.py
05c8f961776dbdbf7afbf905ee00fc262eba51ad
input = """ c(2). p(1). a(2). d(2,2,1). okay(X):- c(X), #count{V:a(V),d(V,X,1)} = 1. ouch(X):- p(X), #count{V:a(V),d(V,X,1)} = 1. """ output = """ {a(2), c(2), d(2,2,1), okay(2), p(1)} """
[]
Pzzzzz5142/animal-forest-QQ-group-bot
Pzzzzz/plugins/wm.py
a9141a212a7746ac95d28459ec9cec5b6c188b35
from nonebot import CommandSession, on_command from langdetect import detect, detect_langs from aiohttp import ClientSession from nonebot import get_bot from nonebot.argparse import ArgumentParser import time import hmac import random, sys import hashlib import binascii import urllib bot = get_bot() # 百度通用翻译API,不包含词典、...
[((292, 301), 'nonebot.get_bot', 'get_bot', ([], {}), '()\n', (299, 301), False, 'from nonebot import get_bot\n'), ((426, 489), 'nonebot.on_command', 'on_command', (['"""wm"""'], {'aliases': "{'翻译', 'translate'}", 'only_to_me': '(False)'}), "('wm', aliases={'翻译', 'translate'}, only_to_me=False)\n", (436, 489), False, '...
ParksProjets/Mips-Applications
home/scripts/memory/lpsolve.py
d4284a5ee357b0e5f348b9af28bb0d90c036ae99
""" LpSolve wrapper. Copyright (C) 2018, Guillaume Gonnet License MIT """ from ctypes import * import sys import os.path as path import platform # Import the DLL ver = ("x86", "x64")[sys.maxsize > 2**32] here = path.dirname(__file__) if sys.platform == "win32": lib = windll.LoadLibrary(path.abspath(path.join...
[((217, 239), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (229, 239), True, 'import os.path as path\n'), ((311, 356), 'os.path.join', 'path.join', (['here', "('dll/lpsolve55-%s.dll' % ver)"], {}), "(here, 'dll/lpsolve55-%s.dll' % ver)\n", (320, 356), True, 'import os.path as path\n'), ((429, ...
mauroseb/octavia
octavia/tests/unit/controller/worker/v2/tasks/test_database_tasks.py
8f032d884e0f89ac69d5b6e5f5b77d19ee6eb1d7
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
[((1076, 1101), 'oslo_utils.uuidutils.generate_uuid', 'uuidutils.generate_uuid', ([], {}), '()\n', (1099, 1101), False, 'from oslo_utils import uuidutils\n'), ((1115, 1140), 'oslo_utils.uuidutils.generate_uuid', 'uuidutils.generate_uuid', ([], {}), '()\n', (1138, 1140), False, 'from oslo_utils import uuidutils\n'), ((1...
Jay4C/Web-Scraping
Yellow_Pages_Lithuania/unit_tests.py
187679bee035dad661d983b5a8382240f820c337
import time from bs4 import BeautifulSoup import requests import pymysql.cursors import unittest class UnitTestsDataMinerYellowPagesLithuania(unittest.TestCase): def test_extract_one_email(self): url = "https://www.visalietuva.lt/en/company/astorija-hotel-uab" # Request the content of a page from...
[((18386, 18401), 'unittest.main', 'unittest.main', ([], {}), '()\n', (18399, 18401), False, 'import unittest\n'), ((344, 361), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (356, 361), False, 'import requests\n'), ((418, 460), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html.content', '"""html.parser"""'], {}...
vatervonacht/dagster
python_modules/dagster/dagster_tests/compat_tests/test_back_compat.py
595d78c883ef20618052ac1575fe46cde51fd541
# pylint: disable=protected-access import os import re import pytest from dagster import file_relative_path from dagster.core.errors import DagsterInstanceMigrationRequired from dagster.core.instance import DagsterInstance, InstanceRef from dagster.utils.test import restore_directory # test that we can load runs an...
[((383, 429), 'dagster.file_relative_path', 'file_relative_path', (['__file__', '"""snapshot_0_6_4"""'], {}), "(__file__, 'snapshot_0_6_4')\n", (401, 429), False, 'from dagster import file_relative_path\n'), ((1092, 1145), 'dagster.file_relative_path', 'file_relative_path', (['__file__', '"""snapshot_0_6_6/sqlite"""'],...
yshrdbrn/bigdata
scripts/charts.py
51114ae98354ee094e0bcff26c1814f85c434148
import matplotlib.pyplot as plt import pandas as pd def group_by_category(df): grouped = df.groupby(['CATEGORY']).size().to_frame('Crimes') labels = ['Trespassing', 'Vehicle theft', 'General Theft', 'Damage to Property', 'Robbery', 'Homicide'] p = grouped.plot.pie(y='Crimes', labels=labels, ...
[((428, 465), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""../charts/category.png"""'], {}), "('../charts/category.png')\n", (439, 465), True, 'import matplotlib.pyplot as plt\n'), ((749, 789), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""../charts/time_of_day.png"""'], {}), "('../charts/time_of_day.png')\n",...
benjaminkrenn/abcvoting
unittests.py
1e3833a7314d3467de7560f7e531a4c35c6eda08
# Unit tests import unittest def run_test_instance(unittestinstance, profile, committeesize, tests): import rules_approval # all rules used? for rule in rules_approval.MWRULES: unittestinstance.assertTrue(rule in tests.keys()) for rule in tests.keys(): output = rules_approval.comp...
[((15333, 15348), 'unittest.main', 'unittest.main', ([], {}), '()\n', (15346, 15348), False, 'import unittest\n'), ((301, 374), 'rules_approval.compute_rule', 'rules_approval.compute_rule', (['rule', 'profile', 'committeesize'], {'resolute': '(False)'}), '(rule, profile, committeesize, resolute=False)\n', (328, 374), F...
behnoud-bazrafshan/ThesisPortfolio
Robustness Check/Calculating Risk Factors/calculate_momentum_factor.py
2edda0109fb8aafc984b5dfc2e59cabb949b4a78
import pandas as pd import numpy as np import jdatetime pd.options.mode.chained_assignment = None # Read Bourseview data for market cap # Concat all 75 tickers' data me_list = [] for file_number in range(1, 76): print(file_number) me_path = f'E:/Thesis/New Sampling/Daily Data - Bourseview/'\ ...
[((1018, 1055), 'pandas.concat', 'pd.concat', (['me_list'], {'ignore_index': '(True)'}), '(me_list, ignore_index=True)\n', (1027, 1055), True, 'import pandas as pd\n'), ((2091, 2131), 'pandas.concat', 'pd.concat', (['close_list'], {'ignore_index': '(True)'}), '(close_list, ignore_index=True)\n', (2100, 2131), True, 'im...
aws-samples/siem-on-amazon-opensearch-service
source/lambda/geoip_downloader/index.py
9bac87d39e9fab04f483bae54ffe94948af096ff
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 __copyright__ = ('Copyright Amazon.com, Inc. or its affiliates. ' 'All Rights Reserved.') __version__ = '2.7.1' __license__ = 'MIT-0' __author__ = 'Akihiro Nakajima' __url__ = 'https://github.com/aws-s...
[((722, 765), 'os.environ.get', 'os.environ.get', (['"""s3key_prefix"""', '"""GeoLite2/"""'], {}), "('s3key_prefix', 'GeoLite2/')\n", (736, 765), False, 'import os\n'), ((772, 792), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {}), "('s3')\n", (786, 792), False, 'import boto3\n'), ((3356, 3381), 'json.dumps', 'js...
earthobservatory/isce2
components/mroipac/baseline/Baseline.py
655c46cc4add275879167b750a5e91f6d00f168e
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright 2010 California Institute of Technology. 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 th...
[((2310, 2767), 'iscesys.Component.Component.Component.Parameter', 'Component.Parameter', (['"""baselineLocation"""'], {'public_name': '"""BASELINE_LOCATION"""', 'default': '"""all"""', 'type': 'str', 'mandatory': '(False)', 'doc': '(\'Location at which to compute baselines - "all" implies \' +\n \'top, middle, bott...
Bot-Box/FiveCardStud
src/modules/deuces/deck.py
55e11d7a23becece33658075f922cf007909d058
from random import shuffle as rshuffle from .card import Card class Deck: """ Class representing a deck. The first time we create, we seed the static deck with the list of unique card integers. Each object instantiated simply makes a copy of this object and shuffles it. """ _FULL_DECK = [] ...
[((466, 486), 'random.shuffle', 'rshuffle', (['self.cards'], {}), '(self.cards)\n', (474, 486), True, 'from random import shuffle as rshuffle\n')]
puiterwijk/python-openidc-client
openidc_client/__init__.py
cd8d91c0503124305727f38a0f9fe93bb472209c
# -*- coding: utf-8 -*- # # Copyright (C) 2016, 2017 Red Hat, Inc. # Red Hat Author: Patrick Uiterwijk <puiterwijk@redhat.com> # # 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 restri...
[((4062, 4089), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (4079, 4089), False, 'import logging\n'), ((4476, 4520), 'os.path.expanduser', 'os.path.expanduser', (["(cachedir or '~/.openidc')"], {}), "(cachedir or '~/.openidc')\n", (4494, 4520), False, 'import os\n'), ((4798, 4804), 'th...
constantinius/eoxserver_combined
eoxserver/services/ows/wps/v10/encoders/parameters.py
68f261133fed65a4e8a6ddba82b0d2845171e4bf
#------------------------------------------------------------------------------- # # WPS 1.0 parameters' XML encoders # # Project: EOxServer <http://eoxserver.org> # Authors: Fabian Schindler <fabian.schindler@eox.at> # Martin Paces <martin.paces@eox.at> # #-----------------------------------------------------...
[((4280, 4331), 'eoxserver.services.ows.wps.v10.util.NIL', 'NIL', (["('LiteralData' if is_input else 'LiteralOutput')"], {}), "('LiteralData' if is_input else 'LiteralOutput')\n", (4283, 4331), False, 'from eoxserver.services.ows.wps.v10.util import OWS, WPS, NIL, ns_ows\n'), ((6190, 6218), 'eoxserver.services.ows.wps....
ClinGen/gene-and-variant-curation-tools
gci-vci-serverless/src/helpers/vp_saves_helpers.py
30f21d8f03d8b5c180c1ce3cb8401b5abc660080
import datetime import uuid import simplejson as json from src.db.s3_client import Client as S3Client from decimal import Decimal def get_from_archive(archive_key): ''' Download a VP Save from S3. :param str archive_key: The vp_save data's location (S3 bucket and file path). This value is required. ''' if ...
[((448, 458), 'src.db.s3_client.Client', 'S3Client', ([], {}), '()\n', (456, 458), True, 'from src.db.s3_client import Client as S3Client\n'), ((2070, 2080), 'src.db.s3_client.Client', 'S3Client', ([], {}), '()\n', (2078, 2080), True, 'from src.db.s3_client import Client as S3Client\n'), ((945, 957), 'uuid.uuid4', 'uui...
ruhugu/brokenaxes
docs/source/auto_examples/plot_usage.py
1cfb301c854b3336aeb4dd9a2c329310534dfb21
""" Basic usage =========== This example presents the basic usage of brokenaxes """ import matplotlib.pyplot as plt from brokenaxes import brokenaxes import numpy as np fig = plt.figure(figsize=(5,2)) bax = brokenaxes(xlims=((0, .1), (.4, .7)), ylims=((-1, .7), (.79, 1)), hspace=.05) x = np.linspace(0, 1, 100) bax...
[((180, 206), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(5, 2)'}), '(figsize=(5, 2))\n', (190, 206), True, 'import matplotlib.pyplot as plt\n'), ((212, 299), 'brokenaxes.brokenaxes', 'brokenaxes', ([], {'xlims': '((0, 0.1), (0.4, 0.7))', 'ylims': '((-1, 0.7), (0.79, 1))', 'hspace': '(0.05)'}), '(xlims...
toyo-bunko/paper_app
src/entity/002_createRdf.py
f988e05cf83711d98c5ed735c0fd74fcf11e0f05
import shutil import os import json import glob import yaml import sys import urllib import ssl import csv import time import requests import json import csv from rdflib import URIRef, BNode, Literal, Graph from rdflib.namespace import RDF, RDFS, FOAF, XSD from rdflib import Namespace all = Graph() with open("data/...
[((295, 302), 'rdflib.Graph', 'Graph', ([], {}), '()\n', (300, 302), False, 'from rdflib import URIRef, BNode, Literal, Graph\n'), ((351, 363), 'json.load', 'json.load', (['f'], {}), '(f)\n', (360, 363), False, 'import json\n'), ((435, 447), 'json.load', 'json.load', (['f'], {}), '(f)\n', (444, 447), False, 'import jso...
nuft/can-bootloader
client/tests/test_config_read_tool.py
18dd77dae1fb2328dac1fd1df2c9e5d5c936771e
import unittest try: from unittest.mock import * except ImportError: from mock import * from msgpack import * import bootloader_read_config from commands import * import sys import json class ReadConfigToolTestCase(unittest.TestCase): @patch('utils.write_command_retry') @patch('utils.write_command'...
[((769, 798), 'bootloader_read_config.main', 'bootloader_read_config.main', ([], {}), '()\n', (796, 798), False, 'import bootloader_read_config\n'), ((1902, 1931), 'bootloader_read_config.main', 'bootloader_read_config.main', ([], {}), '()\n', (1929, 1931), False, 'import bootloader_read_config\n'), ((1038, 1087), 'jso...
Pyrrolidine/letterboxd-bot
bot.py
b2cd1364e00c3ec6fb70be9c8be7a8b707a8ffbe
import logging from asyncio import sleep import discord from discord.ext import commands from config import SETTINGS from crew import crew_embed from diary import diary_embed from film import film_embed from helpers import LetterboxdError from list_ import list_embed from review import review_embed from user import us...
[((330, 435), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s | %(message)s"""', 'datefmt': '"""%m/%d %H:%M:%S"""'}), "(level=logging.INFO, format='%(asctime)s | %(message)s',\n datefmt='%m/%d %H:%M:%S')\n", (349, 435), False, 'import logging\n'), ((452, 507), '...
wgifford/ray
python/ray/experimental/workflow/execution.py
8acb469b047cd9b327c9477a13b030eb7357860e
import asyncio import logging import time from typing import Set, List, Tuple, Optional, TYPE_CHECKING import uuid import ray from ray.experimental.workflow import workflow_context from ray.experimental.workflow import workflow_storage from ray.experimental.workflow.common import (Workflow, WorkflowStatus, ...
[((765, 792), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (782, 792), False, 'import logging\n'), ((1089, 1109), 'ray.experimental.workflow.storage.get_global_storage', 'get_global_storage', ([], {}), '()\n', (1107, 1109), False, 'from ray.experimental.workflow.storage import get_globa...
bertonha/python-zeep
src/zeep/wsse/__init__.py
748f4e028db2ef498bc6dd1e60d3555b7688f08c
from .compose import Compose # noqa from .signature import BinarySignature, Signature, MemorySignature # noqa from .username import UsernameToken # noqa
[]
peteboi/Python-Scripts
Complab assignment.py
d84e352c41cff3f459d88c83bc81f6dc2f25ed05
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt def orbit(u): x,y,v_x,v_y = u r=np.hypot(x,y) #r= 1.521e+06 #M,G=1.989e+30,6.7e-11 M,G=20,110 f=G*M/r**3 return np.array([v_x,v_y,-f*x,-f*y]) def RK4(f,u,dt): k1=f(u)*dt k2=f(u+0.5*k1)*dt ...
[((599, 619), 'numpy.arange', 'np.arange', (['(0)', '(10)', 'dt'], {}), '(0, 10, dt)\n', (608, 619), True, 'import numpy as np\n'), ((622, 649), 'numpy.array', 'np.array', (['[10, 0.0, 10, 10]'], {}), '([10, 0.0, 10, 10])\n', (630, 649), True, 'import numpy as np\n'), ((707, 717), 'matplotlib.pyplot.grid', 'plt.grid', ...
gamabounty/django-factory-generator
factory_generator/management/commands/generate_factories.py
284184b22f3564a7a915ac3f3363e588d3721158
import os from django.apps import apps from django.core.management.base import BaseCommand from factory_generator.generator import FactoryAppGenerator class Command(BaseCommand): help = 'Create model factories for all installed apps' def handle(self, *args, **options): created_files = [] fo...
[((329, 351), 'django.apps.apps.get_app_configs', 'apps.get_app_configs', ([], {}), '()\n', (349, 351), False, 'from django.apps import apps\n'), ((389, 413), 'factory_generator.generator.FactoryAppGenerator', 'FactoryAppGenerator', (['app'], {}), '(app)\n', (408, 413), False, 'from factory_generator.generator import F...
qiangli/cellranger
mro/stages/analyzer/run_differential_expression/__init__.py
046e24c3275cfbd4516a6ebc064594513a5c45b7
#!/usr/bin/env python # # Copyright (c) 2017 10X Genomics, Inc. All rights reserved. # import cellranger.analysis.diffexp as cr_diffexp import cellranger.analysis.io as analysis_io from cellranger.analysis.singlegenome import SingleGenomeAnalysis import cellranger.h5_constants as h5_constants import cellranger.analysi...
[((1464, 1533), 'cellranger.analysis.singlegenome.SingleGenomeAnalysis.load_clustering_keys_from_h5', 'SingleGenomeAnalysis.load_clustering_keys_from_h5', (['args.clustering_h5'], {}), '(args.clustering_h5)\n', (1513, 1533), False, 'from cellranger.analysis.singlegenome import SingleGenomeAnalysis\n'), ((1804, 1854), '...
ethankward/sympy
sympy/combinatorics/testutil.py
44664d9f625a1c68bc492006cfe1012cb0b49ee4
from sympy.combinatorics import Permutation from sympy.combinatorics.util import _distribute_gens_by_base rmul = Permutation.rmul def _cmp_perm_lists(first, second): """ Compare two lists of permutations as sets. This is used for testing purposes. Since the array form of a permutation is currently a...
[((3394, 3430), 'sympy.combinatorics.util._distribute_gens_by_base', '_distribute_gens_by_base', (['base', 'gens'], {}), '(base, gens)\n', (3418, 3430), False, 'from sympy.combinatorics.util import _distribute_gens_by_base\n'), ((7593, 7611), 'sympy.combinatorics.tensor_can.gens_products', 'gens_products', (['*v1'], {}...
jonkeane/vatic-checker
src/vatic_checker/config.py
fa8aec6946dcfd3f466b62f9c00d81bc43514b22
localhost = "http://localhost/" # your local host database = "mysql://root@localhost/vaticChecker" # server://user:pass@localhost/dbname min_training = 2 # the minimum number of training videos to be considered recaptcha_secret = "" # recaptcha secret for verification duplicate_annotations = False #...
[((431, 456), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (446, 456), False, 'import os\n')]
graingert/django
django/utils/timezone.py
784d0c261c76535dc760bc8d76793d92f35c1513
"""Timezone helper functions. This module uses pytz when it's available and fallbacks when it isn't. """ from datetime import datetime, timedelta, tzinfo from threading import local import time as _time try: import pytz except ImportError: pytz = None from django.conf import settings __all__ = [ 'utc',...
[((506, 518), 'datetime.timedelta', 'timedelta', (['(0)'], {}), '(0)\n', (515, 518), False, 'from datetime import datetime, timedelta, tzinfo\n'), ((3077, 3084), 'threading.local', 'local', ([], {}), '()\n', (3082, 3084), False, 'from threading import local\n'), ((1259, 1293), 'datetime.timedelta', 'timedelta', ([], {'...
Ouranosinc/malleefowl
malleefowl/tests/test_wps_caps.py
685a4cabe4c4ccafc2721a50e1f8178b8b81689e
import pytest from pywps import Service from pywps.tests import assert_response_success from .common import client_for from malleefowl.processes import processes def test_wps_caps(): client = client_for(Service(processes=processes)) resp = client.get(service='wps', request='getcapabilities', version='1.0.0'...
[((211, 239), 'pywps.Service', 'Service', ([], {'processes': 'processes'}), '(processes=processes)\n', (218, 239), False, 'from pywps import Service\n')]
CallumJHays/pyngrok
setup.py
e1a28948d1d8cf42f8eed1b166a2caf6b2a68066
from setuptools import setup __author__ = "Alex Laird" __copyright__ = "Copyright 2019, Alex Laird" __version__ = "1.4.0" with open("README.md", "r") as f: long_description = f.read() setup( name="pyngrok", version=__version__, packages=["pyngrok"], python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2...
[]
texasmichelle/kubeflow-cern
pipelines/trackml.py
886925fad5c37a72f6999c1100584fa8e4a0adae
#!/usr/bin/env python3 import kfp.dsl as dsl import kfp.gcp as gcp # Pipeline input variables. KUBECTL_IMAGE = "gcr.io/mcas-195423/trackml_master_kfp_kubectl" KUBECTL_IMAGE_VERSION = "1" TRACKML_IMAGE = "gcr.io/mcas-195423/trackml_master_trackml" TRACKML_IMAGE_VERSION = "1" def train_op(): return dsl.ContainerOp( ...
[((1025, 1114), 'kfp.dsl.pipeline', 'dsl.pipeline', ([], {'name': '"""trackml"""', 'description': '"""A pipeline that predicts particle tracks"""'}), "(name='trackml', description=\n 'A pipeline that predicts particle tracks')\n", (1037, 1114), True, 'import kfp.dsl as dsl\n'), ((464, 484), 'kfp.gcp.use_gcp_secret',...
aleasoluciones/infrabbitmq
bin/ticker.py
2759590156c63b9a04fb5daf8d588a084fc30629
# -*- coding: utf-8 -*- import time import puka import argparse import logging from infcommon import utils from infrabbitmq import factory as infrabbitmq_factory from infrabbitmq.rabbitmq import RabbitMQError from infrabbitmq.events_names import ( TICK_1_SECOND, TICK_1_MINUTE, TICK_2_MINUTES, TICK_5_...
[((582, 635), 'infrabbitmq.factory.event_publisher_json_serializer', 'infrabbitmq_factory.event_publisher_json_serializer', ([], {}), '()\n', (633, 635), True, 'from infrabbitmq import factory as infrabbitmq_factory\n'), ((756, 769), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (766, 769), False, 'import time\n'...
Tarpelite/UniNLP
transformers/modeling_encoder_decoder.py
176c2a0f88c8054bf69e1f92693d353737367c34
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
[((902, 929), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (919, 929), False, 'import logging\n'), ((9721, 9760), 'os.path.join', 'os.path.join', (['save_directory', '"""encoder"""'], {}), "(save_directory, 'encoder')\n", (9733, 9760), False, 'import os\n'), ((9800, 9839), 'os.path.join...