repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 840k |
|---|---|---|---|---|
illusion173/Physics250 | Physics250-ME29/magAverageEMFinCoil.py | 69f2ffdb8af013e8b0739779861c1455b579ddaf | import numpy as np
import math
extraNumber = 4 * math.pi * pow(10,-7)
def avgEMF():
turns = input("Input how many turns: ")
radius = input("Input the radius (cm):")
resistance = input("Input resistance (Ω): ")
magField0 = input("Input the first magnetic Field value (T): ")
magField1 = in... | [] |
zhouxzh/Jetson_nano_stft_benchmark | bench_cupy.py | ffa97984f95b9862ac2a10b8459bb7ef241c6c72 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Computes the spectrogram of a test signal using cupy and cuFFT.
Author: Jan Schlüter
"""
import sys
import os
import timeit
import numpy as np
import cupy as cp
INPUT_ON_GPU = True
OUTPUT_ON_GPU = True
from testfile import make_test_signal
def spectrogram(signal... | [((35, 12, 35, 31), 'cupy.fft.rfft', 'cp.fft.rfft', ({(35, 24, 35, 30): 'signal'}, {}), '(signal)', True, 'import cupy as cp\n'), ((37, 12, 37, 25), 'cupy.abs', 'cp.abs', ({(37, 19, 37, 24): 'spect'}, {}), '(spect)', True, 'import cupy as cp\n'), ((48, 8, 48, 26), 'testfile.make_test_signal', 'make_test_signal', ({}, {... |
UCBerkeley-SCET/DataX-Berkeley | dataxHWSp2021/HW3-4_NeuralNet/student/tests/q2b3.py | f912d22c838b511d3ada4ecfa3548afd80437b74 | test = { 'name': 'q2b3',
'points': 5,
'suites': [ { 'cases': [ { 'code': '>>> '
'histories_2b[2].model.count_params()\n'
'119260',
'hidden': False,
... | [] |
Cynthia-Borot-PNE/Geotrek-admin | geotrek/appconfig.py | abd9ca8569a7e35ef7473f5b52731b1c78668754 | from django.apps import AppConfig
from django.contrib.admin.apps import AdminConfig
from django.contrib.auth.apps import AuthConfig
from django.contrib.contenttypes.apps import ContentTypesConfig
from django.contrib.sessions.apps import SessionsConfig
from django.db.models.signals import post_migrate
from django_celery... | [((19, 8, 19, 95), 'django.db.models.signals.post_migrate.connect', 'post_migrate.connect', (), '', False, 'from django.db.models.signals import post_migrate\n'), ((20, 8, 20, 35), 'geotrek.common.utils.signals.check_srid_has_meter_unit', 'check_srid_has_meter_unit', ({}, {}), '()', False, 'from geotrek.common.utils.si... |
merrymercy/dtr-prototype | dtr_code/shared/run_torch_trial.py | bf40e182453a7d8d23581ea68f32a9d7d2037d62 | """
To avoid any issues of memory hanging around between inputs,
we run each input as a separate process.
A little ugly but effective
"""
import gc
import glob
import json
import os
import random
import time
import numpy as np
import torch
from common import invoke_main, read_json, write_json, prepare_out_file, chec... | [((30, 11, 30, 49), 'common.read_json', 'read_json', ({(30, 21, 30, 29): 'dest_dir', (30, 31, 30, 48): 'sim_conf_filename'}, {}), '(dest_dir, sim_conf_filename)', False, 'from common import invoke_main, read_json, write_json, prepare_out_file, check_file_exists\n'), ((41, 4, 41, 49), 'common.write_json', 'write_json', ... |
rsanchezgarc/BIPSPI | pythonTools/downloadPDBsInList.py | e155fee0836084ea02bc9919c58817d26a4a13e5 | import sys, os
from subprocess import call
try:
from downloadPdb import downloadPDB
except ImportError:
from .downloadPdb import downloadPDB
pdbListFile="/home/rsanchez/Tesis/rriPredMethod/data/joanDimers/117_dimers_list.tsv"
outPath="/home/rsanchez/Tesis/rriPredMethod/data/joanDimers/pdbFiles/rawPDBs"
USE_BIO_... | [((31, 6, 31, 69), 'downloadPdb.downloadPDB', 'downloadPDB', (), '', False, 'from downloadPdb import downloadPDB\n'), ((36, 33, 36, 64), 'os.path.expanduser', 'os.path.expanduser', ({(36, 52, 36, 63): 'sys.argv[1]'}, {}), '(sys.argv[1])', False, 'import sys, os\n'), ((37, 29, 37, 60), 'os.path.expanduser', 'os.path.exp... |
hsethi2709/xapian-docsprint | code/python3/search_facets.py | a872c83fef6fde13efce67fd5563d43514c7444a | #!/usr/bin/env python
import json
import sys
import xapian
import support
def search(dbpath, querystring, offset=0, pagesize=10):
# offset - defines starting point within result set
# pagesize - defines number of records to retrieve
# Open the database we're going to search.
db = xapian.Database(dbpa... | [((13, 9, 13, 32), 'xapian.Database', 'xapian.Database', ({(13, 25, 13, 31): 'dbpath'}, {}), '(dbpath)', False, 'import xapian\n'), ((16, 18, 16, 38), 'xapian.QueryParser', 'xapian.QueryParser', ({}, {}), '()', False, 'import xapian\n'), ((26, 14, 26, 32), 'xapian.Enquire', 'xapian.Enquire', ({(26, 29, 26, 31): 'db'}, ... |
plrthink/myicons | iconcollections/serializers.py | 62475e118e2c7404d88146ea5d67961418d7f8ab | import re
from rest_framework import serializers
from .models import Collection, CollectionIcon
class CollectionSerializer(serializers.ModelSerializer):
"""Collections's serializer"""
class Meta:
model = Collection
read_only = ('token', )
class CollectionIconSerializer(serializers.ModelSe... | [((32, 15, 32, 39), 're.sub', 're.sub', ({(32, 22, 32, 27): '"""-+"""', (32, 29, 32, 32): '"""-"""', (32, 34, 32, 38): 'name'}, {}), "('-+', '-', name)", False, 'import re\n'), ((44, 14, 46, 9), 'rest_framework.serializers.ValidationError', 'serializers.ValidationError', ({(45, 12, 45, 68): '"""Either a packicon or the... |
sm2774us/leetcode_interview_prep_2021 | Python/partition-to-k-equal-sum-subsets.py | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | # Time: O(n*2^n)
# Space: O(2^n)
class Solution(object):
def canPartitionKSubsets(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: bool
"""
def dfs(nums, target, used, todo, lookup):
if lookup[used] is None:
targ = (todo-1)%... | [] |
jeanbez/spack | var/spack/repos/builtin/packages/aspell/package.py | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
# See also: AspellDictPackage
class Aspell(AutotoolsPackage, GNUMirrorPackage):
"""GNU A... | [] |
Ivy286/cluster_basedfps | third_party_package/RDKit_2015_03_1/rdkit/ML/Descriptors/UnitTestParser.py | 7fc216537f570436f008ea567c137d03ba2b6d81 | #
# Copyright (C) 2001 greg Landrum
#
""" unit testing code for compound descriptors
"""
from __future__ import print_function
import unittest
import Parser
from rdkit.six.moves import xrange
class TestCase(unittest.TestCase):
def setUp(self):
print('\n%s: '%self.shortDescription(),end='')
self.piec... | [((44, 10, 44, 30), 'unittest.TestSuite', 'unittest.TestSuite', ({}, {}), '()', False, 'import unittest\n'), ((29, 12, 29, 90), 'Parser.CalcSingleCompoundDescriptor', 'Parser.CalcSingleCompoundDescriptor', ({(29, 48, 29, 59): 'self.compos', (29, 60, 29, 67): 'argVect', (29, 68, 29, 78): 'self.aDict', (29, 79, 29, 89): ... |
maciek3000/data_dashboard | setup.py | 1b573b674d37f57ae7e8bbfb1e83c801b488dfd6 | from setuptools import setup, find_packages
import pathlib
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / "readme.md").read_text(encoding="utf-8")
setup(
name="data_dashboard",
version="0.1.1",
description="Dashboard to explore the data and to create baseline Machine Learning m... | [((28, 13, 28, 28), 'setuptools.find_packages', 'find_packages', ({}, {}), '()', False, 'from setuptools import setup, find_packages\n'), ((5, 7, 5, 29), 'pathlib.Path', 'pathlib.Path', ({(5, 20, 5, 28): '__file__'}, {}), '(__file__)', False, 'import pathlib\n')] |
acornett21/ack-ec2-controller | test/e2e/tests/test_instance.py | aa747d981239e41ae4254a9b31ee0f20ac882c85 | # 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. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanyin... | [((93, 27, 93, 52), 'e2e.replacement_values.REPLACEMENT_VALUES.copy', 'REPLACEMENT_VALUES.copy', ({}, {}), '()', False, 'from e2e.replacement_values import REPLACEMENT_VALUES\n'), ((94, 20, 94, 63), 'acktest.resources.random_suffix_name', 'random_suffix_name', ({(94, 39, 94, 58): '"""instance-ack-test"""', (94, 60, 94,... |
Devidence7/Break | web/app/forms.py | f961b1b46977c86739ff651fe81a1d9fff98a8e1 | from flask_wtf import FlaskForm
from wtforms import Form, StringField, PasswordField, BooleanField, SubmitField, IntegerField, validators, FileField, \
MultipleFileField, SelectField, RadioField, HiddenField, DecimalField, TextAreaField
from wtforms.fields.html5 import DateField
from wtforms.validators import DataR... | [((14, 18, 14, 44), 'wtforms.BooleanField', 'BooleanField', ({(14, 31, 14, 43): '"""Recuerdame"""'}, {}), "('Recuerdame')", False, 'from wtforms import Form, StringField, PasswordField, BooleanField, SubmitField, IntegerField, validators, FileField, MultipleFileField, SelectField, RadioField, HiddenField, DecimalField,... |
LMiceOrg/postdoc-voting | hello.py | 091fd6caa120f7c5aae600c0a492a185ec10e9d6 | #coding: utf-8
import sys
import os
import asyncio
import websockets
import json
import socket
import xlrd
#global vars
phd_data = None
pro_data = None
def get_host_ip():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('1.255.255.255', 65535))
ip = s.getsockname()[0]
... | [((133, 12, 133, 57), 'websockets.serve', 'websockets.serve', ({(133, 29, 133, 39): 'main_logic', (133, 41, 133, 50): '"""0.0.0.0"""', (133, 52, 133, 56): 'port'}, {}), "(main_logic, '0.0.0.0', port)", False, 'import websockets\n'), ((17, 12, 17, 60), 'socket.socket', 'socket.socket', ({(17, 26, 17, 40): 'socket.AF_INE... |
maximmenshikov/antlr4 | runtime/Python3/src/antlr4/dfa/DFASerializer.py | 5ad8c150ae6b9a34a92df1f59606516fe58cb65f | #
# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#/
# A DFA walker that knows how to dump them to serialized strings.#/
from io import StringIO
from antlr4 import DFA
from antl... | [((25, 13, 25, 23), 'io.StringIO', 'StringIO', ({}, {}), '()', False, 'from io import StringIO\n'), ((61, 45, 61, 67), 'antlr4.Utils.str_list', 'str_list', ({(61, 54, 61, 66): 's.predicates'}, {}), '(s.predicates)', False, 'from antlr4.Utils import str_list\n')] |
microsoft/moabian | sw/calibrate.py | db95844103faedb3788abb5f37d0f37a771a9455 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""
Calibration Controller
Performs calibration for hue, center of camera position, and servo offsets
"""
import os
import cv2
import time
import json
import argparse
import datetime
import numpy as np
import logging as log
from env import Moa... | [((125, 4, 125, 46), 'logging.warning', 'log.warning', ({(125, 16, 125, 45): 'f"""Offset calibration failed."""'}, {}), "(f'Offset calibration failed.')", True, 'import logging as log\n'), ((130, 17, 130, 28), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ((131, 13, 131, 26), 'common.Vector2', 'Vec... |
renzyndrome/lits-crm | marketing/tests_celery_tasks.py | 32daea8c76f91780b8cc8c3f107d04df606c0ec8 | from datetime import datetime, timedelta
from django.test import TestCase
from django.test.utils import override_settings
from marketing.tasks import (
delete_multiple_contacts_tasks,
list_all_bounces_unsubscribes,
run_all_campaigns,
run_campaign,
send_campaign_email_to_admin_contact,
send_sch... | [((19, 5, 23, 5), 'django.test.utils.override_settings', 'override_settings', (), '', False, 'from django.test.utils import override_settings\n'), ((25, 15, 27, 9), 'marketing.tasks.run_campaign.apply', 'run_campaign.apply', ({(26, 12, 26, 31): '(self.campaign.id,)'}, {}), '((self.campaign.id,))', False, 'from marketin... |
andreluispy/py2html | doc's/3-labels_and_titles.py | 227f3225632b467c95131b841d6ffab4c5202e44 | from py2html.main import *
page = web()
page.create()
# Header Parameters
# text = header text
# n = title level
page.header(text='My Site', n=1)
# Label Parameters
# text = label text
# color = label color
page.label(text='', color='')
page.compile() | [] |
adujovic/JorG | JorGpi/tests/test_pickup.py | 15062984e837a938819e548c83f6f5414fa47103 | import unittest
from JorGpi.pickup.pickup import SmartPickUp,Reference,CommandLineOptions
class TestPickupIron(unittest.TestCase):
@staticmethod
def options(*args):
return CommandLineOptions(*args)
def test_iron_001(self):
_input = "test -R _VASP/Fe/noFlip -D _VASP/Fe/flip00000 -E Fe -J1 ... | [((8, 15, 8, 40), 'JorGpi.pickup.pickup.CommandLineOptions', 'CommandLineOptions', ({(8, 34, 8, 39): '*args'}, {}), '(*args)', False, 'from JorGpi.pickup.pickup import SmartPickUp, Reference, CommandLineOptions\n')] |
alaraayan/todo-backend | jwt_auth/admin.py | 37e46b6789012c2d64a39f6d2429b1ae893dba37 | from django.contrib import admin
from django.contrib.auth import get_user_model
User = get_user_model()
admin.site.register(User)
| [((4, 7, 4, 23), 'django.contrib.auth.get_user_model', 'get_user_model', ({}, {}), '()', False, 'from django.contrib.auth import get_user_model\n'), ((5, 0, 5, 25), 'django.contrib.admin.site.register', 'admin.site.register', ({(5, 20, 5, 24): 'User'}, {}), '(User)', False, 'from django.contrib import admin\n')] |
uw-it-aca/spotseeker_server | spotseeker_server/test/search/distance.py | 1d8a5bf98b76fdcb807ed4cd32f939bb7e9aa66c | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.test import TestCase
from django.conf import settings
from django.test.client import Client
from spotseeker_server.models import Spot
import simplejson as json
from decimal import *
from django.test.utils import override... | [((15, 1, 15, 74), 'django.test.utils.override_settings', 'override_settings', (), '', False, 'from django.test.utils import override_settings\n'), ((18, 12, 18, 20), 'django.test.client.Client', 'Client', ({}, {}), '()', False, 'from django.test.client import Client\n'), ((38, 12, 38, 20), 'django.test.client.Client',... |
JNPRAutomate/northstar_SDN_controller_automation | get_active_LSPs.py | 09fb5b84eaa1cf939268b542239c9923520d99d3 | # this python script makes a rest call to Juniper Northstar to get active LSPs
# usage: python get_active_LSPs.py
import json
import requests
from requests.auth import HTTPBasicAuth
from pprint import pprint
import yaml
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3... | [] |
mewbak/dragonffi | bindings/python/tests/cdef_types.py | 2a205dbe4dd980d5dd53026c871514795573a7fb | # Copyright 2018 Adrien Guinet <adrien@guinet.me>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [((21, 4, 21, 16), 'pydffi.FFI', 'pydffi.FFI', ({}, {}), '()', False, 'import pydffi\n')] |
deepneuralmachine/google-research | hierarchical_foresight/env/environment.py | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | [((46, 12, 46, 61), 'copy.deepcopy', 'copy.deepcopy', ({(46, 26, 46, 60): 'self._sim_env.physics.data.qpos[:]'}, {}), '(self._sim_env.physics.data.qpos[:])', False, 'import copy\n'), ((47, 12, 47, 61), 'copy.deepcopy', 'copy.deepcopy', ({(47, 26, 47, 60): 'self._sim_env.physics.data.qvel[:]'}, {}), '(self._sim_env.phys... |
chorna/taxi24 | trips/migrations/0004_invoice.py | 09e174a0cb3b9543ca4987e60cd0d37ecda6ac3c | # Generated by Django 3.2.5 on 2021-07-11 23:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('trips', '0003_alter_trip_state'),
]
operations = [
migrations.CreateModel(
name='Invoice',
... | [((17, 23, 17, 115), 'django.db.models.BigAutoField', 'models.BigAutoField', (), '', False, 'from django.db import migrations, models\n'), ((18, 26, 18, 56), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import migrations, models\n'), ((19, 27, 19, 57), 'django.db.models.CharField', '... |
Badger-Finance/python-keepers | src/general_harvester.py | b5b2b0b083a237dceecd161d81754512959822b1 | import logging
import os
from decimal import Decimal
from time import sleep
import requests
from hexbytes import HexBytes
from web3 import Web3
from web3 import contract
from web3.contract import Contract
from config.constants import BASE_CURRENCIES
from config.constants import GAS_LIMITS
from config.constants import... | [((30, 0, 30, 39), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((32, 28, 32, 38), 'src.misc_utils.hours', 'hours', ({(32, 34, 32, 37): '120'}, {}), '(120)', False, 'from src.misc_utils import hours\n'), ((43, 26, 43, 49), 'os.getenv', 'os.getenv', ({(43, 36, 43, 48): '"""KEEPER_ACL... |
yonesko/clickhouse-plantuml | clickhouse_plantuml/column.py | 6db26788fe86854967f627f28fd8a403ccbf7ffb | #!/usr/bin/env python
# License: Apache-2.0
# Copyright (C) 2020 Mikhail f. Shiryaev
class Column(object):
"""
Represents ClickHouse column
"""
def __init__(
self,
database: str,
table: str,
name: str,
type: str,
default_kind: str,
default_expr... | [] |
pmalhaire/WireHub | contrib/micronet/scripts/file2buf.py | 588a372e678b49557deed6ba88a896596222fb2d | #!/usr/bin/env python3
import os
import sys
MAX = 8
fpath = sys.argv[1]
name = sys.argv[2]
with open(fpath, "rb") as fh:
sys.stdout.write("char %s[] = {" % (name,) )
i = 0
while True:
if i > 0:
sys.stdout.write(", ")
if i % MAX == 0:
sys.stdout.write("\n\t")
... | [((12, 4, 12, 48), 'sys.stdout.write', 'sys.stdout.write', ({(12, 21, 12, 46): "('char %s[] = {' % (name,))"}, {}), "('char %s[] = {' % (name,))", False, 'import sys\n'), ((17, 12, 17, 34), 'sys.stdout.write', 'sys.stdout.write', ({(17, 29, 17, 33): '""", """'}, {}), "(', ')", False, 'import sys\n'), ((20, 12, 20, 36),... |
christiansandberg/RxPY | tests/test_observable/test_skip.py | 036027d2858ea6c9d45839c863bd791e5bb50c36 | import unittest
from reactivex import operators as ops
from reactivex.testing import ReactiveTest, TestScheduler
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ReactiveTest.disp... | [((364, 4, 364, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((17, 20, 17, 35), 'reactivex.testing.TestScheduler', 'TestScheduler', ({}, {}), '()', False, 'from reactivex.testing import ReactiveTest, TestScheduler\n'), ((50, 20, 50, 35), 'reactivex.testing.TestScheduler', 'TestSch... |
chaitanya1243/CP | CF#691/python/A.py | a0e5e34daf6f7c22c9a91212b65338ef0c46d163 |
def solve(n, red , blue):
rcount = bcount = 0
for i in range(n):
if int(red[i]) > int(blue[i]):
rcount = rcount +1
elif int(red[i]) < int(blue[i]):
bcount = bcount + 1
print( 'RED' if rcount>bcount else ('BLUE' if bcount>rcount else 'EQUAL'))
if __name__ == "__ma... | [] |
fitpay/shudder | shudder/__main__.py | 3bd3d7d712f60b7c7db1d259c024dde3eaeed26c | # Copyright 2014 Scopely, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | [] |
NLESC-JCER/pyCHAMP | example/hydrogen.py | 97523237b3521a426d664b6e2972257045ff8f5e | import autograd.numpy as np
from pyCHAMP.wavefunction.wf_base import WF
from pyCHAMP.optimizer.minimize import Minimize
from pyCHAMP.sampler.metropolis import Metropolis
from pyCHAMP.sampler.hamiltonian import Hamiltonian
from pyCHAMP.solver.vmc import VMC
class Hydrogen(WF):
def __init__(self, nelec, ndim):
... | [((44, 14, 45, 71), 'pyCHAMP.sampler.metropolis.Metropolis', 'Metropolis', (), '', False, 'from pyCHAMP.sampler.metropolis import Metropolis\n'), ((46, 14, 47, 55), 'pyCHAMP.sampler.hamiltonian.Hamiltonian', 'Hamiltonian', (), '', False, 'from pyCHAMP.sampler.hamiltonian import Hamiltonian\n'), ((48, 16, 48, 61), 'pyCH... |
futureironman/braintree_python | braintree/account_updater_daily_report.py | 26bb8a857bc29322a8bca2e8e0fe6d99cfe6a1ac | from braintree.configuration import Configuration
from braintree.resource import Resource
class AccountUpdaterDailyReport(Resource):
def __init__(self, gateway, attributes):
Resource.__init__(self, gateway, attributes)
if "report_url" in attributes:
self.report_url = attributes.pop("re... | [((7, 8, 7, 52), 'braintree.resource.Resource.__init__', 'Resource.__init__', ({(7, 26, 7, 30): 'self', (7, 32, 7, 39): 'gateway', (7, 41, 7, 51): 'attributes'}, {}), '(self, gateway, attributes)', False, 'from braintree.resource import Resource\n')] |
geoncic/PyBlock | game/ball.py | 69c8220e38a21b7e1c6dd2196752173f9e78981f | import pygame
import pygame.gfxdraw
from constants import Constants
class Balls(object):
def __init__(self, all_sprites, all_balls):
self.all_sprites = all_sprites
self.all_balls = all_balls
def spawn_ball(self, pos, vel, team):
# Todo: Figure out how to spawn multiple balls with some... | [((33, 21, 33, 96), 'pygame.Surface', 'pygame.Surface', ({(33, 36, 33, 78): '[Constants.BALL_SIZE, Constants.BALL_SIZE]', (33, 80, 33, 95): 'pygame.SRCALPHA'}, {}), '([Constants.BALL_SIZE, Constants.BALL_SIZE], pygame.SRCALPHA)', False, 'import pygame\n'), ((34, 8, 34, 81), 'pygame.draw.circle', 'pygame.draw.circle', (... |
otills/embryocv | program/eggUI.py | d501f057bada15ff5dc753d3dae5a883b5c9e244 | from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
from scipy.spatial import distance as dist
import glob
import re
import os
from PyQt5 import QtGui
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import sys
import cv2
import pandas as pd
from PyQt5.Qt import *
import pyqtgraph as pg
#from PyQt4.Qt import ... | [((22, 19, 22, 38), 'pyqtgraph.Qt.QtCore.pyqtSignal', 'QtCore.pyqtSignal', ({}, {}), '()', False, 'from pyqtgraph.Qt import QtCore, QtGui\n'), ((23, 19, 23, 38), 'pyqtgraph.Qt.QtCore.pyqtSignal', 'QtCore.pyqtSignal', ({}, {}), '()', False, 'from pyqtgraph.Qt import QtCore, QtGui\n'), ((24, 17, 24, 36), 'pyqtgraph.Qt.Qt... |
henriqueumeda/-Estudo-python | Curso em Vídeo/Mundo 2 Estruturas de Controle/Desafios/desafio053.py | 28e93a377afa4732037a29eb74d4bc7c9e24b62f | frase = input('Digite uma frase: ').upper().strip().replace(' ', '')
tamanho = int(len(frase))
inverso = ''
#Opção mais simples:
# inverso = frase[::-1]
for contador in range(tamanho-1, -1, -1):
inverso += frase[contador]
print('O inverso de {} é {}'.format(frase, inverso))
if frase == inverso:
print('Temos... | [] |
yiluzhu/quant | tests/unittest/options/pricing/test_binomial_trees.py | 784c5cc20eeded2ff684b464eec4744f000d9638 |
from unittest import TestCase
from options.pricing.binomial_trees import BinomialTreePricer
from options.option import OptionType, Option
class BinomialTreeTestCase(TestCase):
def test_basic(self):
"""European option, spot price 50, strike price 52, risk free interest rate 5%
expiry 2 years, vo... | [((14, 17, 14, 46), 'options.pricing.binomial_trees.BinomialTreePricer', 'BinomialTreePricer', (), '', False, 'from options.pricing.binomial_trees import BinomialTreePricer\n'), ((15, 17, 15, 61), 'options.option.Option', 'Option', ({(15, 24, 15, 38): 'OptionType.PUT', (15, 40, 15, 42): '50', (15, 44, 15, 46): '52', (1... |
Sharpieman20/MCtimer | mctimer.py | 5d4609f3697778de090816b8a768b82bbe217294 | import atexit
import os
import sys
import platform
import json
import glob
import datetime
import time
import threading
import tkinter as tk
from pynput import mouse
from pathlib import Path
from playsound import playsound
from enum import Enum
import copy
#"THE BEER-WARE LICENSE" (Revision 42):
#bleach86 wrote this ... | [((108, 15, 108, 25), 'pathlib.Path.cwd', 'Path.cwd', ({}, {}), '()', False, 'from pathlib import Path\n'), ((110, 14, 110, 31), 'platform.system', 'platform.system', ({}, {}), '()', False, 'import platform\n'), ((119, 9, 119, 16), 'tkinter.Tk', 'tk.Tk', ({}, {}), '()', True, 'import tkinter as tk\n'), ((121, 14, 121, ... |
informatique-cdc/kafka-python | kafka/structs.py | d73bd6fc2f8825e2fddb7c4f091af7b266e37aea | """ Other useful structs """
from __future__ import absolute_import
from collections import namedtuple
"""A topic and partition tuple
Keyword Arguments:
topic (str): A topic name
partition (int): A partition id
"""
TopicPartition = namedtuple("TopicPartition",
["topic", "partition"])
"""A Kafka broker... | [((13, 17, 14, 27), 'collections.namedtuple', 'namedtuple', ({(13, 28, 13, 44): '"""TopicPartition"""', (14, 4, 14, 26): "['topic', 'partition']"}, {}), "('TopicPartition', ['topic', 'partition'])", False, 'from collections import namedtuple\n'), ((27, 17, 28, 39), 'collections.namedtuple', 'namedtuple', ({(27, 28, 27,... |
manolosolalinde/Vehicle-Counting | Vehicle_Counting_colab.py | 898e1993613ea5a6803078cc5026d2d690c12322 | import cv2
from trackers.tracker import create_blob, add_new_blobs, remove_duplicates
import numpy as np
from collections import OrderedDict
from detectors.detector import get_bounding_boxes
import uuid
import os
import contextlib
from datetime import datetime
import argparse
from utils.detection_roi import get_roi_fra... | [((16, 9, 16, 34), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ({}, {}), '()', False, 'import argparse\n'), ((45, 6, 45, 29), 'cv2.VideoCapture', 'cv2.VideoCapture', ({(45, 23, 45, 28): 'video'}, {}), '(video)', False, 'import cv2\n'), ((49, 8, 49, 21), 'collections.OrderedDict', 'OrderedDict', ({}, {}), '()'... |
ComputeCanada/mc-hub | app/resources/magic_castle_api.py | 92b4c212ba8f7b5b1c8b8700f981275605a07067 | from flask import request
from resources.api_view import ApiView
from exceptions.invalid_usage_exception import InvalidUsageException
from models.user.user import User
from models.user.authenticated_user import AuthenticatedUser
class MagicCastleAPI(ApiView):
def get(self, user: User, hostname):
if hostna... | [((52, 20, 52, 38), 'flask.request.get_json', 'request.get_json', ({}, {}), '()', False, 'from flask import request\n'), ((43, 24, 43, 42), 'flask.request.get_json', 'request.get_json', ({}, {}), '()', False, 'from flask import request\n'), ((54, 18, 54, 68), 'exceptions.invalid_usage_exception.InvalidUsageException', ... |
kthblmfld/sawtooth-next-directory | tests/rbac/api/role/propose_member_test.py | 57291f1a7e6ce1dfc11a9c5e2930e8c5ebd31707 | # Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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 ... | [((29, 9, 29, 29), 'rbac.common.logs.get_logger', 'get_logger', ({(29, 20, 29, 28): '__name__'}, {}), '(__name__)', False, 'from rbac.common.logs import get_logger\n'), ((38, 11, 38, 49), 'tests.rbac.helper.api.role.create.new', 'helper.api.role.create.new', (), '', False, 'from tests.rbac import helper\n'), ((40, 10, ... |
ClimberY/video_super_resolution_toolbox | f2v.py | e03fd34f60bf1104bd78ac0738a2648cee2eae46 | import cv2
import os
import numpy as np
from PIL import Image
def frame2video(im_dir, video_dir, fps):
im_list = os.listdir(im_dir)
im_list.sort(key=lambda x: int(x.replace("_RBPNF7", "").split('.')[0]))
img = Image.open(os.path.join(im_dir, im_list[0]))
img_size = img.size # 获得图片分辨率,im_dir文件夹下的图片分辨率... | [((8, 14, 8, 32), 'os.listdir', 'os.listdir', ({(8, 25, 8, 31): 'im_dir'}, {}), '(im_dir)', False, 'import os\n'), ((12, 13, 12, 44), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', ({(12, 36, 12, 43): "*'XVID'"}, {}), "(*'XVID')", False, 'import cv2\n'), ((13, 18, 13, 67), 'cv2.VideoWriter', 'cv2.VideoWriter', ({(... |
shuncyu/mflops | mflops/model_info.py | 81fddf9407bcbdca02b9c57f6b03640b3fb94101 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 17:38:48 2020
@author: luke
"""
import sys
from functools import partial
import torch
import torch.nn as nn
import prettytable as pt
from .basic_hook import MODULES_MAPPING
def get_model_compute_info(model, input_res,
... | [((52, 9, 52, 25), 'prettytable.PrettyTable', 'pt.PrettyTable', ({}, {}), '()', True, 'import prettytable as pt\n'), ((230, 15, 230, 59), 'functools.partial', 'partial', ({(230, 23, 230, 48): 'add_compute_hook_function'}, {}), '(add_compute_hook_function, **kwargs)', False, 'from functools import partial\n'), ((37, 20,... |
Church-/dosage | dosagelib/plugins/derideal.py | 7ef18a2a2e9f77aa1e64a44906731506a00fac45 | # SPDX-License-Identifier: MIT
# Copyright (C) 2019-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
from ..scraper import _ParserScraper
from ..helpers import indirectStarter
class Derideal(_ParserScraper):
baseUrl = 'https://www.derideal.com/'
imageSearch = '//img[contains(@class, "comic-page"... | [] |
subash-kc/2022-01-04-Python | LearnFunction/learnfunction01.py | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | """
Function are subprograms which are used to compute a value or perform a task.
Type of Functions:-
Built in Functions:
print(), upper()
User define functions
Advantage of Functions
1. Write once and use it as many time as you need. This provides code reusability
2. Function facilitates ease of code maint... | [((93, 12, 93, 36), 'numpy.prod', 'numpy.prod', ({(93, 23, 93, 35): 'list_product'}, {}), '(list_product)', False, 'import numpy\n')] |
rpedigoni/trackr | trackr/cli.py | ab5cf0cc661d003c6bd2ffa5516babf2e931de78 | # coding: utf-8
import click
@click.command()
@click.option('--carrier', prompt='Carrier ID', help='Example: "ect" for Correios')
@click.option('--object-id', prompt='Object ID',
help='Example: PN871429404BR')
def main(carrier, object_id):
from trackr import Trackr
from trackr.exceptions import ... | [((5, 1, 5, 16), 'click.command', 'click.command', ({}, {}), '()', False, 'import click\n'), ((6, 1, 6, 83), 'click.option', 'click.option', (), '', False, 'import click\n'), ((7, 1, 8, 44), 'click.option', 'click.option', (), '', False, 'import click\n'), ((14, 12, 14, 44), 'trackr.Trackr.track', 'Trackr.track', ({(14... |
pi-top/pi-top-Python-SDK | pitop/common/notifications.py | 6c83cc5f612d77f86f8d391c7f2924a28f7b1232 | from enum import Enum, auto
from subprocess import CalledProcessError, run
from pitop.common.command_runner import run_command
from pitop.common.logger import PTLogger
class NotificationAction:
def __init__(self, call_to_action_text, command_str) -> None:
self.call_to_action_text = call_to_action_text
... | [((34, 10, 34, 16), 'enum.auto', 'auto', ({}, {}), '()', False, 'from enum import Enum, auto\n'), ((35, 13, 35, 19), 'enum.auto', 'auto', ({}, {}), '()', False, 'from enum import Enum, auto\n'), ((36, 15, 36, 21), 'enum.auto', 'auto', ({}, {}), '()', False, 'from enum import Enum, auto\n'), ((53, 8, 53, 84), 'subproces... |
AntonelloDN/gismo | src/Gismo_XY To Location.py | 3ffbabaf8405efd3572701c9e0b7497211dfc248 | # xy to location
#
# Gismo is a plugin for GIS environmental analysis (GPL) started by Djordje Spasic.
#
# This file is part of Gismo.
#
# Copyright (c) 2019, Djordje Spasic <djordjedspasic@gmail.com>
# Gismo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Lic... | [] |
ytognder/Azure-Sentinel | Notebooks/SentinelUtilities/SentinelAnomalyLookup/__init__.py | 7345560f178e731d7ba5a5541fd3383bca285311 | # pylint: disable-msg=C0103
"""
SentinelAnomalyLookup: This package is developed for Azure Sentinel Anomaly lookup
"""
# __init__.py
from .anomaly_lookup_view_helper import AnomalyLookupViewHelper
from .anomaly_finder import AnomalyQueries, AnomalyFinder
| [] |
leerichoang/Legend-Of-Peach | items/coins.py | bef98ba7afdbddc497c45f8adedfb60e81176bfb | import pygame
from pygame.sprite import Sprite
class Coins(Sprite):
"""Coins"""
def __init__(self, hub, x, y, name='coin', state='floating'):
super().__init__()
# Values
self.name = name
self.hub = hub
self.original_pos = [x, y]
self.rest_height = y
se... | [((40, 30, 40, 85), 'pygame.transform.scale', 'pygame.transform.scale', ({(40, 53, 40, 72): 'self.image_index[0]', (40, 74, 40, 84): 'self.scale'}, {}), '(self.image_index[0], self.scale)', False, 'import pygame\n'), ((41, 30, 41, 86), 'pygame.transform.scale', 'pygame.transform.scale', ({(41, 53, 41, 72): 'self.image_... |
fiomenankiti/playground | python/package/geo/test/__init__.py | 7c3139ffe5db4b18cf042b8027c9f670860371e0 | from geo.calc import Calc
from geo.calc import Distance
from geo.geosp import Wt
from geo.geosp import Gh
from geo.files.csv_file import check | [] |
tcapelle/nb_helpers | tests/test_clean.py | 432b1f014f1b780b5a4d3722d44f237387db2330 | from pathlib import Path
from nb_helpers.clean import clean_all, clean_one
from tests import TEST_PATH
TEST_PATH
TEST_NB = Path("test_nb.py")
def test_clean_one():
"clean just one nb"
clean_one(TEST_NB)
def test_clean_all():
"clean all test nbs"
clean_all(path=TEST_PATH)
| [((6, 10, 6, 28), 'pathlib.Path', 'Path', ({(6, 15, 6, 27): '"""test_nb.py"""'}, {}), "('test_nb.py')", False, 'from pathlib import Path\n'), ((11, 4, 11, 22), 'nb_helpers.clean.clean_one', 'clean_one', ({(11, 14, 11, 21): 'TEST_NB'}, {}), '(TEST_NB)', False, 'from nb_helpers.clean import clean_all, clean_one\n'), ((16... |
KiloSat/FirstNivesh | apps/technical_analysis.py | 0fe200e08bb9f7d89de91f59eb14448fa7b972b9 | import streamlit as st
def app():
import yfinance as yf
import streamlit as st
import datetime
import matplotlib.pyplot as plt
import talib
import ta
import numpy as np
import matplotlib.ticker as mticker
import pandas as pd
import requests
yf.pdr_override()
st.wr... | [((14, 4, 14, 21), 'yfinance.pdr_override', 'yf.pdr_override', ({}, {}), '()', True, 'import yfinance as yf\n'), ((16, 4, 19, 8), 'streamlit.write', 'st.write', ({(16, 13, 19, 7): '"""\n # Technical Analysis of Securites\n Shown below are the **Moving Average Crossovers**, **Bollinger Bands**, **MACD\'s**, **Comm... |
pombredanne/django-sentry | tests/sentry/mediators/sentry_apps/test_creator.py | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | from __future__ import absolute_import
from mock import patch
from django.db import IntegrityError
from sentry.mediators.sentry_apps import Creator
from sentry.models import (
AuditLogEntry,
AuditLogEntryEvent,
ApiApplication,
IntegrationFeature,
SentryApp,
SentryAppComponent,
User,
)
from... | [((87, 5, 87, 62), 'mock.patch', 'patch', ({(87, 11, 87, 61): '"""sentry.mediators.sentry_apps.creator.Creator.log"""'}, {}), "('sentry.mediators.sentry_apps.creator.Creator.log')", False, 'from mock import patch\n'), ((88, 5, 88, 80), 'mock.patch', 'patch', ({(88, 11, 88, 79): '"""sentry.models.integrationfeature.Inte... |
ZAKI1905/HEP-Phen | python/Model_Files/LFV_3/parameters.py | bc06fecb2aa6bf108b59f76794e63c29eb37a35a | # This file was automatically created by FeynRules 2.3.32
# Mathematica version: 11.3.0 for Mac OS X x86 (64-bit) (March 7, 2018)
# Date: Sat 21 Apr 2018 20:48:39
from object_library import all_parameters, Parameter
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
# This is a defau... | [((13, 7, 17, 31), 'object_library.Parameter', 'Parameter', (), '', False, 'from object_library import all_parameters, Parameter\n'), ((20, 7, 26, 33), 'object_library.Parameter', 'Parameter', (), '', False, 'from object_library import all_parameters, Parameter\n'), ((28, 8, 34, 34), 'object_library.Parameter', 'Parame... |
xiangxing98/Rhythm-Enlightment | musicLrc.py | d6302321e858d07480b18e94c59de87f91c39202 | import time
musicLrc = """
[00:03.50]传奇
[00:19.10]作词:刘兵 作曲:李健
[00:20.60]演唱:王菲
[00:26.60]
[04:40.75][02:39.90][00:36.25]只是因为在人群中多看了你一眼
[04:49.00]
[02:47.44][00:43.69]再也没能忘掉你容颜
[02:54.83][00:51.24]梦想着偶然能有一天再相见
[03:02.32][00:58.75]从此我开始孤单思念
[03:08.15][01:04.30]
[03:09.35][01:05.50]想你时你在天边
[03:16.90][01:13.13]想你时你在眼前
[03:... | [((81, 4, 81, 17), 'time.sleep', 'time.sleep', ({(81, 15, 81, 16): '(1)'}, {}), '(1)', False, 'import time\n')] |
mnebelung/OctoPrint-OctoPod | octoprint_octopod/__init__.py | 3af1a2e1ad7c6f73ed05d9c1ff029fb645f3115a | # coding=utf-8
from __future__ import absolute_import
import datetime
import logging
import sys
import flask
import octoprint.plugin
from octoprint.events import eventManager, Events
from octoprint.server import user_permission
from octoprint.util import RepeatedTimer
from .bed_notifications import BedNotifications
... | [((43, 17, 43, 63), 'logging.getLogger', 'logging.getLogger', ({(43, 35, 43, 62): '"""octoprint.plugins.octopod"""'}, {}), "('octoprint.plugins.octopod')", False, 'import logging\n'), ((377, 31, 377, 92), 'octoprint.util.RepeatedTimer', 'RepeatedTimer', (), '', False, 'from octoprint.util import RepeatedTimer\n'), ((77... |
romanchyla/CSPatterns | tests/test_buffers.py | d9627297aabce1ab648f4a4cdbe9882527add138 | from cspatterns.datastructures import buffer
def test_circular_buffer():
b = buffer.CircularBuffer(2, ['n'])
assert len(b.next) == 2
assert b.n is None
b = buffer.CircularBuffer.create(2, attrs=['n', 'fib'])
curr = b
out = [0, 1, ]
curr.prev[-2].n = 0
curr.prev[-2].fib = 1
curr... | [((4, 8, 4, 39), 'cspatterns.datastructures.buffer.CircularBuffer', 'buffer.CircularBuffer', ({(4, 30, 4, 31): '2', (4, 33, 4, 38): "['n']"}, {}), "(2, ['n'])", False, 'from cspatterns.datastructures import buffer\n'), ((8, 8, 8, 59), 'cspatterns.datastructures.buffer.CircularBuffer.create', 'buffer.CircularBuffer.crea... |
2600box/harvest | plugins/redacted/migrations/0001_initial.py | 57264c15a3fba693b4b58d0b6d4fbf4bd5453bbd | # Generated by Django 2.1.7 on 2019-02-17 14:50
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='RedactedClientConfig',
fields=[
('id', mode... | [((17, 23, 17, 112), 'django.db.models.AutoField', 'models.AutoField', (), '', False, 'from django.db import migrations, models\n'), ((18, 29, 18, 47), 'django.db.models.TextField', 'models.TextField', ({}, {}), '()', False, 'from django.db import migrations, models\n'), ((19, 29, 19, 47), 'django.db.models.TextField',... |
ezcitron/BasemapTutorial | code_examples/plotting_data/hexbin.py | 0db9248b430d39518bdfdb25d713145be4eb966a | from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from numpy import array
from numpy import max
map = Basemap(llcrnrlon=-0.5,llcrnrlat=39.8,urcrnrlon=4.,urcrnrlat=43.,
resolution='i', projection='tmerc', lat_0 = 39.5, lon_0 = 1)
map.readshapefil... | [((8, 6, 9, 73), 'mpl_toolkits.basemap.Basemap', 'Basemap', (), '', False, 'from mpl_toolkits.basemap import Basemap\n'), ((27, 0, 27, 13), 'matplotlib.pyplot.figure', 'plt.figure', ({(27, 11, 27, 12): '(0)'}, {}), '(0)', True, 'import matplotlib.pyplot as plt\n'), ((38, 0, 38, 13), 'matplotlib.pyplot.figure', 'plt.fig... |
2443391447/nonebot2 | src/plugins/sjsy.py | c9fa0c44c130b8a1425b2b71105fa909232c37b0 | from nonebot import on_keyword, on_command
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import Message, Bot, Event # 这两个没用的别删
from nonebot.adapters.cqhttp.message import MessageSegment
import requests
from nonebot.permission import *
from nonebot.rule import to_me
from aiocqhttp.exceptions im... | [((10, 10, 10, 38), 'nonebot.on_keyword', 'on_keyword', ({(10, 21, 10, 37): "{'随机摄影'}"}, {}), "({'随机摄影'})", False, 'from nonebot import on_keyword, on_command\n'), ((25, 11, 25, 28), 'requests.get', 'requests.get', ({(25, 24, 25, 27): 'url'}, {}), '(url)', False, 'import requests\n'), ((17, 35, 17, 47), 'nonebot.adapte... |
chmduquesne/rofimoji | src/extractors/emojiextractor.py | 9abdc0a8db1b166bb30da994c4aadb7baf91df2d | import html
from collections import namedtuple
from pathlib import Path
from typing import List, Dict
import requests
from bs4 import BeautifulSoup
from lxml import etree
from lxml.etree import XPath
Emoji = namedtuple('Emoji', 'char name')
class EmojiExtractor(object):
def __init__(self):
self.all_emo... | [((11, 8, 11, 40), 'collections.namedtuple', 'namedtuple', ({(11, 19, 11, 26): '"""Emoji"""', (11, 28, 11, 39): '"""char name"""'}, {}), "('Emoji', 'char name')", False, 'from collections import namedtuple\n'), ((24, 15, 27, 9), 'requests.get', 'requests.get', (), '', False, 'import requests\n'), ((29, 15, 29, 47), 'bs... |
gregbdunn/firecracker | tests/integration_tests/security/test_seccomp.py | e7bc0a1f9b70deaa7bfd9eb641e0c7982fe63e68 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that the seccomp filters don't let blacklisted syscalls through."""
import os
from subprocess import run
import pytest
import host_tools.cargo_build as host # pylint:disable=import-error
@pyte... | [((26, 17, 29, 5), 'os.path.join', 'os.path.join', ({(27, 8, 27, 30): 'test_session_root_path', (28, 8, 28, 35): 'host.CARGO_RELEASE_REL_PATH'}, {}), '(test_session_root_path, host.CARGO_RELEASE_REL_PATH)', False, 'import os\n'), ((33, 28, 36, 5), 'os.path.join', 'os.path.join', ({(34, 8, 34, 35): 'host.CARGO_RELEASE_R... |
michealowen/MachingLearning | cluster/density/test.py | 9dcc908f2d3e468390e5abb7f051b449b0ecb455 | class a:
def __init__(self,da):
self.da = da
return
def go(self):
dd()
return None
def dd():
print('ok')
return None
aa = a(1)
aa.go() | [] |
dodieboy/Np_class | REM/Tool/IDA 7.3/python/ida_hexrays.py | af9ec993eda3c1e2bf70257c8384696bb64a5e9d | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
IDA Plugin SDK API wrapper: hexrays
"""
from sys import version_info
if version_info >= (2,6,0):
def sw... | [((18583, 0, 18592, 24), 'ida_idaapi._listify_types', 'ida_idaapi._listify_types', ({(18584, 8, 18584, 21): 'cinsnptrvec_t', (18585, 8, 18585, 21): 'ctree_items_t', (18586, 8, 18586, 22): 'qvector_lvar_t', (18587, 8, 18587, 22): 'qvector_carg_t', (18588, 8, 18588, 23): 'qvector_ccase_t', (18589, 8, 18589, 18): 'hexwarn... |
bfitzy2142/NET4901-SP | webapp/gen_graphs.py | 908c13332a5356bd6a59879b8d78af76432b807c | #!/usr/bin/env python3
"""
@author: Sam Cook
MySql Parser for graphical presentation
"""
import mysql.connector
import datetime
from mysql.connector import Error
from datetime import datetime, timedelta
import json
class sql_graph_info():
def __init__(self, node, interface, time, sql_creds, db):
"""
... | [((39, 19, 39, 33), 'datetime.datetime.now', 'datetime.now', ({}, {}), '()', False, 'from datetime import datetime, timedelta\n'), ((41, 25, 41, 39), 'datetime.datetime.now', 'datetime.now', ({}, {}), '()', False, 'from datetime import datetime, timedelta\n'), ((41, 42, 41, 72), 'datetime.timedelta', 'timedelta', (), '... |
dmtvanzanten/scqubits | scqubits/tests/test_fluxqubit.py | d4d8a0f71ac91077594a6173348279aa490ed048 | # test_fluxqubit.py
# meant to be run with 'pytest'
#
# This file is part of scqubits.
#
# Copyright (c) 2019 and later, Jens Koch and Peter Groszkowski
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
... | [((28, 25, 28, 52), 'numpy.linspace', 'np.linspace', ({(28, 37, 28, 41): '0.45', (28, 43, 28, 47): '0.55', (28, 49, 28, 51): '50'}, {}), '(0.45, 0.55, 50)', True, 'import numpy as np\n')] |
ckamtsikis/cmssw | PhysicsTools/PatAlgos/python/producersLayer1/pfParticleProducer_cfi.py | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | import FWCore.ParameterSet.Config as cms
patPFParticles = cms.EDProducer("PATPFParticleProducer",
# General configurables
pfCandidateSource = cms.InputTag("noJet"),
# MC matching configurables
addGenMatch = cms.bool(False),
genParticleMatch = cms.InputTag(""), ## particles source to be used for ... | [((5, 24, 5, 45), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', ({(5, 37, 5, 44): '"""noJet"""'}, {}), "('noJet')", True, 'import FWCore.ParameterSet.Config as cms\n'), ((8, 18, 8, 33), 'FWCore.ParameterSet.Config.bool', 'cms.bool', ({(8, 27, 8, 32): 'False'}, {}), '(False)', True, 'import FWCore.ParameterSet.... |
ines/spacy-js | tests/test_api.py | 5b7a86cb0d1099285e01252f7e1d44a36ad9a07f | # coding: utf8
from __future__ import unicode_literals
import pytest
import spacy
import json
from api.server import parse, doc2json, load_model
@pytest.fixture(scope="session")
def model():
return "en_core_web_sm"
@pytest.fixture(scope="session")
def text():
return "This is a sentence about Facebook. Thi... | [((11, 1, 11, 32), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((16, 1, 16, 32), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((21, 1, 21, 32), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((26, 1, 26, 32), 'pytest.fixture', 'pytest.fixture'... |
medubelko/gaffer | python/GafferArnold/ArnoldTextureBake.py | 12c5994c21dcfb8b13b5b86efbcecdcb29202b33 | ##########################################################################
#
# Copyright (c) 2018, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | [((599, 0, 599, 94), 'IECore.registerRunTimeTyped', 'IECore.registerRunTimeTyped', (), '', False, 'import IECore\n'), ((262, 2, 262, 48), 'GafferDispatch.TaskNode.__init__', 'GafferDispatch.TaskNode.__init__', ({(262, 36, 262, 40): 'self', (262, 42, 262, 46): 'name'}, {}), '(self, name)', False, 'import GafferDispatch\... |
valory-xyz/agents-aea | aea/protocols/generator/common.py | 8f38efa96041b0156ed1ae328178e395dbabf2fc | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | [((78, 27, 78, 65), 'os.path.join', 'os.path.join', ({(78, 40, 78, 51): 'CURRENT_DIR', (78, 53, 78, 64): '"""isort.cfg"""'}, {}), "(CURRENT_DIR, 'isort.cfg')", False, 'import os\n'), ((320, 10, 320, 33), 'shutil.which', 'shutil.which', ({(320, 23, 320, 32): 'programme'}, {}), '(programme)', False, 'import shutil\n'), (... |
vaibhav-ScaleDB/FogLAMP | tests/unit/python/foglamp/services/core/api/test_backup_restore.py | 445e7a588f5ec5fcae0360b49fdc4e4de0ea2ec8 | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import os
import asyncio
import json
from unittest.mock import MagicMock, patch
from collections import Counter
from aiohttp import web
import pytest
from foglamp.services.core import routes
from foglamp.services.core import ... | [((39, 1, 39, 30), 'pytest.allure.feature', 'pytest.allure.feature', ({(39, 23, 39, 29): '"""unit"""'}, {}), "('unit')", False, 'import pytest\n'), ((40, 1, 40, 37), 'pytest.allure.story', 'pytest.allure.story', ({(40, 21, 40, 26): '"""api"""', (40, 28, 40, 36): '"""backup"""'}, {}), "('api', 'backup')", False, 'import... |
thompson0012/PyEmits | pyemits/core/preprocessing/dimensional_reduction.py | 9cb6fbf27ca7e8952ed5aca26118055e04492c23 | """
Why need dimensional reduction
The following is the use of dimensionality reduction in the data set:
• As data dimensions continue to decrease, the space required for data storage will also decrease.
• Low-dimensional data helps reduce calculation/training time.
• Some algorithms tend to perform poorly on high-dim... | [((49, 13, 49, 36), 'sklearn.ensemble.RandomForestRegressor', 'RandomForestRegressor', ({}, {}), '()', False, 'from sklearn.ensemble import RandomForestRegressor\n'), ((58, 14, 58, 32), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ({}, {}), '()', False, 'from sklearn.linear_model import LinearRegression... |
pcse/gitlab_tools | sample_project/exam/exam.py | 2896b636b0f8955bdb5f2236e257cc5d3efd54d7 | """
These methods can be called inside WebCAT to determine which tests are loaded
for a given section/exam pair. This allows a common WebCAT submission site to
support different project tests
"""
def section():
# Instructor section (instructor to change before distribution)
#return 8527
#return 8528
r... | [] |
ramiror/clarinete | scrapy/clarinetear/spiders/pagina12.py | 4ebf37cf9f705e04e2aad15015be12c48fe25fd3 | from datetime import datetime
import scrapy
import lxml
from lxml.html.clean import Cleaner
import re
SOURCE = 'Página 12'
LANGUAGE = 'es'
cleaner = Cleaner(allow_tags=['p', 'br', 'b', 'a', 'strong', 'i', 'em'])
class Pagina12Spider(scrapy.Spider):
name = 'pagina12'
allowed_domains = ['www.pagina12.com.ar']
... | [((10, 10, 10, 72), 'lxml.html.clean.Cleaner', 'Cleaner', (), '', False, 'from lxml.html.clean import Cleaner\n'), ((54, 25, 54, 84), 're.match', 're.match', ({(54, 34, 54, 77): '"""^([0-9]{1,2}) de ([a-z]+) de ([0-9]{4})$"""', (54, 79, 54, 83): 'date'}, {}), "('^([0-9]{1,2}) de ([a-z]+) de ([0-9]{4})$', date)", False,... |
christyc14/fyp | svd.py | c63e719e383a84eb49ffa0c8bd901bfd4aef5864 | from calendar import c
from typing import Dict, List, Union
from zlib import DEF_BUF_SIZE
import json_lines
import numpy as np
import re
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.manifold import TSNE
from sklearn.preprocessing import StandardScaler
import pandas as pd
import json
from scipy.spa... | [((40, 10, 40, 31), 'sklearn.preprocessing.MultiLabelBinarizer', 'MultiLabelBinarizer', ({}, {}), '()', False, 'from sklearn.preprocessing import MultiLabelBinarizer\n'), ((43, 12, 43, 51), 'sklearn.manifold.TSNE', 'TSNE', (), '', False, 'from sklearn.manifold import TSNE\n'), ((90, 9, 90, 25), 'sklearn.preprocessing.S... |
rodgergr/pycom-micropython-sigfox | esp32/tools/flasher.py | 50a31befc40a39b1e4c3513f20da968792227b0e | #!/usr/bin/env python
#
# Copyright (c) 2018, Pycom Limited.
#
# This software is licensed under the GNU GPL version 3 or any
# later version, with permitted additional terms. For more information
# see the Pycom Licence v1.0 document supplied with this file, or
# available at https://www.pycom.io/opensource/licensing
... | [((46, 14, 46, 42), 'sqlite3.connect', 'sqlite3.connect', ({(46, 30, 46, 41): 'db_filename'}, {}), '(db_filename)', False, 'import sqlite3\n'), ((60, 14, 60, 89), 'subprocess.Popen', 'subprocess.Popen', (), '', False, 'import subprocess\n'), ((80, 14, 80, 89), 'subprocess.Popen', 'subprocess.Popen', (), '', False, 'imp... |
jyxzhang/hknweb | hknweb/events/tests/models/utils.py | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | import datetime
from django.utils import timezone
from django.contrib.auth.models import User
from hknweb.events.models import Event, EventType, Rsvp
class ModelFactory:
@staticmethod
def create_user(**kwargs):
default_kwargs = {
"username": "default username",
}
kwargs =... | [((16, 15, 16, 44), 'django.contrib.auth.models.User.objects.create', 'User.objects.create', ({}, {}), '(**kwargs)', False, 'from django.contrib.auth.models import User\n'), ((24, 15, 24, 49), 'hknweb.events.models.EventType.objects.create', 'EventType.objects.create', ({}, {}), '(**kwargs)', False, 'from hknweb.events... |
jimga150/HealthNet | HealthNet/prescriptions/views.py | 84e55302b02221ae6e93640904af837fdfe09a83 | from django.shortcuts import redirect
from .forms import PrescriptionForm
from core.views import is_doctor, is_nurse, is_admin, is_patient
from core.models import *
from .models import Prescription
from django.contrib.auth.decorators import login_required, user_passes_test
from django.utils import timezone
from dja... | [((33, 1, 33, 28), 'django.contrib.auth.decorators.user_passes_test', 'user_passes_test', ({(33, 18, 33, 27): 'is_doctor'}, {}), '(is_doctor)', False, 'from django.contrib.auth.decorators import login_required, user_passes_test\n'), ((84, 1, 84, 28), 'django.contrib.auth.decorators.user_passes_test', 'user_passes_test'... |
woozway/py3-leetcode | algorithms/329. Longest Increasing Path in a Matrix.py | e51a9ce7a6bb3e35c0fcb8c8f4f6cd5763708dbf | """
1. Clarification
2. Possible solutions
- dfs + memoization
- Topological sort
3. Coding
4. Tests
"""
# T=O(m*n), S=O(m*n)
from functools import lru_cache
class Solution:
DIRS = [(-1, 0), (1, 0), (0, -1), (0, 1)]
def longestIncreasingPath(self, matrix: List[List[int]]) -> int:
if not mat... | [((22, 9, 22, 24), 'functools.lru_cache', 'lru_cache', ({(22, 19, 22, 23): 'None'}, {}), '(None)', False, 'from functools import lru_cache\n')] |
NIKEA-SOFT/TestGame | cocos2d/tools/coding-style/tailing-spaces.py | 04f13e5f1324bca9f1e47f02037ea1eddd3bcc8f | #!/usr/bin/env python
#coding=utf-8
'''
Remove tailing whitespaces and ensures one and only one empty ending line.
'''
import os, re
def scan(*dirs, **kwargs):
files = []
extensions = kwargs['extensions'] if kwargs.has_key('extensions') else None
excludes = kwargs['excludes'] if kwargs.has_key('excludes') else... | [((15, 37, 15, 49), 'os.walk', 'os.walk', ({(15, 45, 15, 48): 'top'}, {}), '(top)', False, 'import os, re\n'), ((44, 4, 44, 31), 'os.path.join', 'os.path.join', ({(44, 17, 44, 21): 'root', (44, 23, 44, 30): '"""cocos"""'}, {}), "(root, 'cocos')", False, 'import os, re\n'), ((45, 4, 45, 36), 'os.path.join', 'os.path.joi... |
Michael-Pascale/three.py | three.py/TestPostprocessing-8Bit.py | 9912f5f850245fb9456a25b6737e12290ae54a2d | from core import *
from cameras import *
from geometry import *
from material import *
from lights import *
class TestPostprocessing2(Base):
def initialize(self):
self.setWindowTitle('Pixellation and Reduced Color Palette')
self.setWindowSize(1024,768)
self.renderer = Rendere... | [] |
tareqmalas/girih | scripts/test_cache_size_vs_code_balance.py | 0c126788937d189147be47115703b752235e585c | #!/usr/bin/env python
def igs_test(target_dir, exp_name, th, group='', dry_run=0):
from scripts.conf.conf import machine_conf, machine_info
from scripts.utils import run_test
import itertools
cs = 8192
th = th
# Test using rasonable time
# T = scale * size / perf
# scale = T*perf/size
desired_time... | [] |
flamencist/browser-extensions | generate/lib/run-firefox/firefox_runner.py | cc2424ce69c718f9f6b1fb0e6cd19759ba384591 | import os
import shutil
import codecs
import json
from cuddlefish.runner import run_app
from cuddlefish.rdf import RDFManifest
def run():
original_harness_options = os.path.join('development', 'firefox', 'harness-options.json')
backup_harness_options = os.path.join('development', 'firefox', 'harness-options-bak.jso... | [((10, 28, 10, 90), 'os.path.join', 'os.path.join', ({(10, 41, 10, 54): '"""development"""', (10, 56, 10, 65): '"""firefox"""', (10, 67, 10, 89): '"""harness-options.json"""'}, {}), "('development', 'firefox', 'harness-options.json')", False, 'import os\n'), ((11, 26, 11, 92), 'os.path.join', 'os.path.join', ({(11, 39,... |
gip/pyripple | pyripple/protocol/orderbook.py | d0c696bed7c6ad4c2309733484f9915074f9acdd | # PyRipple
#
# Copyright 2015 Gilles Pirio
#
# 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... | [] |
catb0y/twitter_feeling | myvenv/lib/python3.6/site-packages/nltk/test/unit/test_senna.py | 9092a26f2554bbf6b14b33d797abaffa48cda99c | # -*- coding: utf-8 -*-
"""
Unit tests for Senna
"""
from __future__ import unicode_literals
from os import environ, path, sep
import logging
import unittest
from nltk.classify import Senna
from nltk.tag import SennaTagger, SennaChunkTagger, SennaNERTagger
# Set Senna executable path for tests if it is not specifie... | [((21, 21, 21, 55), 'os.path.exists', 'path.exists', ({(21, 33, 21, 54): 'SENNA_EXECUTABLE_PATH'}, {}), '(SENNA_EXECUTABLE_PATH)', False, 'from os import environ, path, sep\n'), ((23, 1, 23, 69), 'unittest.skipUnless', 'unittest.skipUnless', ({(23, 21, 23, 39): 'senna_is_installed', (23, 41, 23, 68): '"""Requires Senna... |
kalxas/eoxserver | eoxserver/services/opensearch/v11/description.py | 8073447d926f3833923bde7b7061e8a1658dee06 | #-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Fabian Schindler <fabian.schindler@eox.at>
#
#-------------------------------------------------------------------------------
# Copyright (C) 2015 EOX IT Services GmbH
#
# Permission... | [((52, 16, 52, 71), 'eoxserver.core.util.xmltools.NameSpace', 'NameSpace', ({(52, 26, 52, 64): '"""http://a9.com/-/spec/opensearch/1.1/"""', (52, 66, 52, 70): 'None'}, {}), "('http://a9.com/-/spec/opensearch/1.1/', None)", False, 'from eoxserver.core.util.xmltools import XMLEncoder, NameSpace, NameSpaceMap\n'), ((53, 3... |
eliranM98/python_course | exercises/level_0/stringing.py | d9431dd6c0f27fca8ca052cc2a821ed0b883136c | text = '''
Victor Hugo's ({}) tale of injustice, heroism and love follows the fortunes of Jean Valjean, an escaped convict determined to put his criminal past behind him. But his attempts to become a respected member of the community are constantly put under threat: by his own conscience, when, owing to a case of mista... | [] |
Agyey/fsdl-text-recognizer-2021-labs | lab1/text_recognizer/models/mlp.py | 4bd85042ab9f6decd78849bb655c197cc13ffc11 | from typing import Any, Dict
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
FC1_DIM = 1024
FC2_DIM = 128
class MLP(nn.Module):
"""Simple MLP suitable for recognizing single characters."""
def __init__(
self,
data_config: Dict[str, Any],... | [((24, 20, 24, 54), 'numpy.prod', 'np.prod', ({(24, 28, 24, 53): "data_config['input_dims']"}, {}), "(data_config['input_dims'])", True, 'import numpy as np\n'), ((27, 23, 27, 38), 'torch.nn.Dropout', 'nn.Dropout', ({(27, 34, 27, 37): '0.5'}, {}), '(0.5)', True, 'import torch.nn as nn\n'), ((48, 12, 48, 31), 'torch.fla... |
AzoeDesarrollos/PyMavisDatabase | frontend/widgets/button.py | bfcd0557f63a4d8a73f0f8e891c47b47a1de1b45 | from pygame import Surface, font
from .basewidget import BaseWidget
from frontend import Renderer, WidgetHandler
class Button(BaseWidget):
action = None
def __init__(self, x, y, texto, action=None):
self.f = font.SysFont('Verdana', 16)
imagen = self.crear(texto)
rect = imagen.get_rect... | [((10, 17, 10, 44), 'pygame.font.SysFont', 'font.SysFont', ({(10, 30, 10, 39): '"""Verdana"""', (10, 41, 10, 43): '16'}, {}), "('Verdana', 16)", False, 'from pygame import Surface, font\n'), ((14, 8, 14, 36), 'frontend.Renderer.add_widget', 'Renderer.add_widget', ({(14, 28, 14, 32): 'self', (14, 34, 14, 35): '(1)'}, {}... |
naoki009/samples | tensorflow_rnn/mnist_lstm.py | dac3bbddbd06374c39768cbe17fefd0110fe316f | import numpy as np
import tensorflow as tf
"""
Do an MNIST classification line by line by LSTM
"""
(x_train, y_train), \
(x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train, x_test = x_train/255.0, x_test/255.0
model = tf.keras.Sequential()
model.add(tf.keras.layers.LSTM(128, input_shape=(None, 28)))
... | [((9, 23, 9, 58), 'tensorflow.keras.datasets.mnist.load_data', 'tf.keras.datasets.mnist.load_data', ({}, {}), '()', True, 'import tensorflow as tf\n'), ((12, 8, 12, 29), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', ({}, {}), '()', True, 'import tensorflow as tf\n'), ((13, 10, 13, 59), 'tensorflow.keras.layers.... |
cseale/kaggle-amazon-rainforests | scrap/CloudCoverUndersampling.py | cf42941bb3c70ba19257764b66fe33550be88e0b |
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import os
from random import shuffle
from tqdm import tqdm
DATA_DIR = '../input/amazon/'
TRAIN_TIF_DIR = DATA_DIR + 'train-tif/'
TRAIN_CSV = DATA_DIR + 'train.csv'
TEST_TIF_DIR = DATA_DIR + 'test-tif/'
IMG_SIZE = 100
LR = 1e-3
MODEL_NAME = 'amazon=-{... | [((29, 12, 29, 34), 'pandas.read_csv', 'pd.read_csv', ({(29, 24, 29, 33): 'TRAIN_CSV'}, {}), '(TRAIN_CSV)', True, 'import pandas as pd\n'), ((32, 7, 32, 21), 'pandas.DataFrame', 'pd.DataFrame', ({}, {}), '()', True, 'import pandas as pd\n'), ((37, 12, 37, 48), 'pandas.concat', 'pd.concat', (), '', True, 'import pandas ... |
wdv4758h/mu-client-pypy | rpython/translator/platform/posix.py | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | """Base support for POSIX-like platforms."""
import py, os, sys
from rpython.translator.platform import Platform, log, _run_subprocess
import rpython
rpydir = str(py.path.local(rpython.__file__).join('..'))
class BasePosix(Platform):
exe_ext = ''
make_cmd = 'make'
relevant_environ = ('CPATH', 'LIBRARY_... | [] |
GINK03/itmedia-scraping | chintai-scrape/A001_parse_htmls.py | 5afbe06dd0aa12db1694a2b387aa2eeafb20e981 | import glob
import bs4
import gzip
import pickle
import re
import os
from concurrent.futures import ProcessPoolExecutor as PPE
import json
from pathlib import Path
from hashlib import sha256
import shutil
Path('json').mkdir(exist_ok=True)
def sanitize(text):
text = re.sub(r'(\t|\n|\r)', '', text)
text = re.s... | [((78, 8, 78, 30), 'glob.glob', 'glob.glob', ({(78, 18, 78, 29): '"""./htmls/*"""'}, {}), "('./htmls/*')", False, 'import glob\n'), ((79, 0, 79, 21), 'random.shuffle', 'random.shuffle', ({(79, 15, 79, 20): 'files'}, {}), '(files)', False, 'import random\n'), ((16, 11, 16, 42), 're.sub', 're.sub', ({(16, 18, 16, 31): '"... |
ricardolsmendes/datacatalog-connectors-hive | google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/scrape/metadata_scraper.py | 9e71588133c0b0227e789c8d6bb26cfa031d2cfb | #!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [((25, 36, 26, 46), 'google.datacatalog_connectors.apache_atlas.scrape.apache_atlas_facade.ApacheAtlasFacade', 'scrape.apache_atlas_facade.ApacheAtlasFacade', ({(26, 30, 26, 45): 'connection_args'}, {}), '(connection_args)', False, 'from google.datacatalog_connectors.apache_atlas import scrape\n'), ((27, 35, 28, 55), '... |
sxie22/aviary | aviary/roost/data.py | 74b87eee86067f69af6e5b86bd12fca2202c4de5 | import functools
import json
from os.path import abspath, dirname, exists, join
from typing import Dict, Sequence
import numpy as np
import pandas as pd
import torch
from pymatgen.core import Composition
from torch.utils.data import Dataset
class CompositionData(Dataset):
def __init__(
self,
df: ... | [((67, 5, 67, 38), 'functools.lru_cache', 'functools.lru_cache', (), '', False, 'import functools\n'), ((122, 23, 122, 44), 'torch.Tensor', 'torch.Tensor', ({(122, 36, 122, 43): 'weights'}, {}), '(weights)', False, 'import torch\n'), ((123, 19, 123, 41), 'torch.Tensor', 'torch.Tensor', ({(123, 32, 123, 40): 'atom_fea'}... |
danqing/dqpy | tests/test_util.py | f296341adb0dbbfb361eaf8b815b0ffd189ebf58 | import unittest
from dq import util
class TestUtil(unittest.TestCase):
def test_safe_cast(self):
assert util.safe_cast('1', int) == 1
assert util.safe_cast('meow', int, 2) == 2
| [((9, 15, 9, 39), 'dq.util.safe_cast', 'util.safe_cast', ({(9, 30, 9, 33): '"""1"""', (9, 35, 9, 38): 'int'}, {}), "('1', int)", False, 'from dq import util\n'), ((10, 15, 10, 45), 'dq.util.safe_cast', 'util.safe_cast', ({(10, 30, 10, 36): '"""meow"""', (10, 38, 10, 41): 'int', (10, 43, 10, 44): '(2)'}, {}), "('meow', ... |
codecakes/random_games | check_perm.py | 1e670021ec97a196726e937e658878dc63ba9d34 | """
PermCheck
Check whether array A is a permutation.
https://codility.com/demo/results/demoANZ7M2-GFU/
Task description
A non-empty zero-indexed array A consisting of N integers is given.
A permutation is a sequence containing each element from 1 to N once, and only once.
For example, array A such that:
A[0] = 4... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.