repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/cogent/maths/function_optimisation.py
fe6f8c8dfed86d39c80f2804a753c05bb2e485b4
#!/usr/bin/env python """Algorthims for function optimisation great_deluge() is a hillclimbing algorithm based on: Gunter Dueck: New Optimization Heuristics, The Great Deluge Algorithm and the Record-to-Record Travel. Journal of Computational Physics, Vol. 104, 1993, pp. 86 - 92 ga_evolve(...
[]
jonathanbglass/parallel_prowler
collect_policies.py
453774a69f078c7fce11c9bb72b6deab6fc04217
import argparse import boto3 import json import logging import os from progressbar import ProgressBar import sys """ Collects IAM Policies Evaluates policies looking for badness (*.*, Effect:Allow + NotAction) Need to add more tests/use cases """ def get_policies(profile): session = boto3.session.Session(profi...
[((293, 336), 'boto3.session.Session', 'boto3.session.Session', ([], {'profile_name': 'profile'}), '(profile_name=profile)\n', (314, 336), False, 'import boto3\n'), ((1735, 1783), 'progressbar.ProgressBar', 'ProgressBar', (['"""\tChecking for Dangerous Policies"""'], {}), "('\\tChecking for Dangerous Policies')\n", (17...
StackVista/stackstate-agent
test/molecule-role/molecule/integrations/tests/test_nagios.py
843f66189fae107646c57f71fed962bdaab3b3be
import json import os import re from testinfra.utils.ansible_runner import AnsibleRunner import util testinfra_hosts = AnsibleRunner(os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('agent-integrations') def _get_key_value(tag_list): for key, value in (pair.split(':', 1) for pair in tag_list): yield ke...
[((2256, 2295), 'util.wait_until', 'util.wait_until', (['assert_topology', '(30)', '(3)'], {}), '(assert_topology, 30, 3)\n', (2271, 2295), False, 'import util\n'), ((3514, 3555), 'util.wait_until', 'util.wait_until', (['wait_for_metrics', '(180)', '(3)'], {}), '(wait_for_metrics, 180, 3)\n', (3529, 3555), False, 'impo...
papsebestyen/erudition
erudition/util.py
35aa502a96189131baff714a6212eb56de2b1272
import os import sys from contextlib import contextmanager from invoke import UnexpectedExit def git_commit(c, addstr, msg): try: c.run("git config --get user.email") c.run("git config --get user.name") except UnexpectedExit: c.run('git config --local user.email "ci@cd.org"') ...
[((471, 482), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (480, 482), False, 'import os\n'), ((487, 504), 'os.chdir', 'os.chdir', (['dirpath'], {}), '(dirpath)\n', (495, 504), False, 'import os\n'), ((556, 568), 'os.chdir', 'os.chdir', (['wd'], {}), '(wd)\n', (564, 568), False, 'import os\n'), ((573, 588), 'sys.path.po...
MeekoI/ais-sdk
python3/distortion_correct_aksk_demo.py
76240abc49795e914988f3cafb6d08f60dbdcb4c
# -*- coding:utf-8 -*- from ais_sdk.utils import encode_to_base64 from ais_sdk.utils import decode_to_wave_file from ais_sdk.distortion_correct import distortion_correct_aksk from ais_sdk.utils import init_global_env import json if __name__ == '__main__': # # access moderation distortion correct.post data by a...
[((397, 433), 'ais_sdk.utils.init_global_env', 'init_global_env', ([], {'region': '"""cn-north-1"""'}), "(region='cn-north-1')\n", (412, 433), False, 'from ais_sdk.utils import init_global_env\n'), ((619, 688), 'ais_sdk.distortion_correct.distortion_correct_aksk', 'distortion_correct_aksk', (['app_key', 'app_secret', '...
Arpit8081/Phishtray_Edited_Version
exercise/migrations/0016_auto_20191025_1624.py
9f3342e6fd2620b7f01ad91ce5b36fa8ea111bc8
# Generated by Django 2.2.6 on 2019-10-25 16:24 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('exercise', '0015_exerciseemailproperties_date_received'), ] operations = [ migrations.AlterField( ...
[((396, 513), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.DO_NOTHING', 'to': '"""exercise.Exercise"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.DO_NOTHING, to='exercise.Exercise')\n", (413, 513), Fals...
YKato521/ironpython-stubs
release/stubs.min/Autodesk/Revit/DB/__init___parts/GeomCombinationSet.py
b1f7c580de48528490b3ee5791b04898be95a9ae
class GeomCombinationSet(APIObject, IDisposable, IEnumerable): """ A set that contains GeomCombination objects. GeomCombinationSet() """ def Clear(self): """ Clear(self: GeomCombinationSet) Removes every item GeomCombination the set,rendering it empty. """ pass ...
[]
omribahumi/rainbow
rainbow/datasources/cfn_datasource.py
17aad61231b1f1b9d0dca43979e2fa4c8a1603f3
from rainbow.cloudformation import Cloudformation from base import DataSourceBase __all__ = ['CfnOutputsDataSource', 'CfnResourcesDataSource', 'CfnParametersDataSource'] class CfnDataSourceBase(DataSourceBase): def __init__(self, data_source): super(CfnDataSourceBase, self).__init__(data_source) ...
[((510, 532), 'rainbow.cloudformation.Cloudformation', 'Cloudformation', (['region'], {}), '(region)\n', (524, 532), False, 'from rainbow.cloudformation import Cloudformation\n')]
idan/pypostbin
epio_commands/management/commands/epio_flush_redis.py
61dd1c0960e8fb6e4460a5623971cbbc78a55ee7
import redis from bundle_config import config from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): help = 'Flushes all keys in redis.' def handle_noargs(self, **options): r = redis.Redis(host=config['redis']['host'], port=int(config['redis']['port']), password=config['r...
[]
zmxdream/FlexFlow
python/flexflow_cffi_build.py
7ea50d71a02e853af7ae573d88c911511b3e82e0
#!/usr/bin/env python # Copyright 2020 Stanford University, Los Alamos National Laboratory # # 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 ...
[((2059, 2084), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2082, 2084), False, 'import argparse\n'), ((867, 917), 'os.path.join', 'os.path.join', (['prefix_dir', '"""python"""', '"""flexflow_c.h"""'], {}), "(prefix_dir, 'python', 'flexflow_c.h')\n", (879, 917), False, 'import os\n'), ((947...
tuxcell/gaphor
gaphor/plugins/xmiexport/__init__.py
22eb13479f589a0105ad25a11aed968e9ad932dc
"""This plugin extends Gaphor with XMI export functionality.""" import logging from gaphor.abc import ActionProvider, Service from gaphor.core import action, gettext from gaphor.plugins.xmiexport import exportmodel from gaphor.ui.filedialog import FileDialog logger = logging.getLogger(__name__) class XMIExport(Ser...
[((271, 298), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (288, 298), False, 'import logging\n'), ((945, 980), 'gaphor.core.gettext', 'gettext', (['"""Export model to XMI file"""'], {}), "('Export model to XMI file')\n", (952, 980), False, 'from gaphor.core import action, gettext\n'), ...
btk15049/online-judge-tools
tests/utils.py
22505e98359c50df06e7cc1d53a7d253cb096b14
import contextlib import os import pathlib import subprocess import sys import tempfile @contextlib.contextmanager def chdir(path): cwd = os.getcwd() try: os.chdir(path) yield finally: os.chdir(cwd) def prepare_files(files): for f in files: path = pathlib.Path(f['path...
[((144, 155), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (153, 155), False, 'import os\n'), ((742, 771), 'os.environ.get', 'os.environ.get', (['"""TEST_OJ_EXE"""'], {}), "('TEST_OJ_EXE')\n", (756, 771), False, 'import os\n'), ((1201, 1299), 'subprocess.run', 'subprocess.run', (['(oj_exe + args)'], {'stdout': 'subproce...
zerzerzerz/Computer-Virus
git_operation.py
4a3125b45e0e4210fb1b8c970a0d6c6bde77f2e8
import os commit_string = "选择data的前多少个维度参与训练" not_add = ['results', 'data', 'weights'] for item in os.listdir(): if item in not_add: # print(item) continue else: os.system(f"git add {item}") os.system(f'git commit -m "{commit_string}"') os.system("git push origin main")
[((100, 112), 'os.listdir', 'os.listdir', ([], {}), '()\n', (110, 112), False, 'import os\n'), ((224, 269), 'os.system', 'os.system', (['f"""git commit -m "{commit_string}\\""""'], {}), '(f\'git commit -m "{commit_string}"\')\n', (233, 269), False, 'import os\n'), ((270, 303), 'os.system', 'os.system', (['"""git push o...
peanut-butter-jellyyy/cool-compiler-2021
src/cool_grammar.py
63a668d435ed22cfb8dbb096bc3c82a34f09517b
from src.cmp.pycompiler import Grammar from src.ast_nodes import ( ProgramNode, ClassDeclarationNode, FuncDeclarationNode, AttrDeclarationNode, IfNode, WhileNode, LetNode, CaseNode, IsvoidNode, AssignNode, VarDeclarationNode, CaseItemNode, NotNode, ...
[((647, 656), 'src.cmp.pycompiler.Grammar', 'Grammar', ([], {}), '()\n', (654, 656), False, 'from src.cmp.pycompiler import Grammar\n'), ((2063, 2080), 'src.ast_nodes.ProgramNode', 'ProgramNode', (['s[1]'], {}), '(s[1])\n', (2074, 2080), False, 'from src.ast_nodes import ProgramNode, ClassDeclarationNode, FuncDeclarati...
Aliensuniquebot/CatUserbot
userbot/plugins/selfdestruct.py
93561a620fc1198c6fe6c259412088f4bc81d97b
# For @UniBorg # courtesy Yasir siddiqui """Self Destruct Plugin .sd <time in seconds> <text> """ import time from userbot import CMD_HELP from telethon.errors import rpcbaseerrors from userbot.utils import admin_cmd import importlib.util @borg.on(admin_cmd(pattern="sdm", outgoing=True)) async def selfdestruct(des...
[((1346, 1580), 'userbot.CMD_HELP.update', 'CMD_HELP.update', (['{\'selfdestruct\':\n """.sdm number | [text]\nUsage: self destruct this message in number seconds \n\n.self number | [text]\nUsage:self destruct this message in number seconds with showing that it will destruct. """\n }'], {}), '({\'selfdestruct\':\...
OSAMAMOHAMED1234/python_projects
snippets/basic_render_template_class.py
fb4bc7356847c3f46df690a9386cf970377a6f7c
import os class Template: template_name = '' context = None def __init__(self, template_name='', context=None, *args, **kwargs): self.template_name = template_name self.context = context def get_template(self): template_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), '...
[((364, 393), 'os.path.exists', 'os.path.exists', (['template_path'], {}), '(template_path)\n', (378, 393), False, 'import os\n'), ((291, 316), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (306, 316), False, 'import os\n')]
jameskzhao/python36
level_one/strings.py
855e8a6e164065702efa7773da1f089454fdcbcc
#Basics a = "hello" a += " I'm a dog" print(a) print(len(a)) print(a[1:]) #Output: ello I'm a dog print(a[:5]) #Output: hello(index 5 is not included) print(a[2:5])#Output: llo(index 2 is included) print(a[::2])#Step size #string is immutable so you can't assign a[1]= b x = a.upper() print(x) x = a.capitalize() prin...
[]
glushkovvv/test_2gis
tests/test_01_accept_time_get_headers.py
2affff49411a3c7ff77e9d399ec86eb314aa3757
# -*- coding: utf-8 -*- """ test_01_accept_time_get_headers ~~~~~~~~~~~~~~ The 2GIS API Test Check time get headers :author: Vadim Glushkov :copyright: Copyright 2019, The2GIS API Test" :license: MIT :version: 1.0.0 :maintainer: Vadim Glushkov :email: plussg@yandex.ru :status: Development """ import pytest import a...
[((374, 410), 'allure.epic', 'allure.epic', (['"""Поизитивные тесты API"""'], {}), "('Поизитивные тесты API')\n", (385, 410), False, 'import allure\n'), ((412, 465), 'allure.suite', 'allure.suite', (['"""Позитивное тестирование время ответов"""'], {}), "('Позитивное тестирование время ответов')\n", (424, 465), False, '...
ucds-sg/h2oai
transformers/string/strlen_transformer.py
7042860767dc25d1a7d7122103bbd5016d02df53
"""Returns the string length of categorical values""" from h2oaicore.transformer_utils import CustomTransformer import datatable as dt import numpy as np class MyStrLenEncoderTransformer(CustomTransformer): @staticmethod def get_default_properties(): return dict(col_type="any", min_cols=1, max_cols=1,...
[]
eerzin/eo-learn
geometry/eolearn/geometry/__init__.py
53c5cc229de13b98b5778aeb1d45950c25bf2f95
""" Subpackage containing EOTasks for geometrical transformations """ from .utilities import ErosionTask, VectorToRaster, RasterToVector from .sampling import PointSamplingTask, PointSampler, PointRasterSampler __version__ = '0.4.2'
[]
felipebarraza6/startup_comedy
api/models/users.py
42b4a4547bffc0d7cf34ace520355d80053bbd9e
"""User Model.""" # Django from django.db import models from django.contrib.auth.models import AbstractUser # Utilities from .utils import ApiModel class User(ApiModel, AbstractUser): email = models.EmailField( 'email', unique = True, ) USERNAME_FIELD = 'email' REQUIRED_FIELDS = [...
[((202, 241), 'django.db.models.EmailField', 'models.EmailField', (['"""email"""'], {'unique': '(True)'}), "('email', unique=True)\n", (219, 241), False, 'from django.db import models\n'), ((381, 415), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (400, 415),...
m-bo-one/ethereumd-proxy
tests/test_server.py
1d1eb3905dac4b28a8e23c283214859a13f6e020
from collections import namedtuple import json from asynctest.mock import patch import pytest from ethereumd.server import RPCServer from ethereumd.proxy import EthereumProxy from aioethereum.errors import BadResponseError from .base import BaseTestRunner Request = namedtuple('Request', ['json']) class TestServe...
[((271, 302), 'collections.namedtuple', 'namedtuple', (['"""Request"""', "['json']"], {}), "('Request', ['json'])\n", (281, 302), False, 'from collections import namedtuple\n'), ((422, 433), 'ethereumd.server.RPCServer', 'RPCServer', ([], {}), '()\n', (431, 433), False, 'from ethereumd.server import RPCServer\n'), ((97...
evdcush/neorl
neorl/rl/baselines/readme.py
a1af069072e752ab79e7279a88ad95d195a81821
# This file is part of NEORL. # Copyright (c) 2021 Exelon Corporation and MIT Nuclear Science and Engineering # NEORL is free software: you can redistribute it and/or modify # it under the terms of the MIT LICENSE # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # ...
[]
sushantPatrikar/WaveCompartor
Compare.py
112395287b41c1b5533924ebe293c5641647a5e3
from scipy.io import wavfile import numpy as np import pingouin as pg import pandas as pd _,data = wavfile.read('wav//ed//mp3baked.wav') _,data1 = wavfile.read('wav//ing//ingeating.wav') i= data.shape[0]-1 j = data1.shape[0]-1 index_1 = -1 index_2 = -1 try: data.shape[1] except IndexError: ...
[((106, 143), 'scipy.io.wavfile.read', 'wavfile.read', (['"""wav//ed//mp3baked.wav"""'], {}), "('wav//ed//mp3baked.wav')\n", (118, 143), False, 'from scipy.io import wavfile\n'), ((155, 194), 'scipy.io.wavfile.read', 'wavfile.read', (['"""wav//ing//ingeating.wav"""'], {}), "('wav//ing//ingeating.wav')\n", (167, 194), F...
sco1/pylox
tests/comments/test_only_block_comment.py
b4820828306c20cee3f8533c2547fafb92c6c1bd
from textwrap import dedent import pytest from pylox.lox import Lox TEST_SRC = dedent( """\ /* This is a multiline block comment */ """ ) EXPECTED_STDOUTS: list[str] = [] def test_block_comment_at_eof(capsys: pytest.CaptureFixture) -> None: interpreter = Lox() interpreter.run(TEST_SRC)...
[((82, 152), 'textwrap.dedent', 'dedent', (['""" /*\n This is a multiline block comment\n */\n """'], {}), '(""" /*\n This is a multiline block comment\n */\n """)\n', (88, 152), False, 'from textwrap import dedent\n'), ((285, 290), 'pylox.lox.Lox', 'Lox', ([], {}), '()\n', (288, 290), False, 'f...
n-kats/mlbase
mlbase/lazy.py
7d69f259dcaf9608a921523083458fa6d0d6914b
from mlbase.utils.misc import lazy tensorflow = lazy("tensorflow") numpy = lazy("numpy") gensim = lazy("gensim")
[((49, 67), 'mlbase.utils.misc.lazy', 'lazy', (['"""tensorflow"""'], {}), "('tensorflow')\n", (53, 67), False, 'from mlbase.utils.misc import lazy\n'), ((76, 89), 'mlbase.utils.misc.lazy', 'lazy', (['"""numpy"""'], {}), "('numpy')\n", (80, 89), False, 'from mlbase.utils.misc import lazy\n'), ((99, 113), 'mlbase.utils.m...
sturmianseq/observed
setup.py
d99fb99ff2a470a86efb2763685e8e2c021e799f
import re import setuptools README_FILENAME = "README.md" VERSION_FILENAME = "observed.py" VERSION_RE = r"^__version__ = ['\"]([^'\"]*)['\"]" # Get version information with open(VERSION_FILENAME, "r") as version_file: mo = re.search(VERSION_RE, version_file.read(), re.M) if mo: version = mo.group(1) else: ...
[((547, 1038), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""observed"""', 'version': 'version', 'author': '"""Daniel Sank"""', 'author_email': '"""sank.daniel@gmail.com"""', 'description': '"""Observer pattern for functions and bound methods"""', 'long_description': 'long_description', 'long_description_co...
catalyst-team/detector
src/coco.py
383c17ba7701d960ca92be0aafbff05207f2de3a
import os import json import numpy as np import pickle from typing import Any from pycocotools.coco import COCO from torch.utils.data import Dataset class DetectionMSCOCODataset(Dataset): def __init__(self, annotation_file: str, image_dir: str): self._annotation_file = annotation_file self._imag...
[((420, 447), 'pycocotools.coco.COCO', 'COCO', (['self._annotation_file'], {}), '(self._annotation_file)\n', (424, 447), False, 'from pycocotools.coco import COCO\n'), ((1061, 1093), 'os.path.exists', 'os.path.exists', (['self._cache_file'], {}), '(self._cache_file)\n', (1075, 1093), False, 'import os\n'), ((1572, 1584...
tadvi/uva
UVa 10105 polynomial coefficients/sample/main.py
0ac0cbdf593879b4fb02a3efc09adbb031cb47d5
import sys import operator sys.stdin = open('input.txt') fact = [1, 1] for i in range(2, 15): fact.append(fact[-1] * i) while True: try: n, k = map(int, raw_input().split()) coef = map(int, raw_input().split()) except: break print fact[n] / reduce(operator.mul, [fact[c] for c in...
[]
wallaceleonel/Flash-Cards
pynotes/note/models.py
fd563455d437f77e42ddf96133214cf752b62bb6
from django.contrib.auth.models import User from django.db import models from django.urls import reverse # Create your models here. class Post(models.Model): title = models.CharField(max_length=255) slug = models.SlugField(max_length=255,unique=True) #meusite.com/blog;introducao-ao-django author = mo...
[((173, 205), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (189, 205), False, 'from django.db import models\n'), ((217, 262), 'django.db.models.SlugField', 'models.SlugField', ([], {'max_length': '(255)', 'unique': '(True)'}), '(max_length=255, unique=True)\n', ...
DmytroLiaskovskyi/incubator-dlab
infrastructure-provisioning/src/general/scripts/azure/common_notebook_configure_dataengine.py
af995e98b3b3cf526fb9741a3e5117dd1e04f3aa
#!/usr/bin/python # ***************************************************************************** # # 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 A...
[((1413, 1539), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)-8s [%(asctime)s] %(message)s"""', 'level': 'logging.DEBUG', 'filename': 'local_log_filepath'}), "(format='%(levelname)-8s [%(asctime)s] %(message)s',\n level=logging.DEBUG, filename=local_log_filepath)\n", (1432, 1539), ...
ruohoruotsi/pyACA
pyACA/ToolFreq2Bark.py
339e9395b65a217aa5965638af941b32d5c95454
# -*- coding: utf-8 -*- """ helper function: convert Hz to Bark scale Args: fInHz: The frequency to be converted, can be scalar or vector cModel: The name of the model ('Schroeder' [default], 'Terhardt', 'Zwicker', 'Traunmuller') Returns: Bark values of the input dimension """ import numpy as np imp...
[((710, 727), 'numpy.asarray', 'np.asarray', (['fInHz'], {}), '(fInHz)\n', (720, 727), True, 'import numpy as np\n'), ((1047, 1064), 'numpy.zeros', 'np.zeros', (['f.shape'], {}), '(f.shape)\n', (1055, 1064), True, 'import numpy as np\n'), ((430, 449), 'math.asinh', 'math.asinh', (['(f / 650)'], {}), '(f / 650)\n', (440...
laurens-in/magenta
magenta/models/sketch_rnn/rnn.py
be6ed8d5b1eb2986ca277aa9c574a7912dd5ed0f
# Copyright 2019 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[((940, 978), 'numpy.random.normal', 'np.random.normal', (['(0.0)', '(1.0)', 'flat_shape'], {}), '(0.0, 1.0, flat_shape)\n', (956, 978), True, 'import numpy as np\n'), ((991, 1028), 'numpy.linalg.svd', 'np.linalg.svd', (['a'], {'full_matrices': '(False)'}), '(a, full_matrices=False)\n', (1004, 1028), True, 'import nump...
u6052029/cogent3
src/cogent3/cluster/UPGMA.py
ca0efcb7f60b715bcbfbecd924cdb98a53cefe20
# usr/bin/env python """Functions to cluster using UPGMA upgma takes an dictionary of pair tuples mapped to distances as input. UPGMA_cluster takes an array and a list of PhyloNode objects corresponding to the array as input. Can also generate this type of input from a DictArray using inputs_from_dict_array function....
[((1190, 1219), 'cogent3.util.dict_array.DictArray', 'DictArray', (['pairwise_distances'], {}), '(pairwise_distances)\n', (1199, 1219), False, 'from cogent3.util.dict_array import DictArray\n'), ((2006, 2019), 'numpy.ravel', 'ravel', (['matrix'], {}), '(matrix)\n', (2011, 2019), False, 'from numpy import argmin, array,...
kf7lsu/RegfileCompiler-public
src/python/make_store_entry.py
0845f1458137cef06d584047bb4287a72c6afbab
#this code will generate the structural verilog for a single entry in the register file #takes in the output file manager, the entry number, the number of bits, the number of reads, and the width of the #tristate buffers on the read outputs #expects the same things as make_store_cell, ensure code is valid there #Matt...
[((616, 692), 'make_store_cell.make_store_cell', 'make_store_cell', (['out_file', 'entry_number', 'bit', 'reads', 'buff_width', 'regfile_num'], {}), '(out_file, entry_number, bit, reads, buff_width, regfile_num)\n', (631, 692), False, 'from make_store_cell import make_store_cell\n')]
oceandelee/tac
module1/api.py
62ffbcb31b374a9fa83a1ee6010b2e00f2de8a7c
"""API for AVB""" import json import sys import requests def actualite_found (): osm = "https://opendata.bruxelles.be/api/datasets/1.0/search/?q=" data = { "nhits":0, "parameters":{ "dataset":"actualites-ville-de-bruxelles", "timezone":"UTC", "q":"actualite", "langu...
[((501, 524), 'requests.get', 'requests.get', (['osm', 'data'], {}), '(osm, data)\n', (513, 524), False, 'import requests\n')]
cpelley/improver
improver/cli/nbhood.py
ebf77fe2adc85ed7aec74c26671872a2e4388ded
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the ...
[((6903, 6941), 'improver.nbhood.radius_by_lead_time', 'radius_by_lead_time', (['radii', 'lead_times'], {}), '(radii, lead_times)\n', (6922, 6941), False, 'from improver.nbhood import radius_by_lead_time\n'), ((6828, 6867), 'improver.wind_calculations.wind_direction.WindDirection.deg_to_complex', 'WindDirection.deg_to_...
ipa-mirb/bonsai
bonsai/model.py
cb73317cdf779566f7c496fc39546c9c689aa09c
#Copyright (c) 2017 Andre Santos # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, distribute...
[]
felipe-menelau/todo-list-web
api/views/todo_views.py
9b60a549dc6d5bdd88e1a584b8bb2c4f56131cb5
from django.contrib.auth.models import User from rest_framework import viewsets, status from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated, IsAdminUser from api.serializers import TODOListSerializer from api.models import TODOList class TODOListViewSet(viewsets.ModelVi...
[((491, 539), 'api.models.TODOList.objects.filter', 'TODOList.objects.filter', ([], {'owner': 'self.request.user'}), '(owner=self.request.user)\n', (514, 539), False, 'from api.models import TODOList\n')]
techkey/PTVS
Python/Tests/TestData/ProjectHomeProjects/Subfolder/ProgramB.py
8355e67eedd8e915ca49bd38a2f36172696fd903
# ProgramB.py print('Hello World')
[]
effective-altruism-australia/donation-portal
donation/migrations/0043_auto_20180109_0012.py
45fe58edc44d0c4444b493e4ac025fc53897c799
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion def copy_existing_referrals_into_new_field(apps, schema_editor): Pledge = apps.get_model('donation', 'Pledge') Referral = apps.get_model('donation', 'Referral') reason...
[((1474, 1534), 'django.db.migrations.RunPython', 'migrations.RunPython', (['copy_existing_referrals_into_new_field'], {}), '(copy_existing_referrals_into_new_field)\n', (1494, 1534), False, 'from django.db import migrations, models\n'), ((1301, 1463), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delet...
c1m50c/twitter-examples
python/is_even.py
c3ed7cf88dacbb761fed1b0b0dc593d7d3648378
def is_even(i: int) -> bool: if i == 1: return False elif i == 2: return True elif i == 3: return False elif i == 4: return True elif i == 5: ... # Never do that! Use one of these instead... is_even = lambda i : i % 2 == 0 is_even = lambda i : not i & 1 is_o...
[]
RandomRobbieBF/wordpress-bf
wordpress-brute.py
fe78d4367b7baaf18a4200c5c040595d37b4100f
#!/usr/bin/env python # # Wordpress Bruteforce Tool # # By @random_robbie # # import requests import json import sys import argparse import re import os.path from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) session = requests.Se...
[((232, 298), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', (['InsecureRequestWarning'], {}), '(InsecureRequestWarning)\n', (274, 298), False, 'import requests\n'), ((309, 327), 'requests.Session', 'requests.Session', ([], {}), '()\n', (325, 327), False, 'import requests\n'...
liaoaoyuan97/standford_algorithms_specialization
graph_search/week2/assignment_dijkstra_shortest_paths.py
2914fdd397ce895d986ac855e78afd7a51ceff68
import heapq import time from os import path from math import floor class Heap: def __init__(self): self.size = 0 self.array = [] self.v2index_map = {} def __get_parent_index(self, idx): return int(floor((idx - 1) / 2)) def __get_left_child_index(self, idx): retur...
[((3047, 3075), 'heapq.heappush', 'heapq.heappush', (['heap', '(0, 1)'], {}), '(heap, (0, 1))\n', (3061, 3075), False, 'import heapq\n'), ((5116, 5127), 'time.time', 'time.time', ([], {}), '()\n', (5125, 5127), False, 'import time\n'), ((5372, 5383), 'time.time', 'time.time', ([], {}), '()\n', (5381, 5383), False, 'imp...
huimlight/SoftTeacher
ssod/utils/structure_utils.py
97064fbcce1ab87b40977544ba7a9c488274d66f
import warnings from collections import Counter, Mapping, Sequence from numbers import Number from typing import Dict, List import numpy as np import torch from mmdet.core.mask.structures import BitmapMasks from torch.nn import functional as F _step_counter = Counter() def list_concat(data_list: List[list]): if...
[((262, 271), 'collections.Counter', 'Counter', ([], {}), '()\n', (269, 271), False, 'from collections import Counter, Mapping, Sequence\n'), ((2592, 2614), 'numpy.concatenate', 'np.concatenate', (['result'], {}), '(result)\n', (2606, 2614), True, 'import numpy as np\n'), ((376, 396), 'torch.cat', 'torch.cat', (['data_...
zzl0/cli_helpers
tests/tabular_output/test_terminaltables_adapter.py
266645937423225bdb636ef6aa659f1a40ceec5f
# -*- coding: utf-8 -*- """Test the terminaltables output adapter.""" from __future__ import unicode_literals from textwrap import dedent import pytest from cli_helpers.compat import HAS_PYGMENTS from cli_helpers.tabular_output import terminaltables_adapter if HAS_PYGMENTS: from pygments.style import Style ...
[((834, 910), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not HAS_PYGMENTS)'], {'reason': '"""requires the Pygments library"""'}), "(not HAS_PYGMENTS, reason='requires the Pygments library')\n", (852, 910), False, 'import pytest\n'), ((1243, 1293), 'cli_helpers.tabular_output.terminaltables_adapter.style_output_tab...
jeikabu/lumberyard
dev/Tools/build/waf-1.7.13/waflib/extras/fc_xlf.py
07228c605ce16cbf5aaa209a94a3cb9d6c1a4115
#! /usr/bin/env python # encoding: utf-8 # harald at klimachs.de import re from waflib import Utils,Errors from waflib.Tools import fc,fc_config,fc_scan from waflib.Configure import conf from waflib.Tools.compiler_fc import fc_compiler fc_compiler['aix'].insert(0, 'fc_xlf') @conf def find_xlf(conf): """Find the xlf...
[((384, 497), 'waflib.Configure.conf.find_program', 'conf.find_program', (["['xlf2003_r', 'xlf2003', 'xlf95_r', 'xlf95', 'xlf90_r', 'xlf90', 'xlf_r', 'xlf'\n ]"], {'var': '"""FC"""'}), "(['xlf2003_r', 'xlf2003', 'xlf95_r', 'xlf95', 'xlf90_r',\n 'xlf90', 'xlf_r', 'xlf'], var='FC')\n", (401, 497), False, 'from wafl...
MeGustas-5427/SQL_Tutorials
tutorials/create_table/tests.py
627372c2d5d8656d72645830c9a1fae1df278fc7
#!/usr/bin/python3 # -*- coding:utf-8 -*- # __author__ = '__MeGustas__' from django.test import TestCase from django.db import connection from tutorials.create_table.models import * # Create your tests here. class TestHealthFile(TestCase): def setUp(self): cursor = connection.cursor() # Popul...
[((284, 303), 'django.db.connection.cursor', 'connection.cursor', ([], {}), '()\n', (301, 303), False, 'from django.db import connection\n')]
tmfds/dfk
hero/hero.py
91b6f95a4630b57deecf87cf4850b6576646c7d1
import copy from web3 import Web3 from .utils import utils as hero_utils CONTRACT_ADDRESS = '0x5f753dcdf9b1ad9aabc1346614d1f4746fd6ce5c' ABI = """ [ {"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"addres...
[((22878, 22918), 'web3.Web3.toChecksumAddress', 'Web3.toChecksumAddress', (['CONTRACT_ADDRESS'], {}), '(CONTRACT_ADDRESS)\n', (22900, 22918), False, 'from web3 import Web3\n'), ((24077, 24117), 'web3.Web3.toChecksumAddress', 'Web3.toChecksumAddress', (['CONTRACT_ADDRESS'], {}), '(CONTRACT_ADDRESS)\n', (24099, 24117), ...
honzajavorek/tipi
tests/test_langs_fr.py
cbe51192725608b6fba1244a48610ae231b13e08
# -*- coding: utf-8 -*- from __future__ import unicode_literals from tipi import tipi as _tipi tipi = lambda s: _tipi(s, lang='fr') def test_double_quotes(): assert tipi('''"brutal" "quote's"''') == ( '''«brutal» «quote's»''' ) def test_single_quotes(): assert tipi("""'brutal' 'quote's'""") ...
[((116, 135), 'tipi.tipi', '_tipi', (['s'], {'lang': '"""fr"""'}), "(s, lang='fr')\n", (121, 135), True, 'from tipi import tipi as _tipi\n')]
brethauer/mirage
vendor/models.py
396f61206bf76f997c0535277af918058aa1b827
from django.db import models VEHICLE_CHOICES = ( ('OASISSB', 'OASIS Small Business'), ('OASIS', 'OASIS Unrestricted') ) STATUS_CHOICES = ( ('P', 'In Progress'), ('C', 'Completed'), ('F', 'Cancelled') ) class Vendor(models.Model): name = models.CharField(max_length=128) duns = models.C...
[((268, 300), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(128)'}), '(max_length=128)\n', (284, 300), False, 'from django.db import models\n'), ((312, 355), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(9)', 'unique': '(True)'}), '(max_length=9, unique=True)\n', (328...
L-McCormack/two-qubit-simulator
two_qubit_simulator/circuits.py
d7115f0630c9931724aa660dba4b89a50db4e2e0
""" Contains the QuantumCircuit class boom. """ class QuantumCircuit(object): # pylint: disable=useless-object-inheritance """ Implements a quantum circuit. - - - WRITE DOCUMENTATION HERE - - - """ def __init__(self): """ Initialise a QuantumCircuit object """ pass def add_ga...
[]
usgs/water-datapreptools
examples/bathymetricGradient.py
49c852a0c189e142a351331ba6e0d1ef9e7a408b
import sys sys.path.append("..") # change environment to see tools from make_hydrodem import bathymetricGradient workspace = r"" # path to geodatabase to use as a workspace snapGrid = r"" # path to snapping grid hucPoly = r"" # path to local folder polygon hydrographyArea = r"" # path to NHD area feature class...
[((12, 33), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (27, 33), False, 'import sys\n'), ((482, 605), 'make_hydrodem.bathymetricGradient', 'bathymetricGradient', (['workspace', 'snapGrid', 'hucPoly', 'hydrographyArea', 'hydrographyFlowline', 'hydrographyWaterbody', 'cellsize'], {}), '(workspa...
hxb1997/Menge
out/flowContext.py
7a09a6236d8eef23e3d15d08873d5918d064761b
# This is the OpenGL context for drawing flow calculation lines from Context import * from primitives import Vector2, Segment from OpenGL.GL import * from copy import deepcopy class GLFlowSegment( Segment ): '''The OpenGL representation of a flow line. Basically a segment with a direciton indicator. The dire...
[((761, 791), 'primitives.Segment.__init__', 'Segment.__init__', (['self', 'p1', 'p2'], {}), '(self, p1, p2)\n', (777, 791), False, 'from primitives import Vector2, Segment\n'), ((2985, 3008), 'copy.deepcopy', 'deepcopy', (['context.lines'], {}), '(context.lines)\n', (2993, 3008), False, 'from copy import deepcopy\n'),...
Paola351/instascrape
instascrape/collectors/__init__.py
b4a50c9140fa9054187738f6d1564cecc32cbaab
from .interval_collectors import *
[]
ghoslation/algorithm
Codes/gracekoo/test.py
5708bf89e59a80cd0f50f2e6138f069b4f9bc96e
# -*- coding: utf-8 -*- # @Time: 2020/11/8 23:47 # @Author: GraceKoo # @File: test.py # @Desc: from threading import Thread import time def print_numbers(): time.sleep(0.2) print("子线程结束") if __name__ == "__main__": t1 = Thread(target=print_numbers) t1.setDaemon(True) t1.start() # print("主线程结...
[((163, 178), 'time.sleep', 'time.sleep', (['(0.2)'], {}), '(0.2)\n', (173, 178), False, 'import time\n'), ((236, 264), 'threading.Thread', 'Thread', ([], {'target': 'print_numbers'}), '(target=print_numbers)\n', (242, 264), False, 'from threading import Thread\n')]
gregory-chekler/api
src/_main_/settings.py
11ecbea945e7eb6fa677a0c0bb32bda51ba15f28
""" Django settings for massenergize_portal_backend project. Generated by 'django-admin startproject' using Django 2.1.4. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/setting...
[((814, 844), 'os.environ.update', 'os.environ.update', (['CONFIG_DATA'], {}), '(CONFIG_DATA)\n', (831, 844), False, 'import os\n'), ((2574, 2609), 'os.environ.get', 'os.environ.get', (['"""AWS_ACCESS_KEY_ID"""'], {}), "('AWS_ACCESS_KEY_ID')\n", (2588, 2609), False, 'import os\n'), ((2637, 2676), 'os.environ.get', 'os....
urands/aiorpcgrid
aiorpcgrid/client.py
7bc9ee9a80fa843998b2604d7c0803b323628480
import asyncio # from aiorpcgrid.client import Client from aiorpcgrid.task import AsyncTask, State class AsyncClient: _provider = None _method = None _requests: dict = {} _running = True _request_queue: asyncio.Queue = asyncio.Queue() _loop = None def __init__(self, provider, loop=None):...
[((242, 257), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (255, 257), False, 'import asyncio\n'), ((399, 423), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (421, 423), False, 'import asyncio\n'), ((2319, 2330), 'aiorpcgrid.task.AsyncTask', 'AsyncTask', ([], {}), '()\n', (2328, 2330), Fa...
matt-tyler/opentelemetry-lambda
python/src/otel/otel_sdk/opentelemetry/instrumentation/aws_lambda/__init__.py
6b427d351fa721620fcd387e836e9f2f9f20cb60
# Copyright 2020, OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
[((1755, 1782), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1772, 1782), False, 'import logging\n'), ((1990, 2011), 'opentelemetry.trace.get_tracer_provider', 'get_tracer_provider', ([], {}), '()\n', (2009, 2011), False, 'from opentelemetry.trace import SpanKind, get_tracer, get_trace...
bastoune57/gokiting_back_end
instructors/migrations/0021_alter_user_avatar_url.py
f3edcbeede292713349b28f2390b5d57e1420f8e
# Generated by Django 4.0.2 on 2022-04-01 16:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('instructors', '0020_alter_user_description_alter_user_title'), ] operations = [ migrations.AlterField( model_name='user', ...
[((363, 457), 'django.db.models.ImageField', 'models.ImageField', ([], {'default': '"""profile_pics/einstein_EqBibwO.jpeg"""', 'upload_to': '"""profile_pics"""'}), "(default='profile_pics/einstein_EqBibwO.jpeg', upload_to=\n 'profile_pics')\n", (380, 457), False, 'from django.db import migrations, models\n')]
SamplingAndEnsemblingSolvers/SamplingAndEnsemblingSolvers
sopa/src/models/utils.py
5ad3cae76c3cc9cec4d347807012e61121ea61b9
import numpy as np import torch import random from .odenet_mnist.layers import MetaNODE def fix_seeds(seed=502): np.random.seed(seed) random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed_all(seed) torch.set_printoptions(precision=10) torch.backends.cudnn.deterministic = Tr...
[((123, 143), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (137, 143), True, 'import numpy as np\n'), ((148, 165), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (159, 165), False, 'import random\n'), ((170, 193), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (18...
TheVinhLuong102/micropy-stubs
packages/micropython-official/v1.10/esp32/stubs/ubinascii.py
55ff1773008f7c4dfc3d70a403986486226eb6b3
""" Module: 'ubinascii' on esp32 1.10.0 """ # MCU: (sysname='esp32', nodename='esp32', release='1.10.0', version='v1.10 on 2019-01-25', machine='ESP32 module with ESP32') # Stubber: 1.2.0 def a2b_base64(): pass def b2a_base64(): pass def crc32(): pass def hexlify(): pass def unhexlify(): pass
[]
chenwang/QuantEcon.lectures.code
jv/test_jv.py
8832a74acd219a71cb0a99dc63c5e976598ac999
""" @author : Spencer Lyon """ from __future__ import division import sys import unittest from nose.plugins.skip import SkipTest from jv import JvWorker from quantecon import compute_fixed_point from quantecon.tests import get_h5_data_file, write_array, max_abs_diff # specify params -- use defaults A = 1.4 alpha = 0...
[((423, 463), 'nose.plugins.skip.SkipTest', 'SkipTest', (['"""Python 3 tests aren\'t ready."""'], {}), '("Python 3 tests aren\'t ready.")\n', (431, 463), False, 'from nose.plugins.skip import SkipTest\n'), ((593, 621), 'quantecon.tests.write_array', 'write_array', (['f', 'grp', 'V', 'v_nm'], {}), '(f, grp, V, v_nm)\n',...
LaudateCorpus1/excentury
excentury/command/config.py
8d0f20bb3e543382170e042fac51a56377c4024b
"""Config This module is in charge of providing all the necessary settings to the rest of the modules in excentury. """ import os import re import sys import textwrap import argparse from collections import OrderedDict from excentury.command import error, trace, import_mod DESC = """Edit a configuration file for ex...
[((599, 630), 're.compile', 're.compile', (['"""\\\\${(?P<key>.*?)}"""'], {}), "('\\\\${(?P<key>.*?)}')\n", (609, 630), False, 'import re\n'), ((639, 696), 're.compile', 're.compile', (['"""(?P<iftrue>.*?) IF\\\\[\\\\[(?P<cond>.*?)\\\\]\\\\]"""'], {}), "('(?P<iftrue>.*?) IF\\\\[\\\\[(?P<cond>.*?)\\\\]\\\\]')\n", (649, ...
pkjmesra/nseta
tests/test_urls.py
28cd8cede465efe9f506a38c5933602c463e5185
# -*- coding: utf-8 -*- ''' Created on Thu Nov 19 20:52:33 2015 @author: SW274998 ''' from nseta.common.commons import * import datetime import unittest import time from bs4 import BeautifulSoup from tests import htmls import json import requests import six from nseta.common.urls import * import nseta.common.urls as ...
[((541, 603), 'nseta.common.urls.session.proxies.update', 'urls.session.proxies.update', (["{'http': 'proxy1.wipro.com:8080'}"], {}), "({'http': 'proxy1.wipro.com:8080'})\n", (568, 603), True, 'import nseta.common.urls as urls\n'), ((4169, 4190), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (4188, 41...
cheradenine/Django-CRM
accounts/forms.py
692572ced050d314c1f880af8b4000c97cbf7440
from django import forms from .models import Account from common.models import Comment, Attachments from leads.models import Lead from contacts.models import Contact from django.db.models import Q class AccountForm(forms.ModelForm): def __init__(self, *args, **kwargs): account_view = kwargs.pop('account'...
[((2863, 2908), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(64)', 'required': '(True)'}), '(max_length=64, required=True)\n', (2878, 2908), False, 'from django import forms\n'), ((3071, 3118), 'django.forms.FileField', 'forms.FileField', ([], {'max_length': '(1001)', 'required': '(True)'}), '(max...
thetolga/pywren-ibm-cloud
pywren/pywren_ibm_cloud/invokers.py
ce48c158cf469b55100ab68a75d3dcd6ae9a3ffe
# # Copyright 2018 PyWren 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 in writing...
[((688, 715), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (705, 715), False, 'import logging\n'), ((1151, 1176), 'pywren_ibm_cloud.cf_connector.CloudFunctions', 'CloudFunctions', (['cf_config'], {}), '(cf_config)\n', (1165, 1176), False, 'from pywren_ibm_cloud.cf_connector import Cloud...
Arugakente/DataScienceP1
Projet1/Dataset/addlinkRealExample.py
94ca874ed8a76a89a3da9ecf2fe6e554700f0507
import os import random inputDirectory = "./original" outputDirectory = "./processed" #probability parameters TopLevel = 0.6 SecondLevel = 0.5 ThirdLevel = 0.4 FourAndAbove = 0.2 pickInside = 0.5 pickOutside = 0.25 topics = [] siteLevel = [] fileStructure = [] count = 0 def findPossibleIndex(toParse): toRetu...
[((3145, 3171), 'os.listdir', 'os.listdir', (['inputDirectory'], {}), '(inputDirectory)\n', (3155, 3171), False, 'import os\n'), ((798, 822), 'random.uniform', 'random.uniform', (['(0.0)', '(2.0)'], {}), '(0.0, 2.0)\n', (812, 822), False, 'import random\n'), ((3353, 3398), 'os.listdir', 'os.listdir', (["(inputDirectory...
benajamin/kkcalc
kkcalc/kk.py
fcabfba288442dd297e3bd9910062c5db2231a91
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of the Kramers-Kronig Calculator software package. # # Copyright (c) 2013 Benjamin Watts, Daniel J. Lauk # # The software is licensed under the terms of the zlib/libpng license. # For details see LICENSE.txt """This module implements the Kramers-Kronig...
[((370, 397), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (387, 397), False, 'import logging, sys\n'), ((426, 466), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (445, 466), False, 'import logging, sys\n'), ((468, 508), 'logg...
dominicschaff/random
random-images/hexxy.py
14a19b976a09c768ab8844b7cda237c17a92c9ae
from PIL import ImageDraw, Image from math import cos,sin,radians from random import randint import sys a = "a0A1b2B3c4C5d6D7e8E9f!F,g.G/h?H<i>I:j;J'k\"K\\l|L/m M\nn\tN@o#O$p%P^q&Q*r(R)s_S-t+T=u{U}v[V]w W x X y Y z Z" if len(a) > 128: print("TOO MANY CHARACTERS") sys.exit(1) # for i in a: # print("%s -> %...
[((760, 797), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(2560, 1600)', 'BLACK'], {}), "('RGB', (2560, 1600), BLACK)\n", (769, 797), False, 'from PIL import ImageDraw, Image\n'), ((802, 821), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', (['img'], {}), '(img)\n', (816, 821), False, 'from PIL import ImageDraw, Image\n'), (...
LonelyFantasy/Chiyuki-Bot
src/plugins/maimaidx.py
16a91b96661825c2a367a12c30d6a28ad13b95a9
import math from collections import defaultdict from typing import List, Dict, Any from nonebot import on_command, on_message, on_notice, on_regex, get_driver from nonebot.log import logger from nonebot.permission import Permission from nonebot.typing import T_State from nonebot.adapters import Event, Bot from nonebot...
[((725, 737), 'nonebot.get_driver', 'get_driver', ([], {}), '()\n', (735, 737), False, 'from nonebot import on_command, on_message, on_notice, on_regex, get_driver\n'), ((2098, 2143), 'nonebot.on_command', 'on_command', (['"""inner_level """'], {'aliases': "{'定数查歌 '}"}), "('inner_level ', aliases={'定数查歌 '})\n", (2108, ...
hsgwa/trace_analysis
trace_analysis/trace_analysis/architecture/interface.py
16169f84e838af5202e2be8f4883dfca5bc7f592
# Copyright 2021 Research Institute of Systems Planning, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[]
treehousekingcomic/disrank
disrank/__init__.py
6a6ef3a2f2d4dc81bc3da8064b897dac4c773ef7
from thkc_disrank import *
[]
JakeStevens/benchmarking-gnns
layers/gin_layer.py
a17fdf1b1d758fc65d5eeaf3726f5efa747a4081
import torch import torch.nn as nn import torch.nn.functional as F import dgl.function as fn """ GIN: Graph Isomorphism Networks HOW POWERFUL ARE GRAPH NEURAL NETWORKS? (Keyulu Xu, Weihua Hu, Jure Leskovec and Stefanie Jegelka, ICLR 2019) https://arxiv.org/pdf/1810.00826.pdf """ class GINLayer(nn.Module):...
[((2345, 2368), 'torch.nn.BatchNorm1d', 'nn.BatchNorm1d', (['out_dim'], {}), '(out_dim)\n', (2359, 2368), True, 'import torch.nn as nn\n'), ((2920, 2929), 'torch.nn.functional.relu', 'F.relu', (['h'], {}), '(h)\n', (2926, 2929), True, 'import torch.nn.functional as F\n'), ((3057, 3107), 'torch.nn.functional.dropout', '...
jedhsu/music
music/distance/aural/diatonic/__init__.py
dea68c4a82296cd4910e786f533b2cbf861377c3
""" *mus . it . dia* The simple diatonic intervals. """ from .second import MinorSecond from .second import MajorSecond from .third import MinorThird from .third import MajorThird from .fourth import PerfectFourth from .fifth import Tritone from .fifth import PerfectFifth from .sixth import MinorSixth from .s...
[]
AriTheGuitarMan/AriTheGuitarMan.github.io
selenium_tests/test_functions.py
8348ad0c47e48477560e7e40ec7eac8bca6fcdfa
# this file holds some common testing functions from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By depurl = "localhost:3000" def getElement(driver, xpath): return WebDriverWait(driver, 10).until(EC....
[((317, 366), 'selenium.webdriver.support.expected_conditions.presence_of_element_located', 'EC.presence_of_element_located', (['(By.XPATH, xpath)'], {}), '((By.XPATH, xpath))\n', (347, 366), True, 'from selenium.webdriver.support import expected_conditions as EC\n'), ((285, 310), 'selenium.webdriver.support.wait.WebDr...
ryuchihoon/WeatherStation
papirus_renderer.py
e3fd210939a961bc1724197f3885964cb4ae5a28
#-- coding: utf-8 -- import sys reload(sys) sys.setdefaultencoding('utf-8') import os import time import collections from PIL import Image, ImageOps, ImageDraw, ImageFont code_2_icono = collections.defaultdict(lambda : '38') kor_2_eng = collections.defaultdict(lambda : 'UNKNOWN') code_2_icono['SKY_O00'] = ['38'] ...
[((45, 76), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (67, 76), False, 'import sys\n'), ((191, 229), 'collections.defaultdict', 'collections.defaultdict', (["(lambda : '38')"], {}), "(lambda : '38')\n", (214, 229), False, 'import collections\n'), ((242, 285), 'collections...
VForWaTer/hydrobox
hydrobox/discharge/__init__.py
ae7d10bf5aa48bf7daf3d1094e6bb66f0a7ce96b
from .catchment import regime, flow_duration_curve from . import indices
[]
ecmwf-lab/infero
scripts/convert_keras2onnx.py
4fec006175af48cd0313b2f89722c01636e961db
# # (C) Copyright 1996- ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernme...
[((590, 634), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Data Augmentation"""'], {}), "('Data Augmentation')\n", (613, 634), False, 'import argparse\n'), ((970, 1016), 'keras.models.load_model', 'keras.models.load_model', (['args.keras_model_path'], {}), '(args.keras_model_path)\n', (993, 1016), False,...
timcheck/lava-dl
src/lava/lib/dl/slayer/utils/assistant.py
e680722071129fde952ea0d744984aa2a038797a
# Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause """Assistant utility for automatically load network from network description.""" import torch class Assistant: """Assistant that bundles training, validation and testing workflow. Parameters ---------- net : torch.nn.Mo...
[((4844, 4859), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4857, 4859), False, 'import torch\n'), ((6364, 6379), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (6377, 6379), False, 'import torch\n')]
cse-icon-dataAnalytics/lstm-anomaly-detect
lstm-synthetic-wave-anomaly-detect.py
bcfb01db383698acbd5692f1a76a5f20ec3629a8
""" Inspired by example from https://github.com/Vict0rSch/deep_learning/tree/master/keras/recurrent Uses the TensorFlow backend The basic idea is to detect anomalies in a time-series. """ import matplotlib.pyplot as plt import numpy as np import time from keras.layers.core import Dense, Activation, Dropout from keras.l...
[]
btenaglia/hpc-historias-clinicas
hpc-historias-clinicas/historias/migrations/0007_auto_20150425_1459.py
649d8660381381b1c591667760c122d73071d5ec
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('historias', '0006_auto_20150413_0001'), ] operations = [ migrations.AlterField( model_name='hist...
[((984, 1268), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)', 'choices': "[(b'SALA 1', b'SALA 1'), (b'SALA 2', b'SALA 2'), (b'SALA 3', b'SALA 3'), (\n b'SALA 4', b'SALA 4'), (b'SALA 5', b'SALA 5'), (b'GAURDIA', b'GAURDIA'),\n (b'NEO', b'NEO'), (b'UTI', b'UTI'), (b'UCO', b'UCO'), (b'...
Verckolf/MyInterfaceTest
venv/Lib/site-packages/har2case/__about__.py
e05674bd673a6a43cfb33f7cb4318886ba92a05c
__title__ = 'har2case' __description__ = 'Convert HAR(HTTP Archive) to YAML/JSON testcases for HttpRunner.' __url__ = 'https://github.com/HttpRunner/har2case' __version__ = '0.2.0' __author__ = 'debugtalk' __author_email__ = 'mail@debugtalk.com' __license__ = 'Apache-2.0' __copyright__ = 'Copyright 2017 debugtalk'
[]
woctezuma/match-steam-banners
app_id_utils.py
dff1bc2ddf35a37bcdea46a220f5d0257d47e017
import os from pathlib import Path from data_utils import get_data_path, get_image_data_path, get_image_extension def app_id_to_image_filename(app_id, is_horizontal_banner=False): image_data_path = get_image_data_path(is_horizontal_banner) image_filename = image_data_path + str(app_id) + get_image_extension...
[((205, 246), 'data_utils.get_image_data_path', 'get_image_data_path', (['is_horizontal_banner'], {}), '(is_horizontal_banner)\n', (224, 246), False, 'from data_utils import get_data_path, get_image_data_path, get_image_extension\n'), ((414, 446), 'os.path.basename', 'os.path.basename', (['image_filename'], {}), '(imag...
sjm446/aMAZEd
upload.py
38789f9898097991b19e686fd76ef4abd5bfe94c
#!/usr/bin/env python import boto3 import random import os BUCKET=os.environ.get('EXPORT_S3_BUCKET_URL') if (BUCKET != None): s3 = boto3.client('s3') with open("maze.txt", "rb") as f: s3.upload_fileobj(f, BUCKET, "maze"+str(random.randrange(100000))+".txt") else: print("EXPORT_S3_BUCKET_URL was not ...
[((66, 104), 'os.environ.get', 'os.environ.get', (['"""EXPORT_S3_BUCKET_URL"""'], {}), "('EXPORT_S3_BUCKET_URL')\n", (80, 104), False, 'import os\n'), ((135, 153), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (147, 153), False, 'import boto3\n'), ((240, 264), 'random.randrange', 'random.randrange', (...
rtzll/zulip
zerver/management/commands/list_realms.py
b831df8f7fc2f5b89ec998266901ac491d52a7fc
import sys from typing import Any from argparse import ArgumentParser from zerver.models import Realm from zerver.lib.management import ZulipBaseCommand class Command(ZulipBaseCommand): help = """List realms in the server and it's configuration settings(optional). Usage examples: ./manage.py list_realms ./man...
[((743, 762), 'zerver.models.Realm.objects.all', 'Realm.objects.all', ([], {}), '()\n', (760, 762), False, 'from zerver.models import Realm\n'), ((1465, 1476), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1473, 1476), False, 'import sys\n')]
bopopescu/debpkg_python-boto
tests/integration/ec2/test_connection.py
06f9b6f3693ba1933be8214da69cebcd5212cd97
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2009, Eucalyptus Systems, Inc. # All rights reserved. # # 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 res...
[]
joekohlsdorf/docusign-esign-python-client
docusign_esign/models/conditional_recipient_rule_filter.py
40407544f79c88716d36fabf36f65c3ef1a5c3ba
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
[((7241, 7274), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (7254, 7274), False, 'import six\n'), ((1563, 1578), 'docusign_esign.client.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1576, 1578), False, 'from docusign_esign.client.configuration import Con...
meshy/django-conman
conman/routes/apps.py
c739d09250d02d99068358e925ed8298a2a37a75
from django.apps import AppConfig from django.core.checks import register from . import checks class RouteConfig(AppConfig): """The AppConfig for conman routes.""" name = 'conman.routes' def ready(self): """Register checks for conman routes.""" register(checks.polymorphic_installed) ...
[((277, 315), 'django.core.checks.register', 'register', (['checks.polymorphic_installed'], {}), '(checks.polymorphic_installed)\n', (285, 315), False, 'from django.core.checks import register\n'), ((324, 361), 'django.core.checks.register', 'register', (['checks.subclasses_available'], {}), '(checks.subclasses_availab...
DJHig/TM1py-samples
Other/transactionlog entries since timestamp.py
da4050380447472a02e2a107a2c5be79ac284d0a
""" Get all TM1 transactions for all cubes starting to a specific date. """ import configparser config = configparser.ConfigParser() config.read('..\config.ini') from datetime import datetime from TM1py.Services import TM1Service with TM1Service(**config['tm1srv01']) as tm1: # Timestamp for Message-Log parsin...
[((106, 133), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (131, 133), False, 'import configparser\n'), ((240, 272), 'TM1py.Services.TM1Service', 'TM1Service', ([], {}), "(**config['tm1srv01'])\n", (250, 272), False, 'from TM1py.Services import TM1Service\n'), ((338, 403), 'datetime.datet...
AviranLab/patteRNA
src/patteRNA/Dataset.py
88b900844016717a71b6ec8e4f2d10d8888600ce
import logging import numpy as np from scipy.stats import entropy from patteRNA.Transcript import Transcript from patteRNA import filelib logger = logging.getLogger(__name__) class Dataset: def __init__(self, fp_observations, fp_sequences=None, fp_references=None): self.fp_obs = fp_observations s...
[((148, 175), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (165, 175), False, 'import logging\n'), ((511, 550), 'patteRNA.filelib.parse_observations', 'filelib.parse_observations', (['self.fp_obs'], {}), '(self.fp_obs)\n', (537, 550), False, 'from patteRNA import filelib\n'), ((2582, 26...
GYRY-NEU/CS7610-Experiments
src/Simulation/developer_0/main.py
3731b45c4a9cba2a1d7e44d37f28d1046a38de47
import library import json @library.export def init(args): model = [[9.2, 0.21, 0.21], [8.2, 0.22, 0.21], [7.2, 1.21, 2.41], [1.2, 2.21, 0.29]] library.put("model", model) ROUND = 0 library.put("ROUND", ROUND) alpha = 0.2 library.put("alpha", alpha) @libr...
[((192, 219), 'library.put', 'library.put', (['"""model"""', 'model'], {}), "('model', model)\n", (203, 219), False, 'import library\n'), ((238, 265), 'library.put', 'library.put', (['"""ROUND"""', 'ROUND'], {}), "('ROUND', ROUND)\n", (249, 265), False, 'import library\n'), ((286, 313), 'library.put', 'library.put', ([...
ragingpastry/molecule-ignite
molecule_ignite/test/unit/test_driver.py
aaf005cabba9a8c933191458cf8553da9bac581d
from molecule import api def test_driver_is_detected(): driver_name = __name__.split(".")[0].split("_")[-1] assert driver_name in [str(d) for d in api.drivers()]
[((157, 170), 'molecule.api.drivers', 'api.drivers', ([], {}), '()\n', (168, 170), False, 'from molecule import api\n')]
dengemann/meegpowreg
coffeine/pipelines.py
e9cc8f2372f8b8ef4b372bfea113ed0b9646cb39
import numpy as np from coffeine.covariance_transformers import ( Diag, LogDiag, ExpandFeatures, Riemann, RiemannSnp, NaiveVec) from coffeine.spatial_filters import ( ProjIdentitySpace, ProjCommonSpace, ProjLWSpace, ProjRandomSpace, ProjSPoCSpace) from sklearn.compose impor...
[((8795, 8855), 'sklearn.pipeline.make_pipeline', 'make_pipeline', (['filter_bank_transformer', 'scaling_', 'estimator_'], {}), '(filter_bank_transformer, scaling_, estimator_)\n', (8808, 8855), False, 'from sklearn.pipeline import make_pipeline\n'), ((12236, 12296), 'sklearn.pipeline.make_pipeline', 'make_pipeline', (...
dysomni/aima-python
submissions/Chouard/mygames.py
c67104e50007ec5ac2a9aa37f0cb972cb6315528
from games import Game from math import nan, isnan from queue import PriorityQueue from copy import deepcopy from utils import isnumber from grading.util import print_table class GameState: def __init__(self, to_move, position, board, label=None): self.to_move = to_move self.position = position ...
[((944, 959), 'queue.PriorityQueue', 'PriorityQueue', ([], {}), '()\n', (957, 959), False, 'from queue import PriorityQueue\n'), ((1196, 1211), 'queue.PriorityQueue', 'PriorityQueue', ([], {}), '()\n', (1209, 1211), False, 'from queue import PriorityQueue\n'), ((4545, 4560), 'queue.PriorityQueue', 'PriorityQueue', ([],...
minhhoang1023/GamestonkTerminal
discordbot/stocks/options/opt_chain.py
195dc19b491052df080178c0cc6a9d535a91a704
import os import df2img import disnake import numpy as np import pandas as pd from menus.menu import Menu from PIL import Image import discordbot.config_discordbot as cfg from discordbot.config_discordbot import gst_imgur, logger from discordbot.helpers import autocrop_image from gamestonk_terminal.stocks.options imp...
[((860, 901), 'gamestonk_terminal.stocks.options.yfinance_model.option_expirations', 'yfinance_model.option_expirations', (['ticker'], {}), '(ticker)\n', (893, 901), False, 'from gamestonk_terminal.stocks.options import yfinance_model\n'), ((1587, 1617), 'numpy.percentile', 'np.percentile', (["df['strike']", '(1)'], {}...
xujiahuayz/premfin
scripts/get_lenderprofit.py
0e90d876ef7c9ef4f3da7d4842b8ec5ae9ac7e68
#%% import packages import numpy as np import pandas as pd import multiprocessing from time import time import json from premiumFinance.constants import ( MORTALITY_TABLE_CLEANED_PATH, PROCESSED_PROFITABILITY_PATH, ) from premiumFinance.financing import calculate_lender_profit, yield_curve mortality_experien...
[((325, 368), 'pandas.read_excel', 'pd.read_excel', (['MORTALITY_TABLE_CLEANED_PATH'], {}), '(MORTALITY_TABLE_CLEANED_PATH)\n', (338, 368), True, 'import pandas as pd\n'), ((1720, 1762), 'numpy.arange', 'np.arange', ([], {'start': '(0.01)', 'stop': '(0.2)', 'step': '(0.01)'}), '(start=0.01, stop=0.2, step=0.01)\n', (17...
BearerPipelineTest/catapult
dashboard/dashboard/common/layered_cache.py
3800a67cd916200046a50748893bbd0dcf3d7f4a
# Copyright 2018 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. """Caches processed query results in memcache and datastore. Memcache is not very reliable for the perf dashboard. Prometheus team explained that memcache is...
[((1949, 1967), 'google.appengine.ext.ndb.BlobProperty', 'ndb.BlobProperty', ([], {}), '()\n', (1965, 1967), False, 'from google.appengine.ext import ndb\n'), ((1984, 2006), 'google.appengine.ext.ndb.DateTimeProperty', 'ndb.DateTimeProperty', ([], {}), '()\n', (2004, 2006), False, 'from google.appengine.ext import ndb\...
BigAndSweet/HyperGBM
hypergbm/tests/cuml_/run_experiment_cuml.py
f3bc4e0d877b82a264d35158f9bc974f43a2a5ee
# -*- coding:utf-8 -*- """ """ import cudf from hypergbm import make_experiment from hypernets.tabular import get_tool_box from hypernets.tabular.datasets import dsutils def main(target='y', dtype=None, max_trials=3, drift_detection=False, clear_cache=True, **kwargs): tb = get_tool_box(cudf.DataFrame) asse...
[((283, 311), 'hypernets.tabular.get_tool_box', 'get_tool_box', (['cudf.DataFrame'], {}), '(cudf.DataFrame)\n', (295, 311), False, 'from hypernets.tabular import get_tool_box\n'), ((413, 432), 'hypernets.tabular.datasets.dsutils.load_bank', 'dsutils.load_bank', ([], {}), '()\n', (430, 432), False, 'from hypernets.tabul...
DarthSpector/Poster-Adder
Inserter.py
97a86338987dd8cbcdf56414f53932c0370dcfc2
def pictureInserter(og,address,list): j=0 for i in og: file1 = open(address+'/'+i, "a") x="\ncover::https://image.tmdb.org/t/p/original/"+list[j] file1.writelines(x) file1.close() j=j+1
[]