repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 840k |
|---|---|---|---|---|
anirudhbhashyam/911-Calls-Seattle-Predictions | src/train_nn.py | 8c975ab6c6a85d514ad74388778e1b635ed3e63d | import os
from typing import Union
import tensorflow as tf
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split, KFold
import utility as ut
from variables import *
# Read the data.
train_data = pd.read_csv(os.path.join(DATA_PATH, ".".join([DATA... | [((21, 17, 21, 36), 'numpy.ones', 'np.ones', ({(21, 25, 21, 35): 'Y.shape[0]'}, {}), '(Y.shape[0])', True, 'import numpy as np\n'), ((37, 33, 37, 101), 'sklearn.model_selection.train_test_split', 'train_test_split', (), '', False, 'from sklearn.model_selection import train_test_split, KFold\n'), ((117, 18, 121, 31), 't... |
Gustavo6046/polydung | pdserver/objects.py | e8626c67b0f59e00a2400b5a5c644e3f6b925e00 | import base64
import random
import string
import netbyte
import numpy as np
try:
import simplejson as json
except ImportError:
import json
kinds = {}
class PDObject(object):
def __init__(self, game, kind, id, pos, properties):
self.game = game
self.kind = kind
self.id = ... | [((21, 19, 21, 32), 'numpy.array', 'np.array', ({(21, 28, 21, 31): 'pos'}, {}), '(pos)', True, 'import numpy as np\n'), ((34, 14, 34, 31), 'netbyte.Netbyte', 'netbyte.Netbyte', ({}, {}), '()', False, 'import netbyte\n'), ((56, 15, 56, 29), 'json.loads', 'json.loads', ({(56, 26, 56, 28): 'js'}, {}), '(js)', False, 'impo... |
EEdwardsA/DS-OOP-Review | football/football_test.py | 2352866c5d0ea6a09802c29c17366450f35c75ae | import unittest
from players import Player, Quarterback
from possible_values import *
from game import Game
from random import randint, uniform, sample
from season import *
# TODO - some things you can add...
class FootballGameTest(unittest.TestCase):
'''test the class'''
def test_field_goal_made(self):
... | [((65, 4, 65, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((14, 16, 14, 39), 'random.sample', 'sample', (), '', False, 'from random import randint, uniform, sample\n'), ((15, 15, 15, 32), 'game.Game', 'Game', (), '', False, 'from game import Game\n'), ((23, 16, 23, 39), 'random.s... |
shayanthrn/AGAIN-VC | preprocessor/base.py | 41934f710d117d524b4a0bfdee7e9b845a56d422 | import os
import logging
import numpy as np
from tqdm import tqdm
from functools import partial
from multiprocessing.pool import ThreadPool
import pyworld as pw
from util.dsp import Dsp
logger = logging.getLogger(__name__)
def preprocess_one(input_items, module, output_path=''):
input_path, basename = input_item... | [((11, 9, 11, 36), 'logging.getLogger', 'logging.getLogger', ({(11, 27, 11, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((48, 37, 48, 59), 'util.dsp.Dsp', 'Dsp', ({(48, 41, 48, 58): 'config.feat[feat]'}, {}), '(config.feat[feat])', False, 'from util.dsp import Dsp\n'), ((58, 20, 58, 51), 'os.path.j... |
fjruizruano/SatIntExt | divsum_stats.py | 90b39971ee6ea3d7cfa63fbb906df3df714a5012 | #!/usr/bin/python
import sys
from subprocess import call
print "divsum_count.py ListOfDivsumFiles\n"
try:
files = sys.argv[1]
except:
files = raw_input("Introduce RepeatMasker's list of Divsum files with library size (tab separated): ")
files = open(files).readlines()
to_join = []
header = "Coverage for ea... | [] |
onyxfish/fever | agatecharts/charts/__init__.py | 8aef0cd4adff7fdde1f5950ffb1d01db9137e3b7 | #!/usr/bin/env python
from agatecharts.charts.bars import Bars
from agatecharts.charts.columns import Columns
from agatecharts.charts.lines import Lines
from agatecharts.charts.scatter import Scatter
| [] |
rossm6/accounts | users/views.py | 74633ce4038806222048d85ef9dfe97a957a6a71 | from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.contrib.auth.views import (LoginView, PasswordResetConfirmView,
PasswordResetView)
from django.http import Htt... | [((21, 18, 21, 53), 'django.urls.reverse_lazy', 'reverse_lazy', ({(21, 31, 21, 52): '"""dashboard:dashboard"""'}, {}), "('dashboard:dashboard')", False, 'from django.urls import reverse_lazy\n'), ((32, 18, 32, 47), 'django.urls.reverse_lazy', 'reverse_lazy', ({(32, 31, 32, 46): '"""users:profile"""'}, {}), "('users:pro... |
adidas/m3d-api | test/core/s3_table_test_base.py | 755d676452e4b10075fa65f9acfdbf30a6ee828e | import os
from test.core.emr_system_unit_test_base import EMRSystemUnitTestBase
from test.core.tconx_helper import TconxHelper
class S3TableTestBase(EMRSystemUnitTestBase):
default_tconx = \
"test/resources/s3_table_test_base/tconx-bdp-emr_test-dev-bi_test101.json"
multi_partition_tconx = \
... | [((52, 21, 59, 9), 'test.core.tconx_helper.TconxHelper.setup_tconx_from_file', 'TconxHelper.setup_tconx_from_file', ({(53, 12, 53, 45): "m3d_config_dict['tags']['config']", (54, 12, 54, 30): 'destination_system', (55, 12, 55, 32): 'destination_database', (56, 12, 56, 35): 'destination_environment', (57, 12, 57, 29): 'd... |
BrianWaganerSTL/RocketDBaaS | metrics/serializers.py | d924589188411371842513060a5e08b1be3cdccf | from rest_framework import serializers
from metrics.models import Metrics_Cpu, Metrics_PingServer, Metrics_MountPoint, \
Metrics_CpuLoad, Metrics_PingDb
class Metrics_CpuSerializer(serializers.ModelSerializer):
class Meta:
model = Metrics_Cpu
fields = '__all__'
depth = 0
class Metrics... | [] |
dmayle/rules_sqlc | sqlc/private/sqlc_toolchain.bzl | c465542827a086994e9427e2c792bbc4355c3e70 | # Copyright 2020 Plezentek, Inc. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [] |
nolanzzz/mtmct | configs/tracker_configs/new_test_20e_cam_1_new_short.py | 8bbbc7ff2fa53ab8af424feaac3cf7424b87fff0 | root = {
"general" : {
"display_viewer" : False,
#The visible GPUS will be restricted to the numbers listed here. The pytorch (cuda:0) numeration will start at 0
#This is a trick to get everything onto the wanted gpus because just setting cuda:4 in the function calls will
#not work... | [] |
cherub96/voc | tests/structures/test_generator.py | 2692d56059e4d4a52768270feaf5179b23609b04 | from ..utils import TranspileTestCase
class GeneratorTests(TranspileTestCase):
def test_simple_generator(self):
self.assertCodeExecution("""
def multiplier(first, second):
y = first * second
yield y
y *= second
yield y
... | [] |
hdoupe/OG-USA | ogusa/tax.py | f7e4d600b7a2993c7d1b53e23bfe29cfccaea770 | '''
------------------------------------------------------------------------
Functions for taxes in the steady state and along the transition path.
------------------------------------------------------------------------
'''
# Packages
import numpy as np
from ogusa import utils
'''
-----------------------------------... | [((51, 10, 51, 24), 'numpy.zeros', 'np.zeros', ({(51, 19, 51, 23): 'dim2'}, {}), '(dim2)', True, 'import numpy as np\n'), ((461, 14, 461, 30), 'numpy.zeros_like', 'np.zeros_like', ({(461, 28, 461, 29): 'n'}, {}), '(n)', True, 'import numpy as np\n'), ((142, 15, 142, 45), 'numpy.squeeze', 'np.squeeze', ({(142, 26, 142, ... |
baireutherjonas/muse-for-anything | muse_for_anything/api/v1_api/taxonomy_items.py | a625b4fc6468d74fa12886dc465d5694eed86e04 | """Module containing the taxonomy items API endpoints of the v1 API."""
from datetime import datetime
from sqlalchemy.sql.schema import Sequence
from muse_for_anything.db.models.taxonomies import (
Taxonomy,
TaxonomyItem,
TaxonomyItemRelation,
TaxonomyItemVersion,
)
from marshmallow.utils import INCL... | [((550, 19, 553, 9), 'muse_for_anything.db.models.taxonomies.TaxonomyItemRelation', 'TaxonomyItemRelation', (), '', False, 'from muse_for_anything.db.models.taxonomies import Taxonomy, TaxonomyItem, TaxonomyItemRelation, TaxonomyItemVersion\n'), ((357, 32, 357, 49), 'datetime.datetime.utcnow', 'datetime.utcnow', ({}, {... |
shijiale0609/Python_Data_Analysis | PythonDAdata/3358OS_06_Code/code6/pd_plotting.py | c18b5ed006c171bbb6fcb6be5f51b2686edc8f7e | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
df = pd.read_csv('transcount.csv')
df = df.groupby('year').aggregate(np.mean)
gpu = pd.read_csv('gpu_transcount.csv')
gpu = gpu.groupby('year').aggregate(np.mean)
df = pd.merge(df, gpu, how='outer', left_index=True, right_index=True)
df = df.rep... | [((6, 5, 6, 34), 'pandas.read_csv', 'pd.read_csv', ({(6, 17, 6, 33): '"""transcount.csv"""'}, {}), "('transcount.csv')", True, 'import pandas as pd\n'), ((9, 6, 9, 39), 'pandas.read_csv', 'pd.read_csv', ({(9, 18, 9, 38): '"""gpu_transcount.csv"""'}, {}), "('gpu_transcount.csv')", True, 'import pandas as pd\n'), ((12, 5... |
JakubGutowski/PersonalBlog | source/blog/migrations/0004_postcomments.py | 96122b36486f7e874c013e50d939732a43db309f | # Generated by Django 2.0.5 on 2018-07-02 19:46
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_blogpost_author'),
]
operations = [
migrations.CreateModel(
name='Po... | [((17, 23, 17, 112), 'django.db.models.AutoField', 'models.AutoField', (), '', False, 'from django.db import migrations, models\n'), ((18, 25, 18, 56), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import migrations, models\n'), ((19, 28, 19, 60), 'django.db.models.CharField', 'models... |
m-star18/atcoder | submissions/aising2019/a.py | 08e475810516602fa088f87daf1eba590b4e07cc | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
n = int(readline())
h = int(readline())
w = int(readline())
print((n - h + 1) * (n - w + 1))
| [((5, 0, 5, 30), 'sys.setrecursionlimit', 'sys.setrecursionlimit', ({(5, 22, 5, 29): '(10 ** 7)'}, {}), '(10 ** 7)', False, 'import sys\n')] |
yoyoberenguer/MultiplayerGameEngine | CreateHalo.py | 1d1a4c0ab40d636322c4e3299cbc84fb57965b31 |
import pygame
from NetworkBroadcast import Broadcast, AnimatedSprite, DeleteSpriteCommand
from Textures import HALO_SPRITE12, HALO_SPRITE14, HALO_SPRITE13
__author__ = "Yoann Berenguer"
__credits__ = ["Yoann Berenguer"]
__version__ = "1.0.0"
__maintainer__ = "Yoann Berenguer"
__email__ = "yoyoberenguer@hotma... | [((22, 8, 22, 60), 'pygame.sprite.Sprite.__init__', 'pygame.sprite.Sprite.__init__', ({(22, 38, 22, 42): 'self', (22, 44, 22, 59): 'self.containers'}, {}), '(self, self.containers)', False, 'import pygame\n'), ((47, 15, 49, 48), 'NetworkBroadcast.AnimatedSprite', 'AnimatedSprite', (), '', False, 'from NetworkBroadcast ... |
ShizhuZhang/ontask_b | src/dataops/pandas_db.py | acbf05ff9b18dae0a41c67d1e41774e54a890c40 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import logging
import os.path
import subprocess
from collections import OrderedDict
from itertools import izip
import numpy as np
import pandas as pd
from django.conf import settings
from django.core.cache import cache
from django.db impo... | [((29, 9, 29, 36), 'logging.getLogger', 'logging.getLogger', ({(29, 27, 29, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((77, 11, 77, 71), 'sqlalchemy.create_engine', 'create_engine', (), '', False, 'from sqlalchemy import create_engine\n'), ((131, 14, 136, 42), 'subprocess.Popen', 'subprocess.Pope... |
rbsdev/config-client | config/cf.py | 761f39cd8839daba10bf21b98ccdd44d33eaebe8 | from typing import Any, Dict, KeysView
import attr
from config.auth import OAuth2
from config.cfenv import CFenv
from config.spring import ConfigClient
@attr.s(slots=True)
class CF:
cfenv = attr.ib(
type=CFenv, factory=CFenv, validator=attr.validators.instance_of(CFenv),
)
oauth2 = attr.ib(type=... | [((10, 1, 10, 19), 'attr.s', 'attr.s', (), '', False, 'import attr\n'), ((15, 13, 15, 47), 'attr.ib', 'attr.ib', (), '', False, 'import attr\n'), ((16, 13, 16, 53), 'attr.ib', 'attr.ib', (), '', False, 'import attr\n'), ((13, 45, 13, 79), 'attr.validators.instance_of', 'attr.validators.instance_of', ({(13, 73, 13, 78):... |
rancp/ducktape-docs | ducktape/template.py | e1a3b1b7e68beedf5f8d29a4e5f196912a20e264 | # Copyright 2015 Confluent 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, s... | [((32, 55, 32, 73), 'jinja2.Template', 'Template', ({(32, 64, 32, 72): 'template'}, {}), '(template)', False, 'from jinja2 import Template, FileSystemLoader, PackageLoader, ChoiceLoader, Environment\n'), ((78, 15, 78, 44), 'ducktape.utils.util.package_is_installed', 'package_is_installed', ({(78, 36, 78, 43): 'package'... |
AkshayManchanda/Python_Training | day4/homework/q7.py | 5a50472d118ac6d40145bf1dd60f26864bf9fb6c | i=input("Enter a string: ")
list = i.split()
list.sort()
for i in list:
print(i,end=' ')
| [] |
staticdev/github-portfolio | src/git_portfolio/use_cases/config_repos.py | 850461eed8160e046ee16664ac3dbc19e3ec0965 | """Config repositories use case."""
from __future__ import annotations
import git_portfolio.config_manager as cm
import git_portfolio.domain.gh_connection_settings as cs
import git_portfolio.responses as res
class ConfigReposUseCase:
"""Gitp config repositories use case."""
def __init__(self, config_manager... | [((24, 15, 24, 80), 'git_portfolio.responses.ResponseSuccess', 'res.ResponseSuccess', ({(24, 35, 24, 79): '"""gitp repositories successfully configured."""'}, {}), "('gitp repositories successfully configured.')", True, 'import git_portfolio.responses as res\n')] |
mateuszkowalke/sudoku_game | test/test_logic.py | 800e33a6fe755b493d8e9c3c9a20204af5865148 | import pytest
from ..logic import Board, empty_board, example_board, solved_board
class TestBoard:
def test_create_board(self):
board = Board(example_board)
assert board.tiles == example_board
def test_solve_board(self):
board = Board(example_board)
board.solve()
asse... | [] |
jf---/compas | src/compas_rhino/objects/_select.py | cd878ece933013b8ac34e9d42cf6d5c62a5396ee | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import ast
import rhinoscriptsyntax as rs
__all__ = [
'mesh_select_vertex',
'mesh_select_vertices',
'mesh_select_face',
'mesh_select_faces',
'mesh_select_edge',
'mesh_select_edges',
... | [((35, 11, 35, 92), 'rhinoscriptsyntax.GetObject', 'rs.GetObject', (), '', True, 'import rhinoscriptsyntax as rs\n'), ((59, 12, 59, 94), 'rhinoscriptsyntax.GetObjects', 'rs.GetObjects', (), '', True, 'import rhinoscriptsyntax as rs\n'), ((86, 11, 86, 91), 'rhinoscriptsyntax.GetObject', 'rs.GetObject', (), '', True, 'im... |
MuchkoM/CalorieMatchBot | handlers/product_add.py | ca26a1f6195079e10dd798ca9e77968438f2aa01 | from telegram import Update
from telegram.ext import Updater, CallbackContext, ConversationHandler, CommandHandler, MessageHandler, Filters
from db import DBConnector
import re
str_matcher = r"\"(?P<name>.+)\"\s*(?P<fat>\d+)\s*/\s*(?P<protein>\d+)\s*/\s*(?P<carbohydrates>\d+)\s*(?P<kcal>\d+)"
ADD_1 = 0
def add_0(... | [((21, 13, 21, 55), 're.match', 're.match', ({(21, 22, 21, 33): 'str_matcher', (21, 35, 21, 54): 'update.message.text'}, {}), '(str_matcher, update.message.text)', False, 'import re\n'), ((33, 22, 33, 58), 'telegram.ext.CommandHandler', 'CommandHandler', ({(33, 37, 33, 50): '"""product_add"""', (33, 52, 33, 57): 'add_0... |
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/nolearn-0.5/build/lib.linux-x86_64-2.7/nolearn/tests/test_dataset.py | ee45bee6f96cdb6d91184abc16f41bba1546c943 | from mock import patch
import numpy as np
def test_dataset_simple():
from ..dataset import Dataset
data = object()
target = object()
dataset = Dataset(data, target)
assert dataset.data is data
assert dataset.target is target
@patch('nolearn.dataset.np.load')
def test_dataset_with_filenames(... | [((15, 1, 15, 33), 'mock.patch', 'patch', ({(15, 7, 15, 32): '"""nolearn.dataset.np.load"""'}, {}), "('nolearn.dataset.np.load')", False, 'from mock import patch\n'), ((29, 11, 29, 25), 'numpy.arange', 'np.arange', ({(29, 21, 29, 24): '100'}, {}), '(100)', True, 'import numpy as np\n'), ((30, 13, 30, 42), 'numpy.array'... |
EpicTofuu/Assignment | src/Cipher/MultiLevelCaesarDecrypt.py | 293f99d20e8fa7d688c16a56c48a554bcd3c9e7d | import Cipher.tk
from Cipher.tk import EncryptDecryptCoord, GetChiSquared, Mode
def MultiDecrypt (message, alphabet, usables = 3, lan = "English", transformations = [], lowestchi = 9999, ogMessage = ""):
msg = ""
prev = (9999, (0, 0)) # (chi, key)
for i in range (len(message)):
... | [((29, 25, 29, 87), 'Cipher.tk.EncryptDecryptCoord', 'EncryptDecryptCoord', ({(29, 46, 29, 53): 'message', (29, 55, 29, 62): 'prev[1]', (29, 64, 29, 72): 'alphabet', (29, 74, 29, 86): 'Mode.DECRYPT'}, {}), '(message, prev[1], alphabet, Mode.DECRYPT)', False, 'from Cipher.tk import EncryptDecryptCoord, GetChiSquared, Mo... |
bunop/cyvcf | scripts/vcf_filter.py | f58860dd06b215b9d9ae80e2b46337fb6ab59139 | #!/usr/bin/env python
import sys
import argparse
import pkg_resources
import vcf
from vcf.parser import _Filter
parser = argparse.ArgumentParser(description='Filter a VCF file',
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument('input', metavar='input', type=str, nargs=1,
... | [((9, 9, 11, 9), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((36, 13, 36, 59), 'pkg_resources.iter_entry_points', 'pkg_resources.iter_entry_points', ({(36, 45, 36, 58): '"""vcf.filters"""'}, {}), "('vcf.filters')", False, 'import pkg_resources\n'), ((56, 10, 56, 38), 'vcf... |
Muxelmann/home-projects | src/flocker/blueprints/red/__init__.py | 85bd06873174b9c5c6276160988c19b460370db8 | import os
from flask import Blueprint, render_template
def create_bp():
bp_red = Blueprint('red', __name__, url_prefix='/red')
@bp_red.route('/index/')
@bp_red.route('/')
def index():
return render_template('red/index.html')
return bp_red | [((5, 13, 5, 58), 'flask.Blueprint', 'Blueprint', (), '', False, 'from flask import Blueprint, render_template\n'), ((10, 15, 10, 48), 'flask.render_template', 'render_template', ({(10, 31, 10, 47): '"""red/index.html"""'}, {}), "('red/index.html')", False, 'from flask import Blueprint, render_template\n')] |
whoiscc/alphacoders | alphacoders/__init__.py | 685d1e7e02a7276ae0518114b0c6aab58914aab7 | #
from aiohttp.client_exceptions import ClientError
from lxml import html
from pathlib import Path
from asyncio import create_task
from functools import wraps
def start_immediately(task):
@wraps(task)
def wrapper(*args, **kwargs):
return create_task(task(*args, **kwargs))
return wrapper
@start... | [((11, 5, 11, 16), 'functools.wraps', 'wraps', ({(11, 11, 11, 15): 'task'}, {}), '(task)', False, 'from functools import wraps\n'), ((79, 15, 79, 38), 'lxml.html.fromstring', 'html.fromstring', ({(79, 31, 79, 37): 'detail'}, {}), '(detail)', False, 'from lxml import html\n'), ((62, 19, 62, 42), 'lxml.html.fromstring', ... |
PeriscopeData/analytics-toolbox | Python/Calculating_Trimmed_Means/calculating_trimmed_means1.py | 83effdee380c33e5eecea29528acf5375fd496fb | # SQL output is imported as a pandas dataframe variable called "df"
# Source: https://stackoverflow.com/questions/19441730/trimmed-mean-with-percentage-limit-in-python
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import tmean, scoreatpercentile
import numpy as np
def trimmean(arr, percent):
... | [((10, 18, 10, 49), 'scipy.stats.scoreatpercentile', 'scoreatpercentile', ({(10, 36, 10, 39): 'arr', (10, 41, 10, 48): 'percent'}, {}), '(arr, percent)', False, 'from scipy.stats import tmean, scoreatpercentile\n'), ((11, 18, 11, 53), 'scipy.stats.scoreatpercentile', 'scoreatpercentile', ({(11, 36, 11, 39): 'arr', (11,... |
amichalski2/WBC-SHAP | scripts/data_extract.py | b69a4a8746aaf7a8dfacfdb4dbd85b4868d73ad0 | import os
import cv2
import random
import numpy as np
from tensorflow.keras.utils import to_categorical
from scripts.consts import class_dict
def get_data(path, split=0.2):
X, y = [], []
for directory in os.listdir(path):
dirpath = os.path.join(path, directory)
print(directory, len(os.listd... | [((13, 21, 13, 37), 'os.listdir', 'os.listdir', ({(13, 32, 13, 36): 'path'}, {}), '(path)', False, 'import os\n'), ((31, 4, 31, 24), 'random.shuffle', 'random.shuffle', ({(31, 19, 31, 23): 'data'}, {}), '(data)', False, 'import random\n'), ((15, 18, 15, 47), 'os.path.join', 'os.path.join', ({(15, 31, 15, 35): 'path', (... |
tzumainn/ironic | ironic/tests/unit/drivers/test_base.py | 91680bd450a4b2259d153b6a995a9436a5f82694 | # Copyright 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | [((32, 5, 32, 35), 'ironic.drivers.base.passthru', 'driver_base.passthru', ({(32, 26, 32, 34): "['POST']"}, {}), "(['POST'])", True, 'from ironic.drivers import base as driver_base\n'), ((36, 5, 36, 42), 'ironic.drivers.base.driver_passthru', 'driver_base.driver_passthru', ({(36, 33, 36, 41): "['POST']"}, {}), "(['POST... |
valerymelou/opentimesheet-server | opentimesheet/profiles/tests/test_models.py | 0da97ebb3c3e59962132d1bc5e83e1d727f7331b | import pytest
from opentimesheet.core.tests import TenantTestCase
@pytest.mark.usefixtures("profile")
class TestProfile(TenantTestCase):
def test__str__(self):
assert (
self.profile.first_name + " " + self.profile.last_name
== self.profile.__str__()
)
| [((6, 1, 6, 35), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', ({(6, 25, 6, 34): '"""profile"""'}, {}), "('profile')", False, 'import pytest\n')] |
chuckie82/ami | ami/flowchart/library/Display.py | 7adb72c709afe4c1af53ef7f0d2b0e3639c63bf3 | from ami.flowchart.library.DisplayWidgets import ScalarWidget, ScatterWidget, WaveformWidget, \
ImageWidget, ObjectWidget, LineWidget, TimeWidget, HistogramWidget, \
Histogram2DWidget
from ami.flowchart.library.common import CtrlNode
from amitypes import Array1d, Array2d
from typing import Any
import ami.graph_... | [] |
ShujaKhalid/deep-rl | deep-rl/lib/python2.7/site-packages/OpenGL/GL/ARB/transform_feedback_instanced.py | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | '''OpenGL extension ARB.transform_feedback_instanced
This module customises the behaviour of the
OpenGL.raw.GL.ARB.transform_feedback_instanced to provide a more
Python-friendly API
Overview (from the spec)
Multiple instances of geometry may be specified to the GL by calling
functions such as DrawArraysInstance... | [((33, 11, 33, 55), 'OpenGL.extensions.hasGLExtension', 'extensions.hasGLExtension', ({(33, 38, 33, 53): '_EXTENSION_NAME'}, {}), '(_EXTENSION_NAME)', False, 'from OpenGL import extensions\n')] |
xbabka01/retdec-regression-tests | features/cpp/simple/test.py | 1ac40cca5165740364e6f7fb72b20820eac9bc7c | from regression_tests import *
class TestBase(Test):
def test_for_main(self):
assert self.out_c.has_funcs('main') or self.out_c.has_funcs('entry_point')
def test_check_main_is_not_ctor_or_dtor(self):
for c in self.out_config.classes:
assert "main" not in c.constructors
... | [] |
windar427/find_alpha | src/experiment.py | dbca4e677c6cdc144f20f6259c07291b5d3e6eed | from .lib.DownloadData import DownloadData
| [] |
songchenwen/icloud-drive-docker | src/__init__.py | 7188dfbcc34e29ddbeeb1324c62ea77bed8f0576 | __author__ = 'Mandar Patil (mandarons@pm.me)'
import warnings
warnings.filterwarnings('ignore', category=DeprecationWarning)
| [((5, 0, 5, 62), 'warnings.filterwarnings', 'warnings.filterwarnings', (), '', False, 'import warnings\n')] |
rafael-torraca/delivery | test_basico.py | 298db3c5d74938dc34687e7b65ee72a847e4deeb |
def test_one_plus_one_is_two():
assert 1 + 1 == 2 #o assert espera que algo seja verdadeiro, se for falso o teste quebrou
def test_negative_1_plus_1_is_3():
assert 1 + 1 == 3
| [] |
rohernandezz/coldtype | setup.py | 724234fce454699a469d17b6c78ae50fa8138169 | import setuptools
long_description = """
# Coldtype
### Programmatic display typography
More info available at: [coldtype.goodhertz.com](https://coldtype.goodhertz.com)
"""
setuptools.setup(
name="coldtype",
version="0.6.6",
author="Rob Stenson / Goodhertz",
author_email="rob@goodhertz.com",
des... | [((11, 0, 124, 1), 'setuptools.setup', 'setuptools.setup', (), '', False, 'import setuptools\n')] |
xdedss/SuccessiveConvexification | GFOLD_problem.py | 8b330b64a31f546ce92c1e34036c212484cbae5e | # -*- coding: utf-8 -*-
# GFOLD_static_p3p4
min_=min
from cvxpy import *
import cvxpy_codegen as cpg
from time import time
import numpy as np
import sys
import GFOLD_params
''' As defined in the paper...
PROBLEM 3: Minimum Landing Error (tf roughly solved)
MINIMIZE : norm of landing error vector
SUBJ TO :
... | [((39, 23, 39, 49), 'GFOLD_params.SuperParams', 'GFOLD_params.SuperParams', ({}, {}), '()', False, 'import GFOLD_params\n'), ((132, 8, 132, 42), 'cvxpy_codegen.codegen', 'cpg.codegen', ({(132, 20, 132, 27): 'problem', (132, 29, 132, 41): 'codegen_path'}, {}), '(problem, codegen_path)', True, 'import cvxpy_codegen as cp... |
SarienFates/MMRandomizer | Hints.py | 7c677140d83e94167fecee35e8c25216a51bdd56 | import io
import hashlib
import logging
import os
import struct
import random
from HintList import getHint, getHintGroup, Hint
from Utils import local_path
#builds out general hints based on location and whether an item is required or not
def buildGossipHints(world, rom):
stoneAddresses = [0x938e4c, 0... | [((19, 22, 19, 52), 'HintList.getHintGroup', 'getHintGroup', ({(19, 35, 19, 51): '"""alwaysLocation"""'}, {}), "('alwaysLocation')", False, 'from HintList import getHint, getHintGroup, Hint\n'), ((22, 25, 22, 49), 'HintList.getHintGroup', 'getHintGroup', ({(22, 38, 22, 48): '"""location"""'}, {}), "('location')", False... |
Jhoselyn-Carballo/computacion_para_ingenieria | examen_2/p2/p2.py | 4b5ed7d4aa0017fb4993ccfdcc9fcef0fb5b3898 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 17 09:10:05 2022
@author: JHOSS
"""
from tkinter import *
def contador(accion, contador):
if accion == 'countUp':
contador == contador + 1
elif accion == 'coundDown':
contador == contador -1
elif accion == 'reset':
contador == 0
return contador
| [] |
ndepal/bokeh | bokeh/models/tests/test_callbacks.py | 1b514f28fe40eeb71954eac0c113b2debdb2eda9 | from pytest import raises
from bokeh.models import CustomJS, Slider
def test_js_callback():
slider = Slider()
cb = CustomJS(code="foo();", args=dict(x=slider))
assert 'foo()' in cb.code
assert cb.args['x'] is slider
cb = CustomJS(code="foo();", args=dict(x=3))
assert 'foo()' in cb.code
a... | [((6, 13, 6, 21), 'bokeh.models.Slider', 'Slider', ({}, {}), '()', False, 'from bokeh.models import CustomJS, Slider\n'), ((21, 13, 21, 21), 'bokeh.models.Slider', 'Slider', ({}, {}), '()', False, 'from bokeh.models import CustomJS, Slider\n'), ((26, 9, 26, 34), 'bokeh.models.CustomJS.from_py_func', 'CustomJS.from_py_f... |
martindurant/awkward-1.0 | tests/test_0150-attributeerrors.py | a3221ee1bab6551dd01d5dd07a1d2dc24fd02c38 | # BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE
from __future__ import absolute_import
import sys
import pytest
import numpy
import awkward1
class Dummy(awkward1.Record):
@property
def broken(self):
raise AttributeError("I'm broken!")
def test():
behavi... | [((21, 12, 21, 77), 'awkward1.Array', 'awkward1.Array', (), '', False, 'import awkward1\n'), ((24, 9, 24, 38), 'pytest.raises', 'pytest.raises', ({(24, 23, 24, 37): 'AttributeError'}, {}), '(AttributeError)', False, 'import pytest\n')] |
umd-lib/solr-irroc | scripts/preprocess.py | 860be84ea1847cbb96c1a7a70b03f59dc6e0366b | #!/user/bin/env python3
# -*- coding: utf8 -*-
#===================================================#
# cleanup.py #
# Joshua Westgard #
# 2015-08-13 #
# #
#... | [] |
appressoas/ievv_opensource | ievv_opensource/demo/batchframeworkdemo/apps.py | 63e87827952ddc8f6f86145b79478ef21d6a0990 | from django.apps import AppConfig
from ievv_opensource import ievv_batchframework
from ievv_opensource.ievv_batchframework import batchregistry
class HelloWorldAction(ievv_batchframework.Action):
def execute(self):
self.logger.info('Hello world! %r', self.kwargs)
class HelloWorldAsyncAction(ievv_batchf... | [((23, 12, 28, 18), 'ievv_opensource.ievv_batchframework.batchregistry.ActionGroup', 'batchregistry.ActionGroup', (), '', False, 'from ievv_opensource.ievv_batchframework import batchregistry\n'), ((30, 12, 36, 13), 'ievv_opensource.ievv_batchframework.batchregistry.ActionGroup', 'batchregistry.ActionGroup', (), '', Fa... |
GODVIX/fastmoe | fmoe/gates/utils.py | 7f6463f0367205a1e95139c6d7e930be6e7fa746 | r"""
Utilities that may be used in the gates
"""
import torch
from fmoe.functions import count_by_gate
import fmoe_cuda as fmoe_native
def limit_by_capacity(topk_idx, num_expert, world_size, capacity):
capacity = torch.ones(num_expert, dtype=torch.int32,
device=topk_idx.device) * capacity
pos, le... | [((13, 20, 14, 30), 'fmoe.functions.count_by_gate', 'count_by_gate', (), '', False, 'from fmoe.functions import count_by_gate\n'), ((15, 15, 16, 35), 'fmoe_cuda.limit_by_capacity', 'fmoe_native.limit_by_capacity', ({(15, 45, 15, 48): 'gec', (15, 50, 15, 58): 'capacity', (16, 12, 16, 22): 'num_expert', (16, 24, 16, 34):... |
DeppMeng/DANNet | evaluate.py | 831eb70d44a4a0b6f6f57ca2014521fc64d1906c | import os
import torch
import numpy as np
from PIL import Image
import torch.nn as nn
from torch.utils import data
from network import *
from dataset.zurich_night_dataset import zurich_night_DataSet
from configs.test_config import get_arguments
palette = [128, 64, 128, 244, 35, 232, 70, 70, 70, 102, 102, 156, 190, ... | [((30, 13, 30, 33), 'torch.device', 'torch.device', ({(30, 26, 30, 32): '"""cuda"""'}, {}), "('cuda')", False, 'import torch\n'), ((33, 11, 33, 26), 'configs.test_config.get_arguments', 'get_arguments', ({}, {}), '()', False, 'from configs.test_config import get_arguments\n'), ((44, 23, 44, 52), 'torch.load', 'torch.lo... |
zengboming/python | decorator.py | 13018f476554adc3bff831af27c08f7c216d4b09 | #decorator
def now():
print "2015-11-18"
f=now
f()
print now.__name__
print f.__name__
def log(func):
def wrapper(*args,**kw):
print 'begin call %s():' %func.__name__
func(*args,**kw)
print 'end call %s():' %func.__name__
return wrapper
@log
def now1():
print now1.__name__
now1()
now1=log(now1)
now1()
def... | [] |
compgeomTU/frechetForCurves | test/pyfrechet_visualize.py | 625bfe32a45d23b194226b4ac7713ded09bd2825 | # Author: Will Rodman
# wrodman@tulane.edu
#
# Command line to run program:
# python3 pyfrechet_visualize.py
import sys, os, unittest
sys.path.insert(0, "../")
from pyfrechet.distance import StrongDistance
from pyfrechet.visualize import FreeSpaceDiagram, Trajectories
TEST_DATA = "sp500"
if TEST_DATA == "sp500":
... | [((8, 0, 8, 25), 'sys.path.insert', 'sys.path.insert', ({(8, 16, 8, 17): '(0)', (8, 19, 8, 24): '"""../"""'}, {}), "(0, '../')", False, 'import sys, os, unittest\n'), ((74, 4, 74, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import sys, os, unittest\n'), ((43, 13, 43, 70), 'pyfrechet.distance.StrongDi... |
nww2007/py_ser_freeastro | py_ser_freeastro/core.py | 5806cf83316f48a6db0abe4a88e4485fc04a1b4d | #!/usr/bin/env python3
# vim:fileencoding=UTF-8
# -*- coding: UTF-8 -*-
"""
Created on 15 juny 2019 y.
@author: Vlsdimir Nekrasov nww2007@mail.ru
"""
import sys
import struct
import numpy as np
from progress.bar import Bar
import logging
logging.basicConfig(format = u'%(filename)s:%(lineno)d: %(levelname)-8s [%(asc... | [((17, 0, 17, 141), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((99, 4, 99, 43), 'logging.info', 'logging.info', ({(99, 17, 99, 42): "('%s started.\\n' % argv[0])"}, {}), "('%s started.\\n' % argv[0])", False, 'import logging\n'), ((160, 4, 160, 44), 'logging.info', 'logging.info'... |
humeniuka/sGDML_dataset_generation | sgdml_dataset_generation/readers/fchk.py | a99f792b6aac7ff869ebcd1bd7a7226ca81f43ee | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__all__ = ["FormattedCheckpointFile"]
# # Imports
import numpy as np
import scipy.linalg as sla
from collections import OrderedDict
import re
import logging
# # Local Imports
from sgdml_dataset_generation import units
from sgdml_dataset_generation.units import hbar
# # L... | [((17, 9, 17, 36), 'logging.getLogger', 'logging.getLogger', ({(17, 27, 17, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((18, 0, 18, 77), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((44, 20, 44, 33), 'collections.OrderedDict', 'OrderedDict', ({}, {}), '()', Fa... |
94JuHo/Algorithm_study | 2020_01_01/max_values/max_values.py | e2c10ec680d966e5bcc4e7cb88d9514f9ccbbf15 | values = []
for i in range(9):
values.append(int(input('')))
max_value = 0
location = 0
for i in range(9):
if values[i] > max_value:
max_value = values[i]
location = i+1
print(max_value)
print(location) | [] |
rhasspy/fuzzywuzzy | fuzzywuzzy/process.py | e5b486c756b392481ec8e1382eedce280e56fd69 | #!/usr/bin/env python
# encoding: utf-8
"""
process.py
Copyright (c) 2011 Adam Cohen
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 t... | [((51, 30, 51, 50), 'utils.asciidammit', 'utils.asciidammit', ({(51, 48, 51, 49): 'x'}, {}), '(x)', False, 'import utils\n')] |
robfalck/AoC2017 | day03/day03.py | fa19f3fb42d979b60888a1954bea571c9d4ee735 | from __future__ import print_function, division, absolute_import
import numpy as np
INPUT = 265149
def part1(number):
skip = 2
d = 1
row = None
col = None
for shell_idx in range(1, 10000):
size = shell_idx * 2 + 1
a = d + skip
b = a + skip
c = b + skip
d ... | [((47, 10, 47, 39), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n')] |
codefair114/Inventory-App-Django | core/migrations/0004_auto_20210929_2354.py | f09f43ca282f82be981cac26a92d614fdf2ff5ef | # Generated by Django 3.2.7 on 2021-09-29 23:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20210929_2353'),
]
operations = [
migrations.AlterField(
model_name='order',
... | [((17, 18, 17, 114), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import migrations, models\n'), ((22, 18, 22, 116), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import migrations, models\n'), ((27, 18, 27, 111), 'django.db.models.ForeignKey', ... |
bopopescu/nova-token | nova/api/openstack/compute/legacy_v2/contrib/console_auth_tokens.py | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | begin_unit
comment|'# Copyright 2013 Cloudbase Solutions Srl'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'... | [] |
jaluebbe/ahrs | ahrs/common/geometry.py | 4b4a33b1006e0d455a71ac8379a2697202361758 | # -*- coding: utf-8 -*-
"""
Geometrical functions
---------------------
References
----------
.. [W1] Wikipedia: https://de.wikipedia.org/wiki/Ellipse#Ellipsengleichung_(Parameterform)
.. [WAE] Wolfram Alpha: Ellipse. (http://mathworld.wolfram.com/Ellipse.html)
"""
import numpy as np
from typing import Union
def ci... | [((35, 8, 35, 49), 'numpy.linspace', 'np.linspace', ({(35, 20, 35, 23): '0.0', (35, 25, 35, 34): '2.0 * np.pi', (35, 36, 35, 48): 'num_points + 1'}, {}), '(0.0, 2.0 * np.pi, num_points + 1)', True, 'import numpy as np\n'), ((61, 8, 61, 49), 'numpy.linspace', 'np.linspace', ({(61, 20, 61, 23): '0.0', (61, 25, 61, 34): '... |
jamayfieldjr/iem | htdocs/plotting/auto/scripts100/p116.py | 275b77a65f3b12e26e6cbdb230786b9c7d2b9c9a | """Monthly HDD/CDD Totals."""
import datetime
from pandas.io.sql import read_sql
from pyiem.plot.use_agg import plt
from pyiem.util import get_dbconn, get_autoplot_context
from pyiem.exceptions import NoDataFound
PDICT = {'cdd': 'Cooling Degree Days',
'hdd': 'Heating Degree Days'}
def get_description():
... | [((38, 13, 38, 31), 'pyiem.util.get_dbconn', 'get_dbconn', ({(38, 24, 38, 30): '"""coop"""'}, {}), "('coop')", False, 'from pyiem.util import get_dbconn, get_autoplot_context\n'), ((45, 9, 56, 51), 'pandas.io.sql.read_sql', 'read_sql', (), '', False, 'from pandas.io.sql import read_sql\n'), ((111, 14, 111, 50), 'pyiem.... |
krfricke/ray_shuffling_data_loader | examples/horovod/ray_torch_shuffle.py | b238871d45218c655cd0fcd78b8bf2a3940087f9 | import os
import pickle
import time
import timeit
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import torch
import tempfile
import horovod.torch as hvd
from horovod.ray import RayExecutor
from ray_shuffling_data_loader.torch_dataset import (TorchShufflingDatase... | [((39, 9, 39, 69), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((145, 4, 145, 14), 'horovod.torch.init', 'hvd.init', ({}, {}), '()', True, 'import horovod.torch as hvd\n'), ((146, 4, 146, 32), 'torch.manual_seed', 'torch.manual_seed', ({(146, 22, 146, 31): 'args.seed'}, {}... |
PitonX60/django-firebird | tests/test_main/test_base/tests.py | 407bd5916a8ae37184d06adb3b943d6bb4f7076f | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from django.conf import settings
from django.db import connection, DatabaseError
from django.db.models import F, DateField, DateTimeField, IntegerField, TimeField, CASCADE
from django.db.models.fields.related import ForeignKey
from django.db.models.func... | [((189, 1, 189, 32), 'django.test.override_settings', 'override_settings', (), '', False, 'from django.test import TestCase, TransactionTestCase, override_settings\n'), ((148, 20, 148, 54), 'django.db.models.fields.related.ForeignKey', 'ForeignKey', (), '', False, 'from django.db.models.fields.related import ForeignKey... |
justinbois/eqtk | tests/test_past_failures.py | 7363b8c09e35088d2cb2cb5a62d315b52cce0d9b | import pytest
import numpy as np
import eqtk
def test_promiscuous_binding_failure():
A = np.array(
[
[
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.0,
1.0,
0.0,
... | [((8, 8, 131, 5), 'numpy.array', 'np.array', ({(9, 8, 130, 9): '[[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0,\n 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 1.0, ... |
suresh198526/pulumi-azure | sdk/python/pulumi_azure/lb/outbound_rule.py | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | [((174, 5, 174, 49), 'pulumi.getter', 'pulumi.getter', (), '', False, 'import pulumi\n'), ((182, 5, 182, 47), 'pulumi.getter', 'pulumi.getter', (), '', False, 'import pulumi\n'), ((190, 5, 190, 41), 'pulumi.getter', 'pulumi.getter', (), '', False, 'import pulumi\n'), ((198, 5, 198, 51), 'pulumi.getter', 'pulumi.getter'... |
Juanlu001/orbit-predictor | orbit_predictor/predictors/base.py | ca67e2e859932938627ed24e5cbf58c887cd99c0 | # MIT License
#
# Copyright (c) 2017 Satellogic SA
#
# 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... | [((54, 9, 54, 36), 'logging.getLogger', 'logging.getLogger', ({(54, 27, 54, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((57, 13, 57, 36), 'datetime.timedelta', 'dt.timedelta', (), '', True, 'import datetime as dt\n'), ((64, 15, 65, 85), 'collections.namedtuple', 'namedtuple', ({(65, 8, 65, 18): '"... |
jbdel/vilmedic | vilmedic/scorers/NLG/__init__.py | 17d462a540a2632811cc2a78edd2861800a33b07 | from .rouge import ROUGEScorer
from .bleu.bleu import BLEUScorer
from .meteor.meteor import METEORScorer
from .cider.cider import Cider
from .ciderd.ciderd import CiderD
| [] |
Yshuo-Li/mmediting-test | tests/test_liif.py | ff8349a183b3d266495a53be0c8ad8e342e8b461 | import numpy as np
import torch
import torch.nn as nn
from mmcv.runner import obj_from_dict
from mmcv.utils.config import Config
from mmedit.models import build_model
from mmedit.models.losses import L1Loss
from mmedit.models.registry import COMPONENTS
@COMPONENTS.register_module()
class BP(nn.Module):
"""A simp... | [((12, 1, 12, 29), 'mmedit.models.registry.COMPONENTS.register_module', 'COMPONENTS.register_module', ({}, {}), '()', False, 'from mmedit.models.registry import COMPONENTS\n'), ((55, 15, 55, 77), 'mmedit.models.build_model', 'build_model', (), '', False, 'from mmedit.models import build_model\n'), ((63, 13, 63, 37), 't... |
ccraddock/beiwe-backend-cc | database/signals.py | b37c2604800aafcf81c93bc14673ada6aed17a39 |
from django.utils import timezone
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from database.study_models import DeviceSettings, Study, Survey, SurveyArchive
@receiver(post_save, sender=Study)
def popula... | [((10, 1, 10, 34), 'django.dispatch.receiver', 'receiver', (), '', False, 'from django.dispatch import receiver\n'), ((24, 1, 24, 34), 'django.dispatch.receiver', 'receiver', (), '', False, 'from django.dispatch import receiver\n'), ((48, 18, 48, 87), 'database.study_models.SurveyArchive', 'SurveyArchive', (), '', Fals... |
Blakstar26/npyscreen | docs/examples/notify/notify_skeleton.py | d47f9c78dc9fea6f66aaef60403e748bb89e52f7 | import npyscreen
class NotifyBaseExample(npyscreen.Form):
def create(self):
key_of_choice = 'p'
what_to_display = 'Press {} for popup \n Press escape key to quit'.format(key_of_choice)
self.how_exited_handers[npyscreen.wgwidget.EXITED_ESCAPE] = self.exit_application
self.add(npysc... | [] |
romanroson/pis_code | practicioner_bundle/ch15-neural_style/pyimagesearch/nn/conv/minigooglenet.py | 1221c39c23bec62ba419f9a324f88b0d8e5e4b5b | # -*- coding: utf-8 -*-
"""Implementation of MiniGoogLeNet architecture.
This implementation is based on the original implemetation of GoogLeNet.
The authors of the net used BN before Activation layer.
This should be switched.
"""
from keras.layers.normalization import BatchNormalization
from keras.layers.convolutiona... | [((67, 12, 67, 62), 'keras.layers.concatenate', 'concatenate', (), '', False, 'from keras.layers import concatenate\n'), ((86, 12, 86, 58), 'keras.layers.concatenate', 'concatenate', (), '', False, 'from keras.layers import concatenate\n'), ((113, 17, 113, 41), 'keras.layers.Input', 'Input', (), '', False, 'from keras.... |
PaulDoessel/gaffer-play | python/GafferUI/ScriptEditor.py | 8b72dabb388e12424c230acfb0bd209049b01bd6 | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | [] |
machinelearningdeveloper/aoc_2016 | 03/triangle.py | e2c2f7909b09c2ad27f87e05a80f2b2feee6a3a2 | """Test whether putative triangles, specified as triples of side lengths,
in fact are possible."""
def load_triangles(filename):
"""Load triangles from filename."""
triangles = []
with open(filename) as f:
for line in f:
if line.strip():
triangles.append(tuple([int(side) ... | [] |
aleksandromelo/Exercicios | ExerciciosdePython/ex049.py | 782ff539efa1286180eaf8df8c25c4eca7a5e669 | num = int(input('Digite um número para ver sua tabuada: '))
for i in range(1, 11):
print('{} x {:2} = {}'.format(num, i, num * i)) | [] |
bkidwell/ebmeta-old | ebmeta/actions/version.py | 2279ddd14235ea31b27f0eaa7e9bb26cb43d4133 | """Print ebmeta version number."""
import sys
import ebmeta
def run():
print "{} {}".format(ebmeta.PROGRAM_NAME, ebmeta.VERSION)
sys.exit(0)
| [] |
amichard/tfrs | backend/api/tests/mixins/credit_trade_relationship.py | ed3973016cc5c2ae48999d550a23b41a5ddad807 | # -*- coding: utf-8 -*-
# pylint: disable=no-member,invalid-name,duplicate-code
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline
compliance reporting for transportation fuel suppliers in accordance with
the ... | [((62, 19, 70, 6), 'collections.namedtuple', 'namedtuple', ({(62, 30, 62, 44): '"""ChangeRecord"""', (62, 46, 70, 5): "['trade_id', 'requesting_username', 'relationship',\n 'expected_to_be_successful', 'data_before_request',\n 'data_after_request', 'response_code']"}, {}), "('ChangeRecord', ['trade_id', 'requesti... |
panchohumeres/dynamo-covid | superset/superset_config.py | cf473be3eeca436efccd8891a61b721192cf6d34 | import os
SERVER_NAME = os.getenv('DOMAIN_SUPERSET')
PUBLIC_ROLE_LIKE_GAMMA = True
SESSION_COOKIE_SAMESITE = None # One of [None, 'Lax', 'Strict']
SESSION_COOKIE_HTTPONLY = False
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')
POSTGRES_DB=os.getenv('POSTGRES_DB')
POSTGRES_PASSWORD=os.getenv('POSTGRES_PASSWORD')
POSTG... | [((3, 14, 3, 42), 'os.getenv', 'os.getenv', ({(3, 24, 3, 41): '"""DOMAIN_SUPERSET"""'}, {}), "('DOMAIN_SUPERSET')", False, 'import os\n'), ((7, 17, 7, 48), 'os.getenv', 'os.getenv', ({(7, 27, 7, 43): '"""MAPBOX_API_KEY"""', (7, 45, 7, 47): '""""""'}, {}), "('MAPBOX_API_KEY', '')", False, 'import os\n'), ((8, 12, 8, 36)... |
johnnyboiii3020/matchmaking-bot | mybot.py | c36df430fd8b3292f34fb2e156e65d9914e0e497 | import discord
import json
import random
import os
from discord.ext import commands
TOKEN = ""
client = commands.Bot(command_prefix = '--')
os.chdir(r'D:\Programming\Projects\Discord bot\jsonFiles')
SoloCounter = 30
SolominCounter = 10
Queueiter = 1
T_Queueiter = 1
TeamCounter = 50
TeamminCounter = 20
... | [((8, 9, 8, 44), 'discord.ext.commands.Bot', 'commands.Bot', (), '', False, 'from discord.ext import commands\n'), ((10, 0, 10, 58), 'os.chdir', 'os.chdir', ({(10, 9, 10, 57): '"""D:\\\\Programming\\\\Projects\\\\Discord bot\\\\jsonFiles"""'}, {}), "('D:\\\\Programming\\\\Projects\\\\Discord bot\\\\jsonFiles')", False,... |
markemus/economy | conversation.py | d7b3be9b2095393d7ee5c8967b9fcee8998776bb | import database as d
import numpy as np
import random
from transitions import Machine
#Conversations are markov chains. Works as follows: a column vector for each CURRENT state j, a row vector for each TARGET state i.
#Each entry i,j = the probability of moving to state i from state j.
#target state D = end of convers... | [((89, 24, 89, 125), 'transitions.Machine', 'Machine', (), '', False, 'from transitions import Machine\n'), ((369, 24, 369, 51), 'numpy.dot', 'np.dot', ({(369, 31, 369, 37): 'matrix', (369, 39, 369, 50): 'stateVector'}, {}), '(matrix, stateVector)', True, 'import numpy as np\n'), ((373, 21, 373, 36), 'random.random', '... |
saijananiganesan/SimPathFinder | src/createData.py | 1634f2cb82c8056256d191be72589c4c531a3f67 | from __init__ import ExtractUnlabeledData, SampleUnlabeledData, ExtractLabeledData
E = ExtractLabeledData(data_dir='../labeldata/')
E.get_pathways()
E.get_pathway_names()
E.get_classes_dict()
E.create_df_all_labels()
| [((3, 4, 3, 48), '__init__.ExtractLabeledData', 'ExtractLabeledData', (), '', False, 'from __init__ import ExtractUnlabeledData, SampleUnlabeledData, ExtractLabeledData\n')] |
farman99ahmed/diyblog | blog/views.py | 2e4548037c95b5563d2fdba3d05b488330a5e2b4 | from django.shortcuts import render, redirect
from .forms import AuthorForm, BlogForm, NewUserForm
from .models import Author, Blog
from django.contrib.auth import login, authenticate, logout
from django.contrib import messages
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.decorator... | [((13, 11, 13, 60), 'django.shortcuts.render', 'render', ({(13, 18, 13, 25): 'request', (13, 27, 13, 50): '"""blog/get_authors.html"""', (13, 52, 13, 59): 'context'}, {}), "(request, 'blog/get_authors.html', context)", False, 'from django.shortcuts import render, redirect\n'), ((20, 11, 20, 59), 'django.shortcuts.rende... |
SolomidHero/speech-regeneration-enhancer | tests/conftest.py | eb43907ff085d68a707ff7bc3af14e93ff66fd65 | # here we make fixtures of toy data
# real parameters are stored and accessed from config
import pytest
import librosa
import os
import numpy as np
from hydra.experimental import compose, initialize
@pytest.fixture(scope="session")
def cfg():
with initialize(config_path="../", job_name="test_app"):
config = ... | [((13, 1, 13, 32), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((22, 1, 22, 32), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((26, 1, 26, 32), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((34, 1, 34, 32), 'pytest.fixture', 'pytest.fixture'... |
CvanderStoep/VideosSampleCode | dataclassses_howto.py | 38a8d2538a041d5664d0040807ffac463d0fb79c | import dataclasses
import inspect
from dataclasses import dataclass, field
from pprint import pprint
import attr
class ManualComment:
def __init__(self, id: int, text: str):
self.id: int = id
self.text: str = text
def __repr__(self):
return "{}(id={}, text={})".format(self.__class__.... | [((58, 1, 58, 35), 'dataclasses.dataclass', 'dataclass', (), '', False, 'from dataclasses import dataclass, field\n'), ((65, 1, 65, 44), 'attr.s', 'attr.s', (), '', False, 'import attr\n'), ((62, 25, 62, 79), 'dataclasses.field', 'field', (), '', False, 'from dataclasses import dataclass, field\n'), ((77, 11, 77, 45), ... |
yaosir0317/my_first | downloadMusic/main.py | 387fe21aa529bca1d08ed45e13269aca23dce251 | from enum import Enum
import requests
class MusicAPP(Enum):
qq = "qq"
wy = "netease"
PRE_URL = "http://www.musictool.top/"
headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"}
def get_music_list(name, app, pag... | [((16, 11, 16, 65), 'requests.post', 'requests.post', (), '', False, 'import requests\n')] |
michelmarcondes/django-study-with-docker | app/api/serializers.py | 248e41db3f16a5d26662c5e93ebf32716a20195e | from rest_framework import serializers
from projects.models import Project, Tag, Review
from users.models import Profile
class ReviewSerializer(serializers.ModelSerializer):
class Meta:
model = Review
fields = '__all__'
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
... | [((27, 14, 27, 49), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ({}, {}), '()', False, 'from rest_framework import serializers\n')] |
johan--/commcare-hq | corehq/apps/domain/views.py | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | import copy
import datetime
from decimal import Decimal
import logging
import uuid
import json
import cStringIO
from couchdbkit import ResourceNotFound
import dateutil
from django.core.paginator import Paginator
from django.views.generic import View
from django.db.models import Sum
from django.conf import settings
fro... | [] |
alexmascension/ANMI | src/anmi/T2/funcs_met_iters.py | 9c51a497a5fa2650f1429f847c7f9df69271168b | from sympy import simplify, zeros
from sympy import Matrix as mat
import numpy as np
from ..genericas import print_verbose, matriz_inversa
def criterio_radio_espectral(H, verbose=True):
eigs = [simplify(i) for i in list(H.eigenvals().keys())]
print_verbose("||Criterio de radio espectral||", verbose)
try... | [((159, 8, 159, 23), 'sympy.simplify', 'simplify', ({(159, 17, 159, 22): 'M - A'}, {}), '(M - A)', False, 'from sympy import simplify, zeros\n'), ((9, 12, 9, 23), 'sympy.simplify', 'simplify', ({(9, 21, 9, 22): 'i'}, {}), '(i)', False, 'from sympy import simplify, zeros\n'), ((31, 8, 31, 36), 'numpy.array', 'np.array',... |
zhangxianbing/cookiecutter-pypackage | {{cookiecutter.project_hyphen}}/{{cookiecutter.project_slug}}/__init__.py | 28f7f305d3baf96771881c3359227bed1bc7d182 | """{{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }}"""
__version__ = "{{ cookiecutter.project_version }}"
__author__ = """{{ cookiecutter.author_name }}"""
__email__ = "{{ cookiecutter.author_email }}"
prog_name = "{{ cookiecutter.project_hyphen }}"
| [] |
mguidon/osparc-dask-gateway | services/osparc-gateway-server/tests/integration/_dask_helpers.py | accd850c15cb3a36cf4421a1d070a4db29843013 | from typing import NamedTuple
from dask_gateway_server.app import DaskGateway
class DaskGatewayServer(NamedTuple):
address: str
proxy_address: str
password: str
server: DaskGateway
| [] |
kazuyaujihara/rdkit | rdkit/ML/InfoTheory/BitRank.py | 06027dcd05674787b61f27ba46ec0d42a6037540 | #
# Copyright (C) 2001,2002,2003 greg Landrum and Rational Discovery LLC
#
""" Functionality for ranking bits using info gains
**Definitions used in this module**
- *sequence*: an object capable of containing other objects which supports
__getitem__() and __len__(). Examples of these include lists, tupl... | [((53, 8, 53, 69), 'numpy.zeros', 'numpy.zeros', ({(53, 20, 53, 53): '(nPossibleBitVals, nPossibleActs)', (53, 55, 53, 68): 'numpy.integer'}, {}), '((nPossibleBitVals, nPossibleActs), numpy.integer)', False, 'import numpy\n'), ((81, 8, 81, 39), 'numpy.zeros', 'numpy.zeros', ({(81, 20, 81, 25): 'nBits', (81, 27, 81, 38)... |
vinay-swamy/gMVP | trainer/dataset.py | 62202baa0769dfe0e47c230e78dffa42fb1280f1 | import tensorflow as tf
import os
import pickle
import numpy as np
from constant_params import input_feature_dim, window_size
def build_dataset(input_tfrecord_files, batch_size):
drop_remainder = False
feature_description = {
'label': tf.io.FixedLenFeature([], tf.int64),
'ref_aa': tf.io.Fixe... | [((54, 14, 54, 59), 'tensorflow.data.TFRecordDataset', 'tf.data.TFRecordDataset', ({(54, 38, 54, 58): 'input_tfrecord_files'}, {}), '(input_tfrecord_files)', True, 'import tensorflow as tf\n'), ((56, 14, 56, 31), 'tensorflow.data.Options', 'tf.data.Options', ({}, {}), '()', True, 'import tensorflow as tf\n'), ((113, 14... |
dpressel/baseline | layers/eight_mile/pytorch/layers.py | 2f46f3b043f2d20bc348495cc54c834f31f71098 | import copy
import math
import logging
from typing import Dict, List, Optional, Tuple, Union
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.jit as jit
import torch.autograd
import contextlib
import glob
from eight_mile.utils import listify, Offsets, is_seque... | [((18, 9, 18, 41), 'logging.getLogger', 'logging.getLogger', ({(18, 27, 18, 40): '"""mead.layers"""'}, {}), "('mead.layers')", False, 'import logging\n'), ((75, 22, 75, 55), 'torch.max', 'torch.max', (), '', False, 'import torch\n'), ((351, 11, 351, 20), 'torch.nn.ReLU', 'nn.ReLU', ({}, {}), '()', True, 'import torch.n... |
flother/pdf-search | setup.py | fa4c519a673bf5a5d25e1ab44e971690ab3cf781 | from setuptools import setup
setup(
name='espdf',
version='0.1.0-dev',
url='https://github.com/flother/pdf-search',
py_modules=(
'espdf',
),
install_requires=(
'certifi',
'elasticsearch-dsl',
),
entry_points={
'console_scripts': (
'espdf=espd... | [((4, 0, 20, 1), 'setuptools.setup', 'setup', (), '', False, 'from setuptools import setup\n')] |
martexcoin/pywallet | pywallet/network.py | dca53f124452869890b0247c40afba821b650c6b | class BitcoinGoldMainNet(object):
"""Bitcoin Gold MainNet version bytes. """
NAME = "Bitcoin Gold Main Net"
COIN = "BTG"
SCRIPT_ADDRESS = 0x17 # int(0x17) = 23
PUBKEY_ADDRESS = 0x26 # int(0x26) = 38 # Used to create payment addresses
SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF fo... | [] |
sintef-ocean/conan-clapack | conanfile.py | 9c472130eaadee71253ced9b5fe25ee1b868bcb3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake, tools
import shutil
class ClapackConan(ConanFile):
name = "clapack"
version = "3.2.1"
license = "BSD 3-Clause"
# BSD-3-Clause-Clear
url = "https://github.com/sintef-ocean/conan-clapack"
author = "SINTEF Ocean"
... | [((36, 8, 36, 72), 'conans.tools.get', 'tools.get', (), '', False, 'from conans import ConanFile, CMake, tools\n'), ((38, 8, 39, 52), 'conans.tools.patch', 'tools.patch', (), '', False, 'from conans import ConanFile, CMake, tools\n'), ((40, 8, 41, 52), 'conans.tools.patch', 'tools.patch', (), '', False, 'from conans im... |
ComputerSystemsLaboratory/YaCoS | yacos/algorithm/metaheuristics.py | abd5d3c6e227e5c7a563493f7855ebf58ba3de05 | """
Copyright 2021 Anderson Faustino da Silva.
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,... | [((246, 43, 246, 74), 'yacos.essential.IO.load_passes', 'IO.load_passes', ({(246, 58, 246, 73): 'passes_filename'}, {}), '(passes_filename)', False, 'from yacos.essential import IO\n'), ((284, 20, 284, 43), 'pygmo.algorithm', 'pg.algorithm', ({(284, 33, 284, 42): 'algorithm'}, {}), '(algorithm)', True, 'import pygmo as... |
solnishko-pvs/Modeling_BMSTU | lab_03/main.py | 0ecb82aea23b6726912f72d3230097d7b679eaf9 | import tkinter as tk
from scipy.stats import chi2, chisquare
COLOR = '#dddddd'
COLUMNS_COLOR = '#ffffff'
MAX_SIZE = 10
WIDGET_WIDTH = 25
class LinearCongruent:
m = 2**32
a = 1664525
c = 1013904223
_cur = 1
def next(self):
self._cur = (self.a * self._cur + self.c) % self.m
return s... | [((211, 7, 211, 14), 'tkinter.Tk', 'tk.Tk', ({}, {}), '()', True, 'import tkinter as tk\n'), ((79, 21, 79, 105), 'tkinter.LabelFrame', 'tk.LabelFrame', (), '', True, 'import tkinter as tk\n'), ((84, 27, 84, 87), 'tkinter.Label', 'tk.Label', (), '', True, 'import tkinter as tk\n'), ((85, 29, 85, 72), 'tkinter.Entry', 't... |
tylermneher/python-api-challenge | VacationPy/api_keys.py | 28c88b4fff13c8b752096b0776a3d4645ad5fddb | # OpenWeatherMap API Key
weather_api_key = "MyOpenWeatherMapAPIKey"
# Google API Key
g_key = "MyGoogleKey" | [] |
panickervinod/aries-cloudagent-python | aries_cloudagent/protocols/actionmenu/v1_0/messages/menu_request.py | bb4627fe62ee42ffeeb435cf3d8bfbd66c10d02f | """Represents a request for an action menu."""
from .....messaging.agent_message import AgentMessage, AgentMessageSchema
from ..message_types import MENU_REQUEST, PROTOCOL_PACKAGE
HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.menu_request_handler.MenuRequestHandler"
class MenuRequest(AgentMessage):
"""Class re... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.