repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
xuannianc/keras-retinanet
count_files.py
d1da39592042927aaf3b3eb905a308c327983bed
import csv vat_filenames = set() train_csv_filename = 'train_annotations.csv' val_csv_filename = 'val_annotations.csv' for csv_filename in [train_csv_filename, val_csv_filename]: for line in csv.reader(open(csv_filename)): vat_filename = line[0].split('/')[-1] vat_filenames.add(vat_filename) pr...
[]
ngi-nix/liberaforms
liberaforms/views/admin.py
5882994736292e7ab34c4c9207805b307478a6c7
""" This file is part of LiberaForms. # SPDX-FileCopyrightText: 2020 LiberaForms.org # SPDX-License-Identifier: AGPL-3.0-or-later """ import os, json from flask import g, request, render_template, redirect from flask import session, flash, Blueprint from flask import send_file, after_this_request from flask_babel imp...
[((768, 837), 'flask.Blueprint', 'Blueprint', (['"""admin_bp"""', '__name__'], {'template_folder': '"""../templates/admin"""'}), "('admin_bp', __name__, template_folder='../templates/admin')\n", (777, 837), False, 'from flask import session, flash, Blueprint\n'), ((1506, 1522), 'liberaforms.models.user.User.find', 'Use...
r-pad/zephyr
python/zephyr/datasets/score_dataset.py
c8f45e207c11bfc2b21df169db65a7df892d2848
import os, copy import cv2 from functools import partial import numpy as np import torch import torchvision from torch.utils.data import Dataset from zephyr.data_util import to_np, vectorize, img2uint8 from zephyr.utils import torch_norm_fast from zephyr.utils.mask_edge import getRendEdgeScore from zephyr...
[((25598, 25647), 'torch.zeros', 'torch.zeros', (['n_hypo', 'n_feat', 'crop_size', 'crop_size'], {}), '(n_hypo, n_feat, crop_size, crop_size)\n', (25609, 25647), False, 'import torch\n'), ((1472, 1620), 'zephyr.datasets.bop_raw_dataset.BopRawDataset', 'BopRawDataset', (['args.bop_root', 'self.dataset_name', 'args.split...
GuilhermeEsdras/Grafos
em Python/Roteiro7/Roteiro7__testes_dijkstra.py
b6556c3d679496d576f65b798a1a584cd73e40f4
from Roteiro7.Roteiro7__funcoes import GrafoComPesos # .:: Arquivo de Testes do Algoritmo de Dijkstra ::. # # --------------------------------------------------------------------------- # grafo_aula = GrafoComPesos( ['E', 'A', 'B', 'C', 'D'], { 'E-A': 1, 'E-C': 10, 'A-B': 2, 'B...
[((203, 300), 'Roteiro7.Roteiro7__funcoes.GrafoComPesos', 'GrafoComPesos', (["['E', 'A', 'B', 'C', 'D']", "{'E-A': 1, 'E-C': 10, 'A-B': 2, 'B-C': 4, 'C-D': 3}"], {}), "(['E', 'A', 'B', 'C', 'D'], {'E-A': 1, 'E-C': 10, 'A-B': 2,\n 'B-C': 4, 'C-D': 3})\n", (216, 300), False, 'from Roteiro7.Roteiro7__funcoes import Gra...
awinia-github/QScreenCast
QScreenCast/spyder/api.py
09d343cae0a1c7f86faf28e08a62bd09976aaf2e
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright © Tom Hören # Licensed under the terms of the MIT License # ---------------------------------------------------------------------------- """ Python QtScreenCaster Spyder API. """ class ScreenResolutions...
[]
aaron19950321/ICOM
setup.py
d5bd0705776c505dd1df0a1c76a07fee2d218394
import os, os.path import subprocess from distutils.core import setup from py2exe.build_exe import py2exe PROGRAM_NAME = 'icom_app' PROGRAM_DESC = 'simple icom app' NSIS_SCRIPT_TEMPLATE = r""" !define py2exeOutputDirectory '{output_dir}\' !define exe '{program_name}.exe' ; Uses solid LZMA compression. Ca...
[]
CharlottePouw/interpreting-complexity
src/lingcomp/farm/features.py
b9a73c0aff18e4c6b4209a6511d00639494c70da
import torch from farm.data_handler.samples import Sample from farm.modeling.prediction_head import RegressionHead class FeaturesEmbeddingSample(Sample): def __init__(self, id, clear_text, tokenized=None, features=None, feat_embeds=None): super().__init__(id, clear_text, tokenized, features) self....
[((547, 571), 'torch.cat', 'torch.cat', (['(x, feats)', '(1)'], {}), '((x, feats), 1)\n', (556, 571), False, 'import torch\n')]
UN-ICC/icc-digital-id-manager
manager/tests/api_view_test_classes.py
aca0109b3202b292145326ec5523ee8f24691a83
import pytest from rest_framework import status from rest_framework.test import APIClient class TestBase: __test__ = False path = None get_data = {} put_data = {} post_data = {} delete_data = {} requires_auth = True implements_retrieve = False implements_create = False implemen...
[((383, 394), 'rest_framework.test.APIClient', 'APIClient', ([], {}), '()\n', (392, 394), False, 'from rest_framework.test import APIClient\n')]
TrustyJAID/Toxic-Cogs
dashboard/dashboard.py
870d92067ba2a99b9ade2f957f945b95fdbc80f7
from collections import defaultdict import discord from redbot.core import Config, checks, commands from redbot.core.bot import Red from redbot.core.utils.chat_formatting import box, humanize_list, inline from abc import ABC # ABC Mixins from dashboard.abc.abc import MixinMeta from dashboard.abc.mixin impor...
[((1385, 1437), 'redbot.core.Config.get_conf', 'Config.get_conf', (['self'], {'identifier': '(473541068378341376)'}), '(self, identifier=473541068378341376)\n', (1400, 1437), False, 'from redbot.core import Config, checks, commands\n'), ((1873, 1905), 'collections.defaultdict', 'defaultdict', (['self.cache_defaults'], ...
hopeness/leetcode
algorithms/162.Find-Peak-Element/Python/solution_2.py
496455fa967f0704d729b4014f92f52b1d69d690
""" https://leetcode.com/problems/find-peak-element/submissions/ """ from typing import List class Solution: def findPeakElement(self, nums: List[int]) -> int: l, r = 0, len(nums)-1 while l < r: lmid = (l + r) // 2 rmid = lmid + 1 if nums[lmid] < nums[rmid]: ...
[]
vinbigdata-medical/MIDL2021-Xray-Classification
data_loader.py
51359126d07573053059c36e3cd95a7fd7100e0e
from torchvision.datasets import ImageFolder from torchvision import transforms import random import os import torch from torch.utils.data.dataloader import DataLoader from utils import constants, get_default_device from image_folder_with_path import ImageFolderWithPaths def to_device(data, device): """Move tensor...
[((1288, 1342), 'os.listdir', 'os.listdir', (['(constants.DATA_PATH + constants.TRAIN_PATH)'], {}), '(constants.DATA_PATH + constants.TRAIN_PATH)\n', (1298, 1342), False, 'import os\n'), ((1363, 1451), 'torchvision.datasets.ImageFolder', 'ImageFolder', (['(constants.DATA_PATH + constants.TRAIN_PATH)'], {'transform': 't...
sjpfenninger/calliope
calliope/test/test_analysis.py
a4e49c3b7d37f908bafc84543510eec0b4cf5d9f
# import matplotlib # matplotlib.use('Qt5Agg') # Prevents `Invalid DISPLAY variable` errors import pytest import tempfile from calliope import Model from calliope.utils import AttrDict from calliope import analysis from . import common from .common import assert_almost_equal, solver, solver_io import matplotlib.p...
[((333, 358), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (351, 358), True, 'import matplotlib.pyplot as plt\n'), ((429, 459), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (443, 459), False, 'import pytest\n'), ((1688, 1718), ...
TzuTingWei/mol
mol/data/reader.py
9499925443f389d8e960b6d656f2953d21df3e3b
import os from mol.util import read_xyz dirname = os.path.dirname(os.path.abspath(__file__)) filename = os.path.join(dirname, 'look_and_say.dat') with open(filename, 'r') as handle: look_and_say = handle.read() def get_molecule(filename): return read_xyz(os.path.join(dirname, filename + ".xyz"))
[((105, 146), 'os.path.join', 'os.path.join', (['dirname', '"""look_and_say.dat"""'], {}), "(dirname, 'look_and_say.dat')\n", (117, 146), False, 'import os\n'), ((67, 92), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (82, 92), False, 'import os\n'), ((260, 300), 'os.path.join', 'os.path.joi...
lightsey/cinder
cinder/tests/unit/targets/test_spdknvmf.py
e03d68e42e57a63f8d0f3e177fb4287290612b24
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
[((6393, 6413), 'copy.deepcopy', 'copy.deepcopy', (['BDEVS'], {}), '(BDEVS)\n', (6406, 6413), False, 'import copy\n'), ((6445, 6475), 'copy.deepcopy', 'copy.deepcopy', (['NVMF_SUBSYSTEMS'], {}), '(NVMF_SUBSYSTEMS)\n', (6458, 6475), False, 'import copy\n'), ((6963, 6997), 'json.dumps', 'json.dumps', (["{'result': self.b...
yizhang7210/Acre
server/algos/euler/transformer.py
c98cf8a4fdfb223a1958e8e61df759f889a1b13f
""" This is algos.euler.transformer module. This module is responsible for transforming raw candle data into training samples usable to the Euler algorithm. """ import datetime import decimal from algos.euler.models import training_samples as ts from core.models import instruments from datasource.models import...
[((343, 366), 'decimal.Decimal', 'decimal.Decimal', (['"""0.01"""'], {}), "('0.01')\n", (358, 366), False, 'import decimal\n'), ((3342, 3365), 'algos.euler.models.training_samples.get_last', 'ts.get_last', (['instrument'], {}), '(instrument)\n', (3353, 3365), True, 'from algos.euler.models import training_samples as ts...
analyticsftw/diagrams
diagrams/outscale/__init__.py
217af329a323084bb98031ac1768bc2353e6d9b6
from diagrams import Node class _Outscale(Node): _provider = "outscale" _icon_dir = "resources/outscale" fontcolor = "#ffffff"
[]
pymango/pymango
misc/python/mango/application/main_driver/logstream.py
b55f831f0194b214e746b2dfb4d9c6671a1abc38
__doc__ = \ """ ======================================================================================= Main-driver :obj:`LogStream` variables (:mod:`mango.application.main_driver.logstream`) ======================================================================================= .. currentmodule:: mango.application.ma...
[((812, 844), 'sys.platform.startswith', 'sys.platform.startswith', (['"""linux"""'], {}), "('linux')\n", (835, 844), False, 'import sys\n'), ((882, 902), 'sys.getdlopenflags', 'sys.getdlopenflags', ([], {}), '()\n', (900, 902), False, 'import sys\n'), ((907, 955), 'sys.setdlopenflags', 'sys.setdlopenflags', (['(dl.RTL...
luftek/python-ucdev
ucdev/cy7c65211/header.py
8d3c46d25551f1237e6a2f7a90d54c24bcb1d4f9
# -*- coding: utf-8-unix -*- import platform ###################################################################### # Platform specific headers ###################################################################### if platform.system() == 'Linux': src = """ typedef bool BOOL; """ #############################...
[((221, 238), 'platform.system', 'platform.system', ([], {}), '()\n', (236, 238), False, 'import platform\n')]
richarajpal/deep_qa
deep_qa/layers/wrappers/output_mask.py
d918335a1bed71b9cfccf1d5743321cee9c61952
from overrides import overrides from ..masked_layer import MaskedLayer class OutputMask(MaskedLayer): """ This Layer is purely for debugging. You can wrap this on a layer's output to get the mask output by that layer as a model output, for easier visualization of what the model is actually doing. ...
[]
karnesh/Monte-Carlo-LJ
ljmc/energy.py
f33f08c247df963ca48b9d9f8456e26c0bb19923
""" energy.py function that computes the inter particle energy It uses truncated 12-6 Lennard Jones potential All the variables are in reduced units. """ def distance(atom1, atom2): """ Computes the square of inter particle distance Minimum image convention is applied for distance calculatio...
[]
ludgerradke/bMRI
CEST/Evaluation/lorenzian.py
dcf93749bb2fba3700e6bcfde691355d55090951
import numpy as np import math from scipy.optimize import curve_fit def calc_lorentzian(CestCurveS, x_calcentires, mask, config): (rows, colums, z_slices, entires) = CestCurveS.shape lorenzian = {key: np.zeros((rows, colums, z_slices), dtype=float) for key in config.lorenzian_keys} for k in range(z_slice...
[((212, 259), 'numpy.zeros', 'np.zeros', (['(rows, colums, z_slices)'], {'dtype': 'float'}), '((rows, colums, z_slices), dtype=float)\n', (220, 259), True, 'import numpy as np\n'), ((1741, 1886), 'scipy.optimize.curve_fit', 'curve_fit', (['fit', 'x_calcentires', 'values'], {'bounds': '([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
neuralchen/CooGAN
components/network_models_LSTU.py
3155cbb5a283226474356d3a9f01918609ddd4ec
#!/usr/bin/env python3 # -*- coding:utf-8 -*- ############################################################# # File: network_models_LSTU.py # Created Date: Tuesday February 25th 2020 # Author: Chen Xuanhong # Email: chenxuanhongzju@outlook.com # Last Modified: Tuesday, 25th February 2020 9:57:06 pm # Modified By: Chen ...
[((676, 716), 'functools.partial', 'partial', (['slim.conv2d'], {'activation_fn': 'None'}), '(slim.conv2d, activation_fn=None)\n', (683, 716), False, 'from functools import partial\n'), ((725, 775), 'functools.partial', 'partial', (['slim.conv2d_transpose'], {'activation_fn': 'None'}), '(slim.conv2d_transpose, activati...
torokmark/slender
slender/tests/list/test_keep_if.py
3bf815e22f7802ba48706f31ba608cf609e23e68
from unittest import TestCase from expects import expect, equal, raise_error from slender import List class TestKeepIf(TestCase): def test_keep_if_if_func_is_none(self): e = List([1, 2, 3, 4, 5]) expect(e.keep_if(None).to_list()).to(equal([1, 2, 3, 4, 5])) def test_keep_if_if_func_is_valid...
[((191, 212), 'slender.List', 'List', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (195, 212), False, 'from slender import List\n'), ((340, 361), 'slender.List', 'List', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (344, 361), False, 'from slender import List\n'), ((513, 534), 'slender.List', 'List', (['[1, 2...
1Crazymoney/bitcoin-cash-node
test/functional/bchn-txbroadcastinterval.py
8f82823b3c5d4bcb401b0e4e6b464c1228f936e1
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Cash Node developers # Author matricz # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test that inv messages are sent according to an exponential distribution with scale -...
[((833, 844), 'time.time', 'time.time', ([], {}), '()\n', (842, 844), False, 'import time\n'), ((4734, 4777), 'test_framework.util.connect_nodes', 'connect_nodes', (['self.nodes[0]', 'self.nodes[1]'], {}), '(self.nodes[0], self.nodes[1])\n', (4747, 4777), False, 'from test_framework.util import wait_until, connect_node...
buaaqt/dgl
tests/compute/test_sampler.py
64f6f3c1a8c2c3e08ec0750b902f3e2c63fd2cd7
import backend as F import numpy as np import scipy as sp import dgl from dgl import utils import unittest from numpy.testing import assert_array_equal np.random.seed(42) def generate_rand_graph(n): arr = (sp.sparse.random(n, n, density=0.1, format='coo') != 0).astype(np.int64) return dgl.DGLGraph(arr, readon...
[((153, 171), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (167, 171), True, 'import numpy as np\n'), ((7157, 7264), 'unittest.skipIf', 'unittest.skipIf', (["(dgl.backend.backend_name == 'tensorflow')"], {'reason': '"""Error occured when multiprocessing"""'}), "(dgl.backend.backend_name == 'tensorfl...
srinivasreddych/aws-orbit-workbench
plugins/voila/voila/__init__.py
2d154addff58d26f5459a73c06148aaf5e9fad46
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
[((924, 954), 'logging.getLogger', 'logging.getLogger', (['"""aws_orbit"""'], {}), "('aws_orbit')\n", (941, 954), False, 'import logging\n'), ((981, 1006), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (996, 1006), False, 'import os\n'), ((1351, 1450), 'aws_orbit.remote_files.helm.create_tea...
aarunsai81/netapp
tools/generate_driver_list.py
8f0f7bf9be7f4d9fb9c3846bfc639c90a05f86ba
#! /usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[((709, 761), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""generate_driver_list"""'}), "(prog='generate_driver_list')\n", (732, 761), False, 'import argparse\n'), ((3748, 3773), 'cinder.interface.util.get_volume_drivers', 'util.get_volume_drivers', ([], {}), '()\n', (3771, 3773), False, 'from...
maniegley/python
Disp_pythonScript.py
0e3a98cbff910cc78b2c0386a9cca6c5bb20eefc
import sys f = open("/home/vader/Desktop/test.py", "r") #read all file python_script = f.read() print(python_script)
[]
grussr/email-file-attachment
email_file.py
afa65b679b3c88b419643e216b9942fdefeaf9fc
import smtplib import argparse from os.path import basename from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.utils import COMMASPACE, formatdate import configparser import json def send_mail(send_from, send_to, subject, te...
[]
gonzatorte/sw-utils
logs/constants.py
767ec4aa8cbe1e0143f601482024ba1d9b76da64
import logging TRACE_LVL = int( (logging.DEBUG + logging.INFO) / 2 )
[]
dbatten5/dagster
examples/simple_lakehouse/simple_lakehouse/repo.py
d76e50295054ffe5a72f9b292ef57febae499528
from dagster import repository from simple_lakehouse.pipelines import simple_lakehouse_pipeline @repository def simple_lakehouse(): return [simple_lakehouse_pipeline]
[]
steingabelgaard/reportlab
demos/odyssey/dodyssey.py
b9a537e8386fb4b4b80e9ec89e0cdf392dbd6f61
#Copyright ReportLab Europe Ltd. 2000-2017 #see license.txt for license details __version__='3.3.0' __doc__='' #REPORTLAB_TEST_SCRIPT import sys, copy, os from reportlab.platypus import * _NEW_PARA=os.environ.get('NEW_PARA','0')[0] in ('y','Y','1') _REDCAP=int(os.environ.get('REDCAP','0')) _CALLBACK=os.environ.get('CA...
[((718, 739), 'reportlab.lib.styles.getSampleStyleSheet', 'getSampleStyleSheet', ([], {}), '()\n', (737, 739), False, 'from reportlab.lib.styles import getSampleStyleSheet\n'), ((2071, 2104), 'copy.deepcopy', 'copy.deepcopy', (["styles['Heading1']"], {}), "(styles['Heading1'])\n", (2084, 2104), False, 'import sys, copy...
Traceabl3/GamestonkTerminal
tests/test_fred_fred_view.py
922353cade542ce3f62701e10d816852805b9386
""" econ/fred_view.py tests """ import unittest from unittest import mock from io import StringIO import pandas as pd # pylint: disable=unused-import from gamestonk_terminal.econ.fred_view import get_fred_data # noqa: F401 fred_data_mock = """ ,GDP 2019-01-01,21115.309 2019-04-01,21329.877 2019-07-01,21540.325 2019-...
[((474, 537), 'unittest.mock.patch', 'mock.patch', (['"""gamestonk_terminal.econ.fred_view.Fred.get_series"""'], {}), "('gamestonk_terminal.econ.fred_view.Fred.get_series')\n", (484, 537), False, 'from unittest import mock\n'), ((729, 763), 'gamestonk_terminal.econ.fred_view.get_fred_data', 'get_fred_data', (["['--nopl...
jt6562/XX-Net
python27/1.0/lib/linux/gevent/pool.py
7b78e4820a3c78c3ba3e75b3917129d17f00e9fc
# Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details. """Managing greenlets in a group. The :class:`Group` class in this module abstracts a group of running greenlets. When a greenlet dies, it's automatically removed from the group. The :class:`Pool` which a subclass of :class:`Group` provides a way to li...
[]
anshumandutt/AreCELearnedYet
lecarb/estimator/lw/lw_tree.py
e2286c3621dea8e4961057b6197c1e14e75aea5a
import time import logging from typing import Dict, Any, Tuple import pickle import numpy as np import xgboost as xgb from .common import load_lw_dataset, encode_query, decode_label from ..postgres import Postgres from ..estimator import Estimator from ..utils import evaluate, run_test from ...dataset.dataset import ...
[((435, 462), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (452, 462), False, 'import logging\n'), ((745, 765), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (759, 765), True, 'import numpy as np\n'), ((1395, 1406), 'time.time', 'time.time', ([], {}), '()\n', (1404,...
yamasampo/fsim
fsim/utils.py
30100789b03981dd9ea11c5c2e17a3c53910f724
import os import configparser from warnings import warn def read_control_file(control_file): # Initialize ConfigParser object config = configparser.ConfigParser( strict=True, comment_prefixes=('/*', ';', '#'), inline_comment_prefixes=('/*', ';', '#') ) # Parse control file ...
[((145, 264), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {'strict': '(True)', 'comment_prefixes': "('/*', ';', '#')", 'inline_comment_prefixes': "('/*', ';', '#')"}), "(strict=True, comment_prefixes=('/*', ';', '#'),\n inline_comment_prefixes=('/*', ';', '#'))\n", (170, 264), False, 'import confi...
mahgadalla/pymor
src/pymortests/function.py
ee2806b4c93748e716294c42454d611415da7b5e
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2017 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) import numpy as np import pytest from pymor.core.pickle import dumps, loads from pymor.functions....
[((1045, 1087), 'pymortests.fixtures.parameter.parameters_of_type', 'parameters_of_type', (['f.parameter_type', '(4711)'], {}), '(f.parameter_type, 4711)\n', (1063, 1087), False, 'from pymortests.fixtures.parameter import parameters_of_type\n'), ((2526, 2552), 'pymortests.pickling.assert_picklable', 'assert_picklable',...
CarberZ/social-media-mining
Code/userIDCrawler.py
41aee64a41244a0692987b75b30dedbd0552be49
''' step 1 get the userID and their locations put them all into a database ''' from bs4 import BeautifulSoup import urllib import sqlite3 from selenium import webdriver import time import re from urllib import request import random import pickle import os import pytesseract url_dog = "http...
[((1135, 1158), 'sqlite3.connect', 'sqlite3.connect', (['dbName'], {}), '(dbName)\n', (1150, 1158), False, 'import sqlite3\n'), ((1919, 1947), 're.split', 're.split', (['"""mark"""', 'memberList'], {}), "('mark', memberList)\n", (1927, 1947), False, 'import re\n'), ((1973, 2032), 're.findall', 're.findall', (['"""<div ...
saarkatz/guppy-struct
src/stoat/core/structure/__init__.py
b9099353312c365cfd788dbd2d168a9c844765be
from .structure import Structure
[]
iminders/TradeBaselines
tbase/network/polices_test.py
26eb87f2bcd5f6ff479149219b38b17002be6a40
import unittest import numpy as np from tbase.common.cmd_util import set_global_seeds from tbase.network.polices import RandomPolicy class TestPolices(unittest.TestCase): @classmethod def setUpClass(self): set_global_seeds(0) def test_random_policy(self): policy = RandomPolicy(2) ...
[((693, 708), 'unittest.main', 'unittest.main', ([], {}), '()\n', (706, 708), False, 'import unittest\n'), ((226, 245), 'tbase.common.cmd_util.set_global_seeds', 'set_global_seeds', (['(0)'], {}), '(0)\n', (242, 245), False, 'from tbase.common.cmd_util import set_global_seeds\n'), ((298, 313), 'tbase.network.polices.Ra...
knikolla/keystone
keystone/tests/unit/core.py
50f0a50cf4d52d3f61b64713bd4faa7a4626ae53
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[((1891, 1929), 'os.path.join', 'os.path.join', (['TESTSDIR', '"""config_files"""'], {}), "(TESTSDIR, 'config_files')\n", (1903, 1929), False, 'import os\n'), ((2008, 2039), 'os.path.join', 'os.path.join', (['ROOTDIR', '"""vendor"""'], {}), "(ROOTDIR, 'vendor')\n", (2020, 2039), False, 'import os\n'), ((2049, 2077), 'o...
sneelco/PyISY
PyISY/Nodes/__init__.py
f1f916cd7951b1b6a5235bb36444c695fe3294e1
from .group import Group from .node import (Node, parse_xml_properties, ATTR_ID) from time import sleep from xml.dom import minidom class Nodes(object): """ This class handles the ISY nodes. This class can be used as a dictionary to navigate through the controller's structure to objects of type :cla...
[((10857, 10872), 'time.sleep', 'sleep', (['waitTime'], {}), '(waitTime)\n', (10862, 10872), False, 'from time import sleep\n'), ((6068, 6092), 'xml.dom.minidom.parseString', 'minidom.parseString', (['xml'], {}), '(xml)\n', (6087, 6092), False, 'from xml.dom import minidom\n'), ((10988, 11012), 'xml.dom.minidom.parseSt...
easyScience/easyCore
easyCore/Utils/Logging.py
5d16d5b27803277d0c44886f94dab599f764ae0b
# SPDX-FileCopyrightText: 2021 easyCore contributors <core@easyscience.software> # SPDX-License-Identifier: BSD-3-Clause # © 2021 Contributors to the easyCore project <https://github.com/easyScience/easyCore> __author__ = 'github.com/wardsimon' __version__ = '0.1.0' import logging class Logger: def __init__...
[((381, 408), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (398, 408), False, 'import logging\n'), ((848, 878), 'logging.getLogger', 'logging.getLogger', (['logger_name'], {}), '(logger_name)\n', (865, 878), False, 'import logging\n')]
mustx1/MYIQ
iqoptionapi/http/billing.py
3afb597aa8a8abc278b7d70dad46af81789eae3e
"""Module for IQ option billing resource.""" from iqoptionapi.http.resource import Resource class Billing(Resource): """Class for IQ option billing resource.""" # pylint: disable=too-few-public-methods url = "billing"
[]
honewatson/defaults
defaultsob/core.py
c6a845ec1f25fc82e7645dfee60dd2df1cfa4e81
# -*- coding: utf-8 -*- def ordered_set(iter): """Creates an ordered set @param iter: list or tuple @return: list with unique values """ final = [] for i in iter: if i not in final: final.append(i) return final def class_slots(ob): """Get object attributes from...
[]
item4/yui
tests/bot_test.py
8628d0d54b94ada3cbe7d1b0f624063258bad10a
import asyncio from collections import defaultdict from datetime import timedelta import pytest from yui.api import SlackAPI from yui.bot import Bot from yui.box import Box from yui.types.slack.response import APIResponse from yui.utils import json from .util import FakeImportLib def test_bot_init(event_loop, monk...
[((509, 514), 'yui.box.Box', 'Box', ([], {}), '()\n', (512, 514), False, 'from yui.box import Box\n'), ((525, 567), 'yui.bot.Bot', 'Bot', (['bot_config', 'event_loop'], {'using_box': 'box'}), '(bot_config, event_loop, using_box=box)\n', (528, 567), False, 'from yui.bot import Bot\n'), ((2020, 2025), 'yui.box.Box', 'Box...
CesMak/aruco_detector_ocv
scripts/marker_filter.py
bb45e39664247779cbbbc8d37b89c4556b4984d6
#!/usr/bin/env python import numpy as np import rospy import geometry_msgs.msg import tf2_ros from tf.transformations import quaternion_slerp def translation_to_numpy(t): return np.array([t.x, t.y, t.z]) def quaternion_to_numpy(q): return np.array([q.x, q.y, q.z, q.w]) if __name__ == '__main__': rosp...
[((185, 210), 'numpy.array', 'np.array', (['[t.x, t.y, t.z]'], {}), '([t.x, t.y, t.z])\n', (193, 210), True, 'import numpy as np\n'), ((252, 282), 'numpy.array', 'np.array', (['[q.x, q.y, q.z, q.w]'], {}), '([q.x, q.y, q.z, q.w])\n', (260, 282), True, 'import numpy as np\n'), ((316, 348), 'rospy.init_node', 'rospy.init...
hankyul2/FaceDA
src/backbone/utils.py
73006327df3668923d4206f81d4976ca1240329d
import os import subprocess from pathlib import Path from torch.hub import load_state_dict_from_url import numpy as np model_urls = { # ResNet 'resnet18': 'https://download.pytorch.org/models/resnet18-f37072fd.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-b627a593.pth', 'resnet50':...
[((3693, 3711), 'numpy.load', 'np.load', (['file_name'], {}), '(file_name)\n', (3700, 3711), True, 'import numpy as np\n'), ((3622, 3681), 'subprocess.run', 'subprocess.run', (["['wget', '-r', '-nc', '-O', file_name, url]"], {}), "(['wget', '-r', '-nc', '-O', file_name, url])\n", (3636, 3681), False, 'import subprocess...
pjha1994/Scrape_reddit
crawler1.py
2a00a83854085e09f0cf53aef81969025876039b
import requests from bs4 import BeautifulSoup def recursiveUrl(url, link, depth): if depth == 5: return url else: print(link['href']) page = requests.get(url + link['href']) soup = BeautifulSoup(page.text, 'html.parser') newlink = soup.find('a') if len(newlink) =...
[((457, 474), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (469, 474), False, 'import requests\n'), ((486, 525), 'bs4.BeautifulSoup', 'BeautifulSoup', (['page.text', '"""html.parser"""'], {}), "(page.text, 'html.parser')\n", (499, 525), False, 'from bs4 import BeautifulSoup\n'), ((174, 206), 'requests.get'...
BrianThomasRoss/CHIME-2
chime2/tests/normal/models/seir_test.py
f084ab552fac5e50841a922293b74d653450790b
"""Tests for SEIR model in this repo * Compares conserved quantities * Compares model against SEIR wo social policies in limit to SIR """ from pandas import Series from pandas.testing import assert_frame_equal, assert_series_equal from bayes_chime.normal.models import SEIRModel, SIRModel from pytest import fixture fro...
[((709, 734), 'pytest.fixture', 'fixture', ([], {'name': '"""seir_data"""'}), "(name='seir_data')\n", (716, 734), False, 'from pytest import fixture\n'), ((1215, 1226), 'bayes_chime.normal.models.SEIRModel', 'SEIRModel', ([], {}), '()\n', (1224, 1226), False, 'from bayes_chime.normal.models import SEIRModel, SIRModel\n...
mrware91/PhilTransA-TRXS-Limits
Libraries/mattsLibraries/mathOperations.py
5592c6c66276cd493d10f066aa636aaf600d3a00
import numpy as np from scipy.interpolate import interp1d from pyTools import * ################################################################################ #~~~~~~~~~Log ops ################################################################################ def logPolyVal(p,x): ord = p.order() logs = [] ...
[((804, 836), 'scipy.interpolate.interp1d', 'interp1d', (['x', 'y'], {'kind': 'interp_type'}), '(x, y, kind=interp_type)\n', (812, 836), False, 'from scipy.interpolate import interp1d\n'), ((1129, 1158), 'numpy.linspace', 'np.linspace', (['(0)', 'np.pi', 'ntheta'], {}), '(0, np.pi, ntheta)\n', (1140, 1158), True, 'impo...
avryhof/ambient_api
setup.py
08194b5d8626801f2c2c7369adacb15eace54802
from setuptools import setup setup( name="ambient_api", version="1.5.6", packages=["ambient_api"], url="https://github.com/avryhof/ambient_api", license="MIT", author="Amos Vryhof", author_email="amos@vryhofresearch.com", description="A Python class for accessing the Ambient Weather API...
[((30, 545), 'setuptools.setup', 'setup', ([], {'name': '"""ambient_api"""', 'version': '"""1.5.6"""', 'packages': "['ambient_api']", 'url': '"""https://github.com/avryhof/ambient_api"""', 'license': '"""MIT"""', 'author': '"""Amos Vryhof"""', 'author_email': '"""amos@vryhofresearch.com"""', 'description': '"""A Python...
ganeshutah/FPChecker
tests/llvm/static/test_main_is_found/test_main_is_found.py
53a471429762ace13f69733cb2f8b7227fc15b9f
#!/usr/bin/env python import subprocess import os def setup_module(module): THIS_DIR = os.path.dirname(os.path.abspath(__file__)) os.chdir(THIS_DIR) def teardown_module(module): cmd = ["make clean"] cmdOutput = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) def test_1(): cmd...
[((140, 158), 'os.chdir', 'os.chdir', (['THIS_DIR'], {}), '(THIS_DIR)\n', (148, 158), False, 'import os\n'), ((230, 296), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'stderr': 'subprocess.STDOUT', 'shell': '(True)'}), '(cmd, stderr=subprocess.STDOUT, shell=True)\n', (253, 296), False, 'import subpr...
kamnon/regipy
regipy/exceptions.py
12d3be9da631dcc0d6fb342767e51ec4799141c6
class RegipyException(Exception): """ This is the parent exception for all regipy exceptions """ pass class RegipyGeneralException(RegipyException): """ General exception """ pass class RegistryValueNotFoundException(RegipyException): pass class NoRegistrySubkeysException(Regipy...
[]
Zhenye-Na/LxxxCode
Dynamic_Programming/1259.Integer Replacement/Solution_BFS.py
afd79d790d0a7495d75e6650f80adaa99bd0ff07
from collections import deque class Solution: """ @param n: a positive integer @return: the minimum number of replacements """ def integerReplacement(self, n): # Write your code here steps = 0 if n == 1: return steps queue = deque([n]) while q...
[((294, 304), 'collections.deque', 'deque', (['[n]'], {}), '([n])\n', (299, 304), False, 'from collections import deque\n')]
enflo/weather-flask
src/routes/web.py
c4d905e1f557b4c9b39d0a578fdbb6fefc839028
from flask import Blueprint, render_template from gateways.models import getWeatherData web = Blueprint("web", __name__, template_folder='templates') @web.route("/", methods=['GET']) def home(): items = getWeatherData.get_last_item() cityName = items["city"] return render_template("index.html", ...
[((96, 151), 'flask.Blueprint', 'Blueprint', (['"""web"""', '__name__'], {'template_folder': '"""templates"""'}), "('web', __name__, template_folder='templates')\n", (105, 151), False, 'from flask import Blueprint, render_template\n'), ((210, 240), 'gateways.models.getWeatherData.get_last_item', 'getWeatherData.get_las...
bowlofstew/changes
changes/buildsteps/lxc.py
ebd393520e0fdb07c240a8d4e8747281b6186e28
from __future__ import absolute_import from changes.buildsteps.default import DefaultBuildStep class LXCBuildStep(DefaultBuildStep): """ Similar to the default build step, except that it runs the client using the LXC adapter. """ def can_snapshot(self): return True def get_label(self...
[]
anvytran-dev/mycode
swapidemo1.py
3753c19828f0ecc506a6450bb6b71b4a5d651e5f
#!/usr/bin/env python3 """Star Wars API HTTP response parsing""" # requests is used to send HTTP requests (get it?) import requests URL= "https://swapi.dev/api/people/1" def main(): """sending GET request, checking response""" # SWAPI response is stored in "resp" object resp= requests.get(URL) # wh...
[((293, 310), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (305, 310), False, 'import requests\n')]
Deltares/NBSDynamics
src/biota_models/vegetation/model/constants_json_create.py
4710da529d85b588ea249f6e2b4f4cac132bb34f
import json schema = { "Spartina": { "ColStart": "2000-04-01", "ColEnd": "2000-05-31", "random": 7, "mud_colonization": [0.0, 0.0], "fl_dr": 0.005, "Maximum age": 20, "Number LifeStages": 2, "initial root length": 0.05, "initial shoot length":...
[((4092, 4131), 'json.dump', 'json.dump', (['schema', 'write_file'], {'indent': '(4)'}), '(schema, write_file, indent=4)\n', (4101, 4131), False, 'import json\n')]
harshad-deo/TorchVI
format/format.bzl
f66d1486201368c9906869477ba7ae254d2e7191
def _replace_formatted(ctx, manifest, files): out = ctx.actions.declare_file(ctx.label.name) # this makes it easier to add variables file_lines = [ """#!/bin/bash -e WORKSPACE_ROOT="${1:-$BUILD_WORKSPACE_DIRECTORY}" """, """RUNPATH="${TEST_SRCDIR-$0.runfiles}"/""" + ctx.workspace_name, ...
[]
GunnerJnr/_CodeInstitute
Stream-3/Full-Stack-Development/10.Custom-User-And-Email-Authentication/2.Custom-User-Model/auth_demo/accounts/models.py
efba0984a3dc71558eef97724c85e274a712798c
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth.models import AbstractUser, UserManager from django.db import models from django.utils import timezone # Create your models here. # Create our new user class class AccountUserManager(UserManager): def _create_user(self, usern...
[((673, 687), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (685, 687), False, 'from django.utils import timezone\n')]
mahmoudnafifi/HistoGAN
histoGAN.py
50be1482638ace3ec85d733e849dec494ede155b
""" If you find this code useful, please cite our paper: Mahmoud Afifi, Marcus A. Brubaker, and Michael S. Brown. "HistoGAN: Controlling Colors of GAN-Generated and Real Images via Color Histograms." In CVPR, 2021. @inproceedings{afifi2021histogan, title={Histo{GAN}: Controlling Colors of {GAN}-Generated and R...
[((787, 799), 'numpy.sqrt', 'np.sqrt', (['(2.0)'], {}), '(2.0)\n', (794, 799), True, 'import numpy as np\n'), ((1629, 2225), 'histoGAN.Trainer', 'Trainer', (['name', 'results_dir', 'models_dir'], {'batch_size': 'batch_size', 'gradient_accumulate_every': 'gradient_accumulate_every', 'image_size': 'image_size', 'network_...
Kpaubert/onlineweb4
apps/careeropportunity/migrations/0003_careeropportunity_deadline.py
9ac79f163bc3a816db57ffa8477ea88770d97807
# -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-10-05 18:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("careeropportunity", "0002_careeropportunity_job_type")] operations = [ migrations.AddFie...
[((415, 483), 'django.db.models.DateField', 'models.DateField', ([], {'blank': '(True)', 'null': '(True)', 'verbose_name': '"""søknadsfrist"""'}), "(blank=True, null=True, verbose_name='søknadsfrist')\n", (431, 483), False, 'from django.db import migrations, models\n')]
grygielski/incubator-mxnet
benchmark/python/ffi/benchmark_ffi.py
45952e21a35e32a04b7607b121085973369a42db
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[((13580, 13605), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (13603, 13605), False, 'import argparse\n'), ((14112, 14138), 'mxnet.npx.set_np', 'mx.npx.set_np', ([], {'dtype': '(False)'}), '(dtype=False)\n', (14125, 14138), True, 'import mxnet as mx\n'), ((1741, 1756), 'mxnet.np.ones', 'dnp....
levabd/smart-climat-daemon
first-floor.py
8ff273eeb74fb03ea04fda11b0128fa13d35b500
#!/usr/bin/env python3 import json import argparse import re import datetime import paramiko import requests # cmd ['ssh', 'smart', # 'mkdir -p /home/levabd/smart-home-temp-humidity-monitor; # cat - > /home/levabd/smart-home-temp-humidity-monitor/lr.json'] from miio import chuangmi_plug from btlewrap import availabl...
[((522, 534), 'json.load', 'json.load', (['f'], {}), '(f)\n', (531, 534), False, 'import json\n'), ((597, 687), 're.compile', 're.compile', (['"""[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}"""'], {}), "(\n '[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}')\n", (607...
Optimist-Prime/QML-for-MNIST-classification
reservior_classification.py
7513b3faa548166dba3df927a248e8c7f1ab2a15
import pickle from sklearn.neural_network import MLPClassifier train = pickle.load(open('train_pca_reservoir_output_200samples.pickle','rb')) test = pickle.load(open('test_pca_reservoir_output_50samples.pickle','rb')) train_num = 200 test_num = 50 mlp = MLPClassifier(hidden_layer_sizes=(2000,), max_iter=100, alpha=1...
[((257, 427), 'sklearn.neural_network.MLPClassifier', 'MLPClassifier', ([], {'hidden_layer_sizes': '(2000,)', 'max_iter': '(100)', 'alpha': '(1e-05)', 'solver': '"""sgd"""', 'verbose': '(10)', 'tol': '(0.0001)', 'random_state': '(1)', 'learning_rate_init': '(0.1)', 'batch_size': '(20)'}), "(hidden_layer_sizes=(2000,), ...
delmarrerikaine/LPG-PCA
util.py
deb631ee2c4c88190ce4204fcbc0765ae5cd8f53
import numpy as np import pandas as pd from skimage import io import skimage.measure as measure import os from lpg_pca_impl import denoise def getNoisedImage(originalImage, variance): # return random_noise(originalImage, mode='gaussian', var=variance) np.random.seed(42) noise = np.random.normal(size=origi...
[((262, 280), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (276, 280), True, 'import numpy as np\n'), ((293, 335), 'numpy.random.normal', 'np.random.normal', ([], {'size': 'originalImage.shape'}), '(size=originalImage.shape)\n', (309, 335), True, 'import numpy as np\n'), ((915, 947), 'skimage.measur...
kringen/wingnut
ui/ui.py
73be4f8393720ff0932ab069543e5f2d2308296d
import redis from rq import Queue, Connection from flask import Flask, render_template, Blueprint, jsonify, request import tasks import rq_dashboard from wingnut import Wingnut app = Flask( __name__, template_folder="./templates", static_folder="./static", ) app.config.from_object(rq_dashb...
[((184, 256), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""./templates"""', 'static_folder': '"""./static"""'}), "(__name__, template_folder='./templates', static_folder='./static')\n", (189, 256), False, 'from flask import Flask, render_template, Blueprint, jsonify, request\n'), ((465, 498), 'flask.r...
Openmail/pytaboola
pytaboola/__init__.py
ed71b3b9c5fb2e4452d4b6d40aec1ff037dd5436
from pytaboola.client import TaboolaClient
[]
omi28/ga-learner-dst-repo
omkar/code.py
396c35ea56028717a96aed6ca771e39ebf68dc5b
# -------------- # Importing header files import numpy as np import warnings warnings.filterwarnings('ignore') new_record=[[50, 9, 4, 1, 0, 0, 40, 0]] #New record #Reading file data = np.genfromtxt(path, delimiter=",", skip_header=1) data.shape cenus=np.concatenate((new_record,data),axis=0) cenus....
[((82, 115), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (105, 115), False, 'import warnings\n'), ((203, 252), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(path, delimiter=',', skip_header=1)\n", (216, 252), True, 'i...
jchampio/apache-websocket
test/present.py
18ad4ae2fc99381b8d75785f492a479f789b322b
#! /usr/bin/env python # # Presents the results of an Autobahn TestSuite run in TAP format. # # Copyright 2015 Jacob Champion # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
[((1290, 1312), 'textwrap.wrap', 'textwrap.wrap', (['raw', '(80)'], {}), '(raw, 80)\n', (1303, 1312), False, 'import textwrap\n'), ((1628, 1649), 'json.load', 'json.load', (['index_file'], {}), '(index_file)\n', (1637, 1649), False, 'import json\n'), ((3364, 3385), 'yamlish.dumps', 'yamlish.dumps', (['output'], {}), '(...
WEBZCC/softwarecollections
softwarecollections/scls/migrations/0004_other_repos_default_values.py
efee5c3c276033d526a0cdba504d43deff71581e
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scls', '0003_other_repos'), ] operations = [ migrations.AlterField( model_name='otherrepo', name='ar...
[((343, 431), 'django.db.models.CharField', 'models.CharField', ([], {'default': '""""""', 'blank': '(True)', 'verbose_name': '"""Architecture"""', 'max_length': '(20)'}), "(default='', blank=True, verbose_name='Architecture',\n max_length=20)\n", (359, 431), False, 'from django.db import migrations, models\n'), ((5...
davidgjy/arch-lib
python/Excel/enumerateCells.py
b4402b96d2540995a848e6c5f600b2d99847ded6
import openpyxl wb = openpyxl.load_workbook('example.xlsx') sheet = wb.get_sheet_by_name('Sheet1') rows = sheet.get_highest_row() cols = sheet.get_highest_column() for i in range(1, rows + 1): for j in range(1, cols + 1): print('%s: %s' % (sheet.cell(row=i, column=j).coordinate, sheet.cell(row=i, column=j)....
[((24, 62), 'openpyxl.load_workbook', 'openpyxl.load_workbook', (['"""example.xlsx"""'], {}), "('example.xlsx')\n", (46, 62), False, 'import openpyxl\n')]
BLSQ/iaso-copy
plugins/polio/migrations/0029_campaign_country.py
85fb17f408c15e8c2d730416d1312f58f8db39b7
# Generated by Django 3.1.13 on 2021-10-04 11:44 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("iaso", "0107_auto_20211001_1845"), ("polio", "0028_remove_campaign_budget_first_draft_submitted_at"), ] op...
[((443, 672), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'help_text': '"""Country for campaign, set automatically from initial_org_unit"""', 'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'related_name': '"""campaigns_country"""', 'to': '"""iaso.orgunit"""'}), "(b...
aarana14/CurrencyExchange
CurrencyExchange.py
e3f35c1481acf19683a74a41509b1dd37ae48594
#import external libraries used in code import requests, json import pycountry print('Currency Exchange') currencies = [] def findCurrency(): #Finds all avaliable currencies allCurrency = (list(pycountry.currencies)) for x in allCurrency: y = str(x) y = y[18:21] #Adds th...
[((4923, 4940), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (4935, 4940), False, 'import requests, json\n')]
knuu/competitive-programming
atcoder/corp/codethxfes2014a_e.py
16bc68fdaedd6f96ae24310d697585ca8836ab6e
r, c, m = map(int, input().split()) n = int(input()) op = [list(map(lambda x: int(x) - 1, input().split())) for _ in range(n)] board = [[0 for _ in range(c)] for _ in range(r)] for ra, rb, ca, cb in op: for j in range(ra, rb + 1): for k in range(ca, cb + 1): board[j][k] += 1 cnt = 0 for i in ra...
[]
QU-XIAO/yambopy
scripts/analyse_bse.py
ff65a4f90c1bfefe642ebc61e490efe781709ff9
# Copyright (C) 2018 Alexandre Morlet, Henrique Pereira Coutada Miranda # All rights reserved. # # This file is part of yambopy # from __future__ import print_function from builtins import range from yambopy import * from qepy import * import json import matplotlib.pyplot as plt import numpy as np import sys import arg...
[((4669, 4766), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Study convergence on BS calculations using ypp calls."""'}), "(description=\n 'Study convergence on BS calculations using ypp calls.')\n", (4692, 4766), False, 'import argparse\n'), ((3317, 3329), 'json.load', 'json.load',...
richteer/pyfatafl
halmodule.py
1faddcf5d9eb36cbc6952b9a8e8bb899989f7112
from module import XMPPModule import halutils import pyfatafl class Game(): self.players = [] self.xmpp = None self.b = None self.turn = "" self.mod = None def __init__(self, mod, p1, p2): self.players = [p1, p2] self.mod = mod self.xmpp = mod.xmpp self.xmpp.sendMsg(p2, "You have been challenged to play...
[]
arkhipenko/AceTime
tools/acetz.py
bc6e6aa530e309b62a204b7574322ba013066b06
from typing import cast, Optional from datetime import datetime, tzinfo, timedelta from zonedbpy import zone_infos from zone_processor.zone_specifier import ZoneSpecifier from zone_processor.inline_zone_info import ZoneInfo __version__ = '1.1' class acetz(tzinfo): """An implementation of datetime.tzinfo using th...
[((473, 525), 'zone_processor.zone_specifier.ZoneSpecifier', 'ZoneSpecifier', (['zone_info'], {'use_python_transition': '(True)'}), '(zone_info, use_python_transition=True)\n', (486, 525), False, 'from zone_processor.zone_specifier import ZoneSpecifier\n'), ((964, 1007), 'datetime.timedelta', 'timedelta', ([], {'second...
kozakusek/ipp-2020-testy
z2/part2/interactive/jm/random_fuzzy_arrows_1/554539540.py
09aa008fa53d159672cc7cbf969a6b237e15a7b8
from part1 import ( gamma_board, gamma_busy_fields, gamma_delete, gamma_free_fields, gamma_golden_move, gamma_golden_possible, gamma_move, gamma_new, ) """ scenario: test_random_actions uuid: 554539540 """ """ random actions, total chaos """ board = gamma_new(6, 8, 3, 17) assert board i...
[((283, 305), 'part1.gamma_new', 'gamma_new', (['(6)', '(8)', '(3)', '(17)'], {}), '(6, 8, 3, 17)\n', (292, 305), False, 'from part1 import gamma_board, gamma_busy_fields, gamma_delete, gamma_free_fields, gamma_golden_move, gamma_golden_possible, gamma_move, gamma_new\n'), ((1502, 1520), 'part1.gamma_board', 'gamma_boa...
ZhuoyuWei/transformers
examples/run_chemistry_parser.py
16d0ebd55d17dd5095231566a0544ecebd56bc9c
# coding=utf-8 # Copyright 2019 The HuggingFace Inc. team. # Copyright (c) 2019 The HuggingFace 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.a...
[((811, 833), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (826, 833), False, 'import sys\n'), ((1699, 1726), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1716, 1726), False, 'import logging\n'), ((1727, 1785), 'logging.basicConfig', 'logging.basicConfig', ([...
MTES-MCT/envergo
envergo/geodata/management/commands/import_shapefiles.py
8bb6e4ffa15a39edda51b39401db6cc12e73ad0a
from django.contrib.gis.gdal import DataSource from django.contrib.gis.utils import LayerMapping from django.core.management.base import BaseCommand from envergo.geodata.models import Zone class Command(BaseCommand): help = "Importe des zones à partir de shapefiles." def add_arguments(self, parser): ...
[((459, 480), 'django.contrib.gis.gdal.DataSource', 'DataSource', (['shapefile'], {}), '(shapefile)\n', (469, 480), False, 'from django.contrib.gis.gdal import DataSource\n'), ((555, 586), 'django.contrib.gis.utils.LayerMapping', 'LayerMapping', (['Zone', 'ds', 'mapping'], {}), '(Zone, ds, mapping)\n', (567, 586), Fals...
duanqiaobb/vim-for-java
vimfiles/bundle/ultisnips/test/test_AnonymousExpansion.py
01b60e4494e65a73c9a9de00f50259d8a7c8d0bb
from test.vim_test_case import VimTestCase as _VimTest from test.constant import * # Anonymous Expansion {{{# class _AnonBase(_VimTest): args = '' def _extra_options_pre_init(self, vim_config): vim_config.append('inoremap <silent> %s <C-R>=UltiSnips#Anon(%s)<cr>' % (EA, se...
[]
jkchen2/JshBot-plugins
data_converter/data_converter.py
b5999fecf0df067e34673ff193dcfbf8c7e2fde2
import discord from jshbot import utilities, data, configurations, plugins, logger from jshbot.exceptions import BotException, ConfiguredBotException from jshbot.commands import ( Command, SubCommand, Shortcut, ArgTypes, Attachment, Arg, Opt, MessageTypes, Response) __version__ = '0.1.0' CBException = ConfiguredB...
[((309, 352), 'jshbot.exceptions.ConfiguredBotException', 'ConfiguredBotException', (['"""0.3 to 0.4 plugin"""'], {}), "('0.3 to 0.4 plugin')\n", (331, 352), False, 'from jshbot.exceptions import BotException, ConfiguredBotException\n'), ((655, 677), 'jshbot.commands.Response', 'Response', (['"""Converted."""'], {}), "...
ankit98040/TKINTER-JIS
tut2.py
8b650138bf8ab2449da83e910ee33c0caee69a8d
from tkinter import * from PIL import Image, ImageTk #python image library #imagetk supports jpg image a1 = Tk() a1.geometry("455x244") #for png image #photo = PhotoImage(file="filename.png") #a2 = Label(image = photo) #a2.pack() image = Image.open("PJXlVd.jpg") photo = ImageTk.PhotoImage(image) ...
[((256, 280), 'PIL.Image.open', 'Image.open', (['"""PJXlVd.jpg"""'], {}), "('PJXlVd.jpg')\n", (266, 280), False, 'from PIL import Image, ImageTk\n'), ((290, 315), 'PIL.ImageTk.PhotoImage', 'ImageTk.PhotoImage', (['image'], {}), '(image)\n', (308, 315), False, 'from PIL import Image, ImageTk\n')]
mintanwei/IPCLs-Net
dataset.py
04937df683216a090c0749cc90ab7e517dbab0fd
import os import torch from PIL import Image from read_csv import csv_to_label_and_bbx import numpy as np from torch.utils.data import Subset, random_split, ConcatDataset class NBIDataset(object): def __init__(self, root, transforms, nob3=False): self.root = root self.transforms = transforms ...
[((7492, 7513), 'torch.manual_seed', 'torch.manual_seed', (['(13)'], {}), '(13)\n', (7509, 7513), False, 'import torch\n'), ((7532, 7570), 'torch.utils.data.random_split', 'random_split', (['ds', '[46, 46, 46, 45, 45]'], {}), '(ds, [46, 46, 46, 45, 45])\n', (7544, 7570), False, 'from torch.utils.data import Subset, ran...
FeliciaMJ/PythonLearningJourney
design_patterns/chapter5/mymath.py
ae1bfac872ee29256e69df6e0e8e507321404cba
# coding: utf-8 import functools def memoize(fn): known = dict() @functools.wraps(fn) def memoizer(*args): if args not in known: known[args] = fn(*args) return known[args] return memoizer @memoize def nsum(n): '''返回前n个数字的和''' assert(n >= 0), 'n must be >= 0' ...
[((78, 97), 'functools.wraps', 'functools.wraps', (['fn'], {}), '(fn)\n', (93, 97), False, 'import functools\n')]
yangyuke001/emotion-expression.shufflenetv2
transforms/__init__.py
d70fd17871fb758eb4fc7d2f9df430cc7e44ad64
from .transforms import *
[]
adRenaud/research
codes/elastoplasticity_spectralAnalysis/planeStress/slowWavePlaneStressSigDriven.py
2f0062a1800d7a17577bbfc2393b084253d567f4
# !\usr\bin\python import numpy as np from mpl_toolkits import mplot3d import matplotlib.pyplot as plt import scipy.optimize from matplotlib import animation from scipy.integrate import ode import pdb # Material parameters rho = 7800. E = 2.e11 nu = 0.3 mu = 0.5*E/(1.+nu) kappa = E/(3.*(1.-2.*nu)) lamb = kappa-2.*mu/3...
[]
cherish-web/pyhsms
pyhsms/core/connectionstate.py
83a88b8b45bf1aba30cb7572f44a02478009052b
# _*_ coding: utf-8 _*_ #@Time : 2020/7/29 上午 09:49 #@Author : cherish_peng #@Email : 1058386071@qq.com #@File : connectionstate.py #@Software : PyCharm from enum import Enum class ConnectionState(Enum): ''' ConnectionState enum ''' DisConnected = 0 Connecting=1 Connected=2 ...
[]
msanpe/lifelines
lifelines/fitters/coxph_fitter.py
a73d441f6347332ca870bf2ec32eeeca410dc6de
# -*- coding: utf-8 -*- import time from datetime import datetime import warnings from textwrap import dedent, fill import numpy as np import pandas as pd from numpy.linalg import norm, inv from scipy.linalg import solve as spsolve, LinAlgError from scipy.integrate import trapz from scipy import stats from lifelines....
[((10197, 10226), 'lifelines.utils.coalesce', 'coalesce', (['strata', 'self.strata'], {}), '(strata, self.strata)\n', (10205, 10226), False, 'from lifelines.utils import _get_index, _to_list, _to_tuple, _to_1d_array, inv_normal_cdf, normalize, qth_survival_times, coalesce, check_for_numeric_dtypes_or_raise, check_low_v...
asevans48/NLPServer
nlp_server/config/test/test_config.py
6feb1d89748165f9efea40d0777d355044c48176
""" Test configuration loading @author aevans """ import os from nlp_server.config import load_config def test_load_config(): """ Test loading a configuration """ current_dir = os.path.curdir test_path = os.path.sep.join([current_dir, 'data', 'test_config.json']) cfg = load_config.load_conf...
[((229, 288), 'os.path.sep.join', 'os.path.sep.join', (["[current_dir, 'data', 'test_config.json']"], {}), "([current_dir, 'data', 'test_config.json'])\n", (245, 288), False, 'import os\n'), ((299, 333), 'nlp_server.config.load_config.load_config', 'load_config.load_config', (['test_path'], {}), '(test_path)\n', (322, ...
ektai/frappe3
frappe/utils/safe_exec.py
44aa948b4d5a0d729eacfb3dabdc9c8894ae1799
import os, json, inspect import mimetypes from html2text import html2text from RestrictedPython import compile_restricted, safe_globals import RestrictedPython.Guards import frappe import frappe.utils import frappe.utils.data from frappe.website.utils import (get_shade, get_toc, get_next_link) from frappe.modules impo...
[((969, 983), 'frappe._dict', 'frappe._dict', ([], {}), '()\n', (981, 983), False, 'import frappe\n'), ((620, 667), 'frappe.msgprint', 'frappe.msgprint', (['"""Please Enable Server Scripts"""'], {}), "('Please Enable Server Scripts')\n", (635, 667), False, 'import frappe\n'), ((852, 878), 'RestrictedPython.compile_rest...
BarracudaPff/code-golf-data-pythpn
simplejson/ordered_dict.py
42e8858c2ebc6a061012bcadb167d29cebb85c5e
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger http://code.activestate.com/recipes/576693/ """ try: all except NameError: def all(seq): for elem in seq: if not elem: return False return True class OrderedDict(dict, DictMixin): def __init__(self, *args, **kwds): if len(args) > 1:...
[]
KRHS-GameProgramming-2015/Adlez
Water.py
8912da1ee4b3c7b105851dbcc00579ff0c3cf33e
from HardBlock import * class Water(HardBlock): def __init__(self, pos=[0,0], blockSize = 25): image = "Block/Block Images/water.png" HardBlock.__init__(self, image, pos, blockSize) def update(*args): pass
[]
bgalbraith/minerl-haiku-baselines
baselines/bc.py
c33b14699af14c904394d9c4e30dee680a8718d6
import dill import haiku as hk import jax from jax.experimental import optix import jax.numpy as jnp from dataset import load_data MINERL_ENV = 'MineRLTreechopVectorObf-v0' PARAMS_FILENAME = 'bc_params_treechop.pkl' class PovStack(hk.Module): """ PovStack is a module for processing the point-of-view image data...
[((2536, 2571), 'jax.numpy.concatenate', 'jnp.concatenate', (['(x_0, x_1)'], {'axis': '(1)'}), '((x_0, x_1), axis=1)\n', (2551, 2571), True, 'import jax.numpy as jnp\n'), ((2762, 2794), 'haiku.transform', 'hk.transform', (['behavioral_cloning'], {}), '(behavioral_cloning)\n', (2774, 2794), True, 'import haiku as hk\n')...
ajavadia/qiskit-sdk-py
qiskit/circuit/library/templates/__init__.py
a59e8e6be1793197e19998c1f7dcfc45e6f2f3af
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
[]
btddg28/ironpython
Tests/test_ironmath.py
8006238c19d08db5db9bada39d765143e631059e
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of th...
[((937, 968), 'clr.AddReference', 'clr.AddReference', (['math_assembly'], {}), '(math_assembly)\n', (953, 968), False, 'import clr\n'), ((1330, 1408), 'Microsoft.Scripting.Math.BigInteger.Add', 'BigInteger.Add', (['(1)', '(99999999999999999999999999999999999999999999999999999999999)'], {}), '(1, 99999999999999999999999...
timtyree/bgmc
python/lib/viewer/gener_q_vs_w_for_df.py
891e003a9594be9e40c53822879421c2b8c44eed
import matplotlib.pyplot as plt, numpy as np, pandas as pd,os from ..model import recall_powerlaw_fits_to_full_models from .. import compute_power_rmse from .bluf import * from ..measure.powerlaw import * from .gener_q_vs_w_for_result_folder import * def q_vs_w_plotter_function_from_df(ax,df): # npartitions=os.cp...
[((3730, 3758), 'numpy.mean', 'np.mean', (['(Delta_y_values ** 2)'], {}), '(Delta_y_values ** 2)\n', (3737, 3758), True, 'import matplotlib.pyplot as plt, numpy as np, pandas as pd, os\n')]
achyudh/castor
decatt/model.py
d7a02ce03f2b71ef1fa490122dd4bbc8214b8b19
import sys import math import numpy as np from datetime import datetime import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable class DecAtt(nn.Module): def __init__(self, num_units, num_classes, embedding_size, dropout, device=0, training=True, p...
[((1473, 1509), 'torch.nn.Embedding', 'nn.Embedding', (['max_sentence_length', '(1)'], {}), '(max_sentence_length, 1)\n', (1485, 1509), True, 'import torch.nn as nn\n'), ((1545, 1593), 'torch.nn.Linear', 'nn.Linear', (['embedding_size', 'num_units'], {'bias': '(False)'}), '(embedding_size, num_units, bias=False)\n', (1...