repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 680k |
|---|---|---|---|---|
leobouts/Skyline_top_k_queries | k_values_graph.py | 5f5e8ab8f5e521dc20f33a69dd042917ff5d42f0 | from a_top_k import *
from b_top_k import *
import time
def main():
# test the generator for the top-k input
# starting time
values_k = [1, 2, 5, 10, 20, 50, 100]
times_topk_join_a = []
times_topk_join_b = []
number_of_valid_lines_a = []
number_of_valid_lines_b = []
for k in values_... | [((453, 464), 'time.time', 'time.time', ([], {}), '()\n', (462, 464), False, 'import time\n'), ((824, 835), 'time.time', 'time.time', ([], {}), '()\n', (833, 835), False, 'import time\n'), ((620, 631), 'time.time', 'time.time', ([], {}), '()\n', (629, 631), False, 'import time\n'), ((991, 1002), 'time.time', 'time.time... |
CEOALT1/RefindPlusUDK | AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_methodattrs.py | 116b957ad735f96fbb6d80a0ba582046960ba164 | """Fix bound method attributes (method.im_? -> method.__?__).
"""
# Author: Christian Heimes
# Local imports
from .. import fixer_base
from ..fixer_util import Name
MAP = {
"im_func" : "__func__",
"im_self" : "__self__",
"im_class" : "__self__.__class__"
}
class FixMethodattrs(fixer_bas... | [] |
Renovamen/Text-Classification | models/TextCNN/cnn2d.py | 4a4aa4001c402ed4371ebaabe1393b27794e5992 | import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import List
class TextCNN2D(nn.Module):
"""
Implementation of 2D version of TextCNN proposed in paper [1].
`Here <https://github.com/yoonkim/CNN_sentence>`_ is the official
implementation of TextCNN.
Parameters
---... | [((1447, 1481), 'torch.nn.Embedding', 'nn.Embedding', (['vocab_size', 'emb_size'], {}), '(vocab_size, emb_size)\n', (1459, 1481), True, 'import torch.nn as nn\n'), ((2223, 2242), 'torch.nn.Dropout', 'nn.Dropout', (['dropout'], {}), '(dropout)\n', (2233, 2242), True, 'import torch.nn as nn\n'), ((2263, 2272), 'torch.nn.... |
seunghwanly/CODING-TEST | LEVEL2/다리를지나는트럭/solution.py | a820da950c163d399594770199aa2e782d1fbbde | def solution(bridge_length, weight, truck_weights):
answer = 0
# { weight, time }
wait = truck_weights[:]
bridge = []
passed = 0
currWeight = 0
while True:
if passed == len(truck_weights) and len(wait) == 0: return answer
answer += 1
# sth needs to be passed
... | [] |
maestro-hybrid-cloud/heat | heat/tests/convergence/framework/testutils.py | 91a4bb3170bd81b1c67a896706851e55709c9b5a | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | [((752, 779), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (769, 779), True, 'from oslo_log import log as logging\n'), ((1115, 1138), 'heat.tests.convergence.framework.reality.all_resources', 'reality.all_resources', ([], {}), '()\n', (1136, 1138), False, 'from heat.tests.convergen... |
AstroShen/fpga21-scaled-tech | device_geometry.py | 8a7016913c18d71844f733bc80a3ceaa2d033ac2 | """Holds the device gemoetry parameters (Table 5), taken from Wu et al.,
>> A Predictive 3-D Source/Drain Resistance Compact Model and the Impact on 7 nm and Scaled FinFets<<, 2020, with interpolation for 4nm. 16nm is taken from PTM HP.
"""
node_names = [16, 7, 5, 4, 3]
GP = [64, 56, 48, 44, 41]
FP = [40, 30, 28, 24, ... | [] |
vmthunder/nova | nova/tests/servicegroup/test_zk_driver.py | baf05caab705c5778348d9f275dc541747b7c2de | # Copyright (c) AT&T 2012-2013 Yun Mao <yunmao@gmail.com>
# Copyright 2012 IBM Corp.
#
# 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/LICENS... | [((1666, 1684), 'nova.servicegroup.API', 'servicegroup.API', ([], {}), '()\n', (1682, 1684), False, 'from nova import servicegroup\n'), ((2048, 2065), 'eventlet.sleep', 'eventlet.sleep', (['(1)'], {}), '(1)\n', (2062, 2065), False, 'import eventlet\n'), ((2198, 2216), 'nova.servicegroup.API', 'servicegroup.API', ([], {... |
lordmauve/chopsticks | tests/test_misc.py | 87c6a5d0049a45db1477a21510cba650f470a8ac | """Tests for miscellaneous properties, such as debuggability."""
import time
from chopsticks.tunnel import Docker
from chopsticks.group import Group
def test_tunnel_repr():
"""Tunnels have a usable repr."""
tun = Docker('py36', image='python:3.6')
assert repr(tun) == "Docker('py36')"
def test_group_repr... | [((223, 257), 'chopsticks.tunnel.Docker', 'Docker', (['"""py36"""'], {'image': '"""python:3.6"""'}), "('py36', image='python:3.6')\n", (229, 257), False, 'from chopsticks.tunnel import Docker\n'), ((387, 421), 'chopsticks.tunnel.Docker', 'Docker', (['"""py35"""'], {'image': '"""python:3.5"""'}), "('py35', image='python... |
AnnonymousRacoon/Quantum-Random-Walks-to-Solve-Diffusion | Evaluation/PostProcesing.py | 366ac5073cea96b662b934c3657446c9f1aa2f65 | import pandas as pd
import re
import glob
def rebuild_counts_from_csv(path,n_dims, shots):
df = pd.read_csv(path)
return rebuild_counts_from_dataframe(dataframe=df, n_dims=n_dims, shots=shots)
def rebuild_counts_from_dataframe(dataframe,n_dims,shots):
dimension_counts = {}
for dimension in range(n_d... | [((102, 119), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (113, 119), True, 'import pandas as pd\n'), ((1068, 1092), 'pandas.DataFrame', 'pd.DataFrame', (['dictionary'], {}), '(dictionary)\n', (1080, 1092), True, 'import pandas as pd\n'), ((1252, 1278), 'pandas.DataFrame', 'pd.DataFrame', (['results_d... |
michel-rodrigues/viggio_backend | app/wirecard/tasks.py | f419f0b939209722e1eb1e272f33de172cd5c1f1 | from sentry_sdk import capture_exception
from dateutil.parser import parse
from project_configuration.celery import app
from orders.models import Charge
from request_shoutout.domain.models import Charge as DomainCharge
from .models import WirecardTransactionData
CROSS_SYSTEMS_STATUS_MAPPING = {
'WAITING': Domai... | [((1418, 1473), 'dateutil.parser.parse', 'parse', (["notification['resource']['payment']['updatedAt']"], {}), "(notification['resource']['payment']['updatedAt'])\n", (1423, 1473), False, 'from dateutil.parser import parse\n'), ((705, 808), 'orders.models.Charge.objects.filter', 'Charge.objects.filter', ([], {'order__th... |
coalpha/coalpha.github.io | py/multiple_dispatch_example.py | 8a620314a5c0bcbe2225d29f733379d181534430 | from typing import *
from multiple_dispatch import multiple_dispatch
@overload
@multiple_dispatch
def add(a: Literal[4, 6, 8], b):
raise TypeError("No adding 2, 4, 6, or 8!")
@overload
@multiple_dispatch
def add(a: int, b: str):
return f"int + str = {a} + {b}"
@overload
@multiple_dispatch
def add(a: int, b: in... | [] |
Sunyingbin/models | dygraph/alexnet/network.py | 30a7f1757bfad79935aa865f4362a7b38e63a415 | """
动态图构建 AlexNet
"""
import paddle.fluid as fluid
import numpy as np
class Conv2D(fluid.dygraph.Layer):
def __init__(self,
name_scope,
num_channels,
num_filters,
filter_size,
stride=1,
padding=0,
... | [((586, 836), 'paddle.fluid.dygraph.Conv2D', 'fluid.dygraph.Conv2D', ([], {'num_channels': 'num_channels', 'num_filters': 'num_filters', 'filter_size': 'filter_size', 'stride': 'stride', 'padding': 'padding', 'dilation': 'dilation', 'groups': 'groups', 'param_attr': 'param_attr', 'bias_attr': 'bias_attr', 'act': 'act',... |
Ayon134/code_for_Kids | turtlegameproject/turtlegame.py | d90698bb38efe5e26c31f02bd129bfdadea158e2 | import turtle
import random
p1=turtle.Turtle()
p1.color("green")
p1.shape("turtle")
p1.penup()
p1.goto(-200,100)
p2=p1.clone()
p2.color("blue")
p2.penup()
p2.goto(-200,-100)
p1.goto(300,60)
p1.pendown()
p1.circle(40)
p1.penup()
p1.goto(-200,100)
p2.goto(300,-140)
p2.pendown()
p2.circle(40)
p2.penup()
p2.goto(-200,-... | [((32, 47), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (45, 47), False, 'import turtle\n'), ((589, 607), 'random.choice', 'random.choice', (['die'], {}), '(die)\n', (602, 607), False, 'import random\n'), ((792, 810), 'random.choice', 'random.choice', (['die'], {}), '(die)\n', (805, 810), False, 'import random\... |
neherlab/hivwholeseq | hivwholeseq/sequencing/check_pipeline.py | 978ce4060362e4973f92b122ed5340a5314d7844 | #!/usr/bin/env python
# vim: fdm=marker
'''
author: Fabio Zanini
date: 15/06/14
content: Check the status of the pipeline for one or more sequencing samples.
'''
# Modules
import os
import sys
from itertools import izip
import argparse
from Bio import SeqIO
from hivwholeseq.utils.generic import getchar
fr... | [] |
thliang01/nba-s | app.py | 660d0e830989916b7b9f3123eb809d143b714186 | import streamlit as st
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# --------------------------------------------------------------
# Import and clean data
game_details = pd.read_csv('games_details.csv')
# print(game_details.head(5))
game_details.drop(['GAME_ID', 'TEAM_... | [((221, 253), 'pandas.read_csv', 'pd.read_csv', (['"""games_details.csv"""'], {}), "('games_details.csv')\n", (232, 253), True, 'import pandas as pd\n'), ((671, 700), 'streamlit.checkbox', 'st.checkbox', (['"""Show dataframe"""'], {}), "('Show dataframe')\n", (682, 700), True, 'import streamlit as st\n'), ((836, 873), ... |
kepolol/craftassist | python/craftassist/voxel_models/geoscorer/geoscorer_util.py | f60a7edd0b4ea72b774cca45ba468d2e275445c2 | """
Copyright (c) Facebook, Inc. and its affiliates.
"""
import numpy as np
import random
from datetime import datetime
import sys
import argparse
import torch
import os
from inspect import currentframe, getframeinfo
GEOSCORER_DIR = os.path.dirname(os.path.realpath(__file__))
CRAFTASSIST_DIR = os.path.join(GEOSCORER_... | [((297, 331), 'os.path.join', 'os.path.join', (['GEOSCORER_DIR', '"""../"""'], {}), "(GEOSCORER_DIR, '../')\n", (309, 331), False, 'import os\n'), ((332, 364), 'sys.path.append', 'sys.path.append', (['CRAFTASSIST_DIR'], {}), '(CRAFTASSIST_DIR)\n', (347, 364), False, 'import sys\n'), ((251, 277), 'os.path.realpath', 'os... |
akbarszcz/CryptoAttacks | CryptoAttacks/tests/Block/test_gcm.py | ae675d016b314414a3dc9b23c7d8a32da4c62457 | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
import subprocess
from builtins import bytes, range
from os.path import abspath, dirname
from os.path import join as join_path
from random import randint
from CryptoAttacks.Block.gcm import *
from CryptoAttacks.Utils import log
def... | [((1698, 1746), 'builtins.bytes', 'bytes', (["b'hn9YA(F BW&B (W&&W(RT&WEF f7*WB FTgsdc'"], {}), "(b'hn9YA(F BW&B (W&&W(RT&WEF f7*WB FTgsdc')\n", (1703, 1746), False, 'from builtins import bytes, range\n'), ((1764, 1813), 'builtins.bytes', 'bytes', (["b'j gej8g0SRYH8s 8s9yf sgd78taDS* GASyd '"], {}), "(b'j gej8g0SRYH8s... |
jfsolarte/python_clean_architecture | python_clean_architecture/use_cases/orderdata_use_case.py | 56b0c0eff50bc98774a0caee12e3030789476687 | from python_clean_architecture.shared import use_case as uc
from python_clean_architecture.shared import response_object as res
class OrderDataGetUseCase(uc.UseCase):
def __init__(self, repo):
self.repo = repo
def execute(self, request_object):
#if not request_object:
#return res... | [((471, 505), 'python_clean_architecture.shared.response_object.ResponseSuccess', 'res.ResponseSuccess', (['storage_rooms'], {}), '(storage_rooms)\n', (490, 505), True, 'from python_clean_architecture.shared import response_object as res\n')] |
b-cube/OwsCapable | owscapable/swe/common.py | a01815418fe982434503d6542cb18e1ac8989684 | from __future__ import (absolute_import, division, print_function)
from owscapable.util import nspath_eval
from owscapable.namespaces import Namespaces
from owscapable.util import testXMLAttribute, testXMLValue, InfiniteDateTime, NegativeInfiniteDateTime
from dateutil import parser
from datetime import timedelta
fro... | [((384, 396), 'owscapable.namespaces.Namespaces', 'Namespaces', ([], {}), '()\n', (394, 396), False, 'from owscapable.namespaces import Namespaces\n'), ((504, 533), 'owscapable.util.nspath_eval', 'nspath_eval', (['path', 'namespaces'], {}), '(path, namespaces)\n', (515, 533), False, 'from owscapable.util import nspath_... |
gao969/scaffold-dgc-clustering | main_fed.py | 9f259dfdf0897dcb1dece2e1197268f585f54a69 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python version: 3.6
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import copy
import numpy as np
from torchvision import datasets, transforms
import torch
import os
import torch.distributed as dist
from utils.sampling import mnist_iid, mnist_non... | [((87, 108), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (101, 108), False, 'import matplotlib\n'), ((876, 889), 'utils.options.args_parser', 'args_parser', ([], {}), '()\n', (887, 889), False, 'from utils.options import args_parser\n'), ((953, 973), 'torch.manual_seed', 'torch.manual_seed', (... |
gkazla/B.LambdaLayerCommon | b_lambda_layer_common_test/integration/infrastructure/function_with_unit_tests.py | 1a4f9cd3d8b7e447c8467bd7dde50cb9e9a6e980 | from aws_cdk.aws_lambda import Function, Code, Runtime
from aws_cdk.core import Stack, Duration
from b_aws_testing_framework.tools.cdk_testing.testing_stack import TestingStack
from b_cfn_lambda_layer.package_version import PackageVersion
from b_lambda_layer_common.layer import Layer
from b_lambda_layer_common_test.un... | [((691, 712), 'aws_cdk.aws_lambda.Code.from_asset', 'Code.from_asset', (['root'], {}), '(root)\n', (706, 712), False, 'from aws_cdk.aws_lambda import Function, Code, Runtime\n'), ((813, 832), 'aws_cdk.core.Duration.minutes', 'Duration.minutes', (['(5)'], {}), '(5)\n', (829, 832), False, 'from aws_cdk.core import Stack,... |
neurips2020submission11699/metarl | tests/metarl/tf/baselines/test_baselines.py | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | """
This script creates a test that fails when
metarl.tf.baselines failed to initialize.
"""
import tensorflow as tf
from metarl.envs import MetaRLEnv
from metarl.tf.baselines import ContinuousMLPBaseline
from metarl.tf.baselines import GaussianMLPBaseline
from tests.fixtures import TfGraphTestCase
from tests.fixtures... | [((551, 590), 'metarl.tf.baselines.ContinuousMLPBaseline', 'ContinuousMLPBaseline', ([], {'env_spec': 'box_env'}), '(env_spec=box_env)\n', (572, 590), False, 'from metarl.tf.baselines import ContinuousMLPBaseline\n'), ((623, 660), 'metarl.tf.baselines.GaussianMLPBaseline', 'GaussianMLPBaseline', ([], {'env_spec': 'box_... |
trackit/trackit-legacy | api/files/api/app/monthly_report.py | 76cfab7941eddb9d390dd6c7b9a408a9ad4fc8da | import jinja2
import json
from send_email import send_email
from app.models import User, MyResourcesAWS, db
from app.es.awsdetailedlineitem import AWSDetailedLineitem
from sqlalchemy import desc
import subprocess
import datetime
from flask import render_template
def monthly_html_template():
template_dir = '/usr/tr... | [] |
rdturnermtl/mlpaper | slow_tests/boot_test.py | 5da5cb7b3a56d3cfdc7162d01fac2679c9050e76 | # Ryan Turner (turnerry@iro.umontreal.ca)
from __future__ import division, print_function
from builtins import range
import numpy as np
import scipy.stats as ss
import mlpaper.constants as cc
import mlpaper.mlpaper as bt
import mlpaper.perf_curves as pc
from mlpaper.classification import DEFAULT_NGRID, curve_boot
fr... | [((3118, 3152), 'numpy.zeros', 'np.zeros', (['DEFAULT_NGRID'], {'dtype': 'int'}), '(DEFAULT_NGRID, dtype=int)\n', (3126, 3152), True, 'import numpy as np\n'), ((3173, 3207), 'numpy.zeros', 'np.zeros', (['DEFAULT_NGRID'], {'dtype': 'int'}), '(DEFAULT_NGRID, dtype=int)\n', (3181, 3207), True, 'import numpy as np\n'), ((3... |
yuqil725/benchmark_lib | TTBenchmark/check_benchmark.py | f404ff829d7b3a8bb0f6b00689038cf533bba83e | def check_difference():
pass
def update_benchmark():
pass
| [] |
ajmal017/amp | core/test/test_timeseries_study.py | 8de7e3b88be87605ec3bad03c139ac64eb460e5c | from typing import Any, Dict
import numpy as np
import pandas as pd
import core.artificial_signal_generators as sig_gen
import core.statistics as stats
import core.timeseries_study as tss
import helpers.unit_test as hut
class TestTimeSeriesDailyStudy(hut.TestCase):
def test_usual_case(self) -> None:
idx... | [((323, 364), 'pandas.date_range', 'pd.date_range', (['"""2018-12-31"""', '"""2019-01-31"""'], {}), "('2018-12-31', '2019-01-31')\n", (336, 364), True, 'import pandas as pd\n'), ((419, 445), 'pandas.Series', 'pd.Series', (['vals'], {'index': 'idx'}), '(vals, index=idx)\n', (428, 445), True, 'import pandas as pd\n'), ((... |
takat0m0/infoGAN | util.py | bc3ba0d4e407851e97f49322add98ea2e7e429de | #! -*- coding:utf-8 -*-
import os
import sys
import cv2
import numpy as np
def _resizing(img):
#return cv2.resize(img, (256, 256))
return cv2.resize(img, (32, 32))
def _reg(img):
return img/127.5 - 1.0
def _re_reg(img):
return (img + 1.0) * 127.5
def get_figs(target_dir):
ret = []
for file_... | [((148, 173), 'cv2.resize', 'cv2.resize', (['img', '(32, 32)'], {}), '(img, (32, 32))\n', (158, 173), False, 'import cv2\n'), ((328, 350), 'os.listdir', 'os.listdir', (['target_dir'], {}), '(target_dir)\n', (338, 350), False, 'import os\n'), ((503, 536), 'numpy.asarray', 'np.asarray', (['ret'], {'dtype': 'np.float32'})... |
MutuaFranklin/MyHood | myhoodApp/migrations/0002_healthfacilities_hospital_image.py | 6ddd21c4a67936c8926d6f5a8665a06edf81f39e | # Generated by Django 3.2.7 on 2021-09-23 20:01
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('myhoodApp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='healthfacilities',
n... | [] |
ans682/SafePredict_and_Forecasting | forecasting_algorithms/Multiple_Timeseries/VAR/var.py | 30ac5a0b665fce090567476bc07b54489b2f3d0f | # VAR example
from statsmodels.tsa.vector_ar.var_model import VAR
from random import random
# contrived dataset with dependency
data = list()
for i in range(100):
v1 = i + random()
v2 = v1 + random()
row = [v1, v2]
data.append(row)
# fit model
model = VAR(data)
model_fit = model.fit()
# make prediction
... | [((268, 277), 'statsmodels.tsa.vector_ar.var_model.VAR', 'VAR', (['data'], {}), '(data)\n', (271, 277), False, 'from statsmodels.tsa.vector_ar.var_model import VAR\n'), ((176, 184), 'random.random', 'random', ([], {}), '()\n', (182, 184), False, 'from random import random\n'), ((199, 207), 'random.random', 'random', ([... |
jonykarki/hamroscraper | candidate-scrape.py | a7e34a9cdca89be10422d045f1ed34e9956bd75f | import json
import urllib.request
import MySQLdb
db = MySQLdb.connect(host="localhost", # your host, usually localhost
user="root", # your username
passwd="", # your password
db="election")
cur = db.cursor()
# user_agent for sending headers w... | [((54, 126), 'MySQLdb.connect', 'MySQLdb.connect', ([], {'host': '"""localhost"""', 'user': '"""root"""', 'passwd': '""""""', 'db': '"""election"""'}), "(host='localhost', user='root', passwd='', db='election')\n", (69, 126), False, 'import MySQLdb\n'), ((770, 788), 'json.loads', 'json.loads', (['source'], {}), '(sourc... |
ashiscs/sangita | sangita/hindi/lemmatizer.py | b90c49859339147137db1c2bdb60a1039a00c706 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 9 23:28:21 2017
@author: samriddhi
"""
import re
import sangita.hindi.tokenizer as tok
import sangita.hindi.corpora.lemmata as lt
def numericLemmatizer(instr):
lst = type([1,2,3])
tup = type(("Hello", "Hi"))
string = type("Hello")
... | [((337, 446), 're.compile', 're.compile', (['"""([०१२३४५६७८९]+[\\\\.\\\\,]*)+[०१२३४५६७८९]+|([-+]*\\\\d+[\\\\.\\\\,]*)+\\\\d+|([०१२३४५६७८९]+|\\\\d+)"""'], {}), "(\n '([०१२३४५६७८९]+[\\\\.\\\\,]*)+[०१२३४५६७८९]+|([-+]*\\\\d+[\\\\.\\\\,]*)+\\\\d+|([०१२३४५६७८९]+|\\\\d+)'\n )\n", (347, 446), False, 'import re\n'), ((167... |
ttobisawa/gsutil | gslib/tests/test_stet_util.py | ef665b590aa8e6cecfe251295bce8bf99ea69467 | # -*- coding: utf-8 -*-
# Copyright 2021 Google 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 require... | [((1122, 1181), 'mock.patch.object', 'mock.patch.object', (['execution_util', '"""ExecuteExternalCommand"""'], {}), "(execution_util, 'ExecuteExternalCommand')\n", (1139, 1181), False, 'import mock\n'), ((2265, 2324), 'mock.patch.object', 'mock.patch.object', (['execution_util', '"""ExecuteExternalCommand"""'], {}), "(... |
makyo/markdown-editing | markdown_editing/tests/test_extension.py | ecbc8970f4d416038f9d2c46fae22d4dbb79c647 | from markdown import markdown
from unittest import TestCase
from markdown_editing.extension import EditingExtension
class TestExtension(TestCase):
def test_substitution(self):
source = '~{out with the old}{in with the new}'
expected = '<p><span class="substitution"><del>out with the old</del><in... | [((518, 567), 'markdown.markdown', 'markdown', (['source'], {'extensions': "['markdown_editing']"}), "(source, extensions=['markdown_editing'])\n", (526, 567), False, 'from markdown import markdown\n'), ((401, 419), 'markdown_editing.extension.EditingExtension', 'EditingExtension', ([], {}), '()\n', (417, 419), False, ... |
thomasyi17/diana2 | apps/siren/test_handlers.py | 2167053dfe15b782d96cb1e695047433f302d4dd | """
SIREN/DIANA basic functionality testing framework
Requires env vars:
- GMAIL_USER
- GMAIL_APP_PASSWORD
- GMAIL_BASE_NAME -- ie, abc -> abc+hobitduke@gmail.com
These env vars are set to default:
- ORTHANC_PASSWORD
- SPLUNK_PASSWORD
- SPLUNK_HEC_TOKEN
TODO: Move stuff to archive after collected
TODO: Write data i... | [((3192, 3214), 'handlers.tagged_studies.clear', 'tagged_studies.clear', ([], {}), '()\n', (3212, 3214), False, 'from handlers import handle_upload_dir, handle_upload_zip, handle_notify_study, handle_file_arrived, start_watcher, tagged_studies\n'), ((3510, 3532), 'handlers.tagged_studies.clear', 'tagged_studies.clear',... |
jeking3/boost-deptree | deptree.py | 27eda54df2d022af17347df4ba4892c39392e474 | #
# Copyright (c) 2019 James E. King III
#
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
#
import json
import networkx
import re
from pathlib import Path
class BoostDependencyT... | [((5939, 6012), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate PlantUML dependency tree."""'}), "(description='Generate PlantUML dependency tree.')\n", (5962, 6012), False, 'import argparse\n'), ((6464, 6479), 'pathlib.Path', 'Path', (['args.root'], {}), '(args.root)\n', (6468, ... |
adiHusky/uber_backend | uberbackend.py | adc78882c081f7636b809d6e1889ba3297309e20 | from flask import Flask, flash, request, jsonify, render_template, redirect, url_for, g, session, send_from_directory, abort
from flask_cors import CORS
# from flask import status
from datetime import date, datetime, timedelta
from calendar import monthrange
from dateutil.parser import parse
import pytz
import os
impor... | [((1658, 1750), 'pymongo.MongoClient', 'MongoClient', (['"""mongodb+srv://Mahitha-Maddi:Mahitha%4042@cluster0.1z0g8.mongodb.net/test"""'], {}), "(\n 'mongodb+srv://Mahitha-Maddi:Mahitha%4042@cluster0.1z0g8.mongodb.net/test')\n", (1669, 1750), False, 'from pymongo import MongoClient\n'), ((1758, 1773), 'flask.Flask',... |
mirfan899/MTTS | sppas/sppas/src/models/acm/htkscripts.py | 3167b65f576abcc27a8767d24c274a04712bd948 | """
..
---------------------------------------------------------------------
___ __ __ __ ___
/ | \ | \ | \ / the automatic
\__ |__/ |__/ |___| \__ annotation and
\ | | | | \ analysis
___/... | [((2586, 2609), 'os.path.exists', 'os.path.exists', (['dirname'], {}), '(dirname)\n', (2600, 2609), False, 'import os\n'), ((2632, 2649), 'os.mkdir', 'os.mkdir', (['dirname'], {}), '(dirname)\n', (2640, 2649), False, 'import os\n'), ((2681, 2716), 'os.path.join', 'os.path.join', (['dirname', '"""global.ded"""'], {}), "... |
ic-labs/django-icekit | icekit/plugins/map/tests.py | c507ea5b1864303732c53ad7c5800571fca5fa94 | from mock import patch
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
from django.core import exceptions
from django_dynamic_fixture import G
from django_webtest import WebTest
from icekit.models import Layout
from... | [((447, 463), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (461, 463), False, 'from django.contrib.auth import get_user_model\n'), ((1461, 1515), 'django_dynamic_fixture.G', 'G', (['Layout'], {'template_name': '"""icekit/layouts/default.html"""'}), "(Layout, template_name='icekit/layouts/de... |
saravanabalagi/imshowtools | example/example.py | ea81af888c69223ff8b42b5c4b8c034483eebe21 | from imshowtools import imshow
import cv2
if __name__ == '__main__':
image_lenna = cv2.imread("lenna.png")
imshow(image_lenna, mode='BGR', window_title="LennaWindow", title="Lenna")
image_lenna_bgr = cv2.imread("lenna_bgr.png")
imshow(image_lenna, image_lenna_bgr, mode=['BGR', 'RGB'], title=['lenna_... | [((90, 113), 'cv2.imread', 'cv2.imread', (['"""lenna.png"""'], {}), "('lenna.png')\n", (100, 113), False, 'import cv2\n'), ((118, 192), 'imshowtools.imshow', 'imshow', (['image_lenna'], {'mode': '"""BGR"""', 'window_title': '"""LennaWindow"""', 'title': '"""Lenna"""'}), "(image_lenna, mode='BGR', window_title='LennaWin... |
amehta1/t1-python | terminalone/models/concept.py | 4f7eb0bec7671b29baf3105b8cafafb373107e7b | # -*- coding: utf-8 -*-
"""Provides concept object."""
from __future__ import absolute_import
from .. import t1types
from ..entity import Entity
class Concept(Entity):
"""Concept entity."""
collection = 'concepts'
resource = 'concept'
_relations = {
'advertiser',
}
_pull = {
'... | [] |
dmeklund/asyncdemo | videofeed.py | 956f193c0fa38744965362966ac7f8ef224409b4 | """
Mock up a video feed pipeline
"""
import asyncio
import logging
import sys
import cv2
logging.basicConfig(format="[%(thread)-5d]%(asctime)s: %(message)s")
logger = logging.getLogger('async')
logger.setLevel(logging.INFO)
async def process_video(filename):
cap = cv2.VideoCapture(filename)
tasks = list()
... | [((92, 160), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""[%(thread)-5d]%(asctime)s: %(message)s"""'}), "(format='[%(thread)-5d]%(asctime)s: %(message)s')\n", (111, 160), False, 'import logging\n'), ((170, 196), 'logging.getLogger', 'logging.getLogger', (['"""async"""'], {}), "('async')\n", (187, 1... |
mikeus9908/peracotta | parsers/read_lspci_and_glxinfo.py | c54c351acae8afec250185f4bc714a2f86c47c90 | #!/usr/bin/python3
"""
Read "lspci -v" and "glxinfo" outputs
"""
import re
from dataclasses import dataclass
from InputFileNotFoundError import InputFileNotFoundError
@dataclass
class VideoCard:
type = "graphics-card"
manufacturer_brand = ""
reseller_brand = ""
internal_name = ""
model = ""
... | [((11116, 11181), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Parse lspci/glxinfo output"""'}), "(description='Parse lspci/glxinfo output')\n", (11139, 11181), False, 'import argparse\n'), ((577, 611), 'InputFileNotFoundError.InputFileNotFoundError', 'InputFileNotFoundError', (['lspci... |
snymainn/tools- | upload.py | af57a1a4d0f1aecff33ab28c6f27acc893f37fbc | #!/usr/bin/python
import sys
from loglib import SNYLogger
import ftplib
import argparse
import re
import os
import calendar
import time
def read_skipfile(infile, log):
skiplines = list()
skipfile = open(infile, 'r')
for line in skipfile:
newline = line.rstrip('\r\n')
linelength = len(... | [] |
chris-zen/phd-thesis | chapter2/intogen-arrays/src/mrna/mrna_comb_gene_classif.py | 1eefdff8e7ca1910304e27ae42551dc64496b101 | #!/usr/bin/env python
"""
Classify oncodrive gene results and prepare for combination
* Configuration parameters:
- The ones required by intogen.data.entity.EntityManagerFactory
* Input:
- oncodrive_ids: The mrna.oncodrive_genes to process
* Output:
- combinations: The mrna.combination prepared to be calculated
... | [((849, 879), 'intogen.data.entity.server.EntityServer', 'EntityServer', (["conf['entities']"], {}), "(conf['entities'])\n", (861, 879), False, 'from intogen.data.entity.server import EntityServer\n'), ((2006, 2030), 'wok.element.DataElement', 'DataElement', ([], {'key_sep': '"""/"""'}), "(key_sep='/')\n", (2017, 2030)... |
CDCgov/prime-public-health-data-infrastructure | src/FunctionApps/DevOps/tests/test_get_ip.py | 7e4849c3a486a84e94765bf0023b80261c510c57 | def test_get_ip_placeholder():
"""placeholder so pytest does not fail"""
pass
| [] |
Laurenhut/Machine_Learning_Final | data/models/svm_benchmark.py | 4fca33754ef42acde504cc64e6bbe4e463caadf8 | #!/usr/bin/env python
from sklearn import svm
import csv_io
def main():
training, target = csv_io.read_data("../Data/train.csv")
training = [x[1:] for x in training]
target = [float(x) for x in target]
test, throwaway = csv_io.read_data("../Data/test.csv")
test = [x[1:] for x in test]
svc = s... | [] |
user-wu/SOD_eval_metrics | configs/utils/config_generator.py | d5b8804580cb52a4237c8e613818d10591dc6597 | # -*- coding: utf-8 -*-
from matplotlib import colors
# max = 148
_COLOR_Genarator = iter(
sorted(
[
color
for name, color in colors.cnames.items()
if name not in ["red", "white"] or not name.startswith("light") or "gray" in name
]
)
)
def curve_info_gener... | [((164, 185), 'matplotlib.colors.cnames.items', 'colors.cnames.items', ([], {}), '()\n', (183, 185), False, 'from matplotlib import colors\n')] |
kartik1000/jcc-registration-portal | core/sms_service.py | 053eade1122fa760ae112a8599a396d68dfb16b8 | from urllib.parse import urlencode
from decouple import config
import hashlib
import requests
BASE = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
auth_key = config('AUTH_KEY')
url = 'http://sms.globehost.com/api/sendhttp.php?'
def encode_base(num, array=BASE):
if(num == 0):
return arr... | [((178, 196), 'decouple.config', 'config', (['"""AUTH_KEY"""'], {}), "('AUTH_KEY')\n", (184, 196), False, 'from decouple import config\n'), ((1026, 1041), 'urllib.parse.urlencode', 'urlencode', (['data'], {}), '(data)\n', (1035, 1041), False, 'from urllib.parse import urlencode\n'), ((1050, 1082), 'requests.get', 'requ... |
Protagonistss/sanic-for-v3 | scripts/fetch_images.py | ba7e94273b77914b8d85d67cf513041ada00780d | import sys
import os
sys.path.append(os.pardir)
import random
import time
import requests
from contextlib import closing
from help import utils
from threading import Thread
def get_train_set_path(path: str):
create_path = utils.join_root_path(path)
return create_path
def create_train_set_dir(path='auth-se... | [((22, 48), 'sys.path.append', 'sys.path.append', (['os.pardir'], {}), '(os.pardir)\n', (37, 48), False, 'import sys\n'), ((230, 256), 'help.utils.join_root_path', 'utils.join_root_path', (['path'], {}), '(path)\n', (250, 256), False, 'from help import utils\n'), ((385, 412), 'os.path.exists', 'os.path.exists', (['crea... |
haoruilee/statslibrary | GeneralStats/example.py | 01494043bc7fb82d4aa6d7d550a4e7dc2ac0503a | import GeneralStats as gs
import numpy as np
from scipy.stats import skew
from scipy.stats import kurtosistest
import pandas as pd
if __name__ == "__main__":
gen=gs.GeneralStats()
data=np.array([[1, 1, 2, 2, 3],[2, 2, 3, 3, 5],[1, 4, 3, 3, 3],[2, 4, 5, 5, 3]])
data1=np.array([1,2,3,4,5])
... | [((178, 195), 'GeneralStats.GeneralStats', 'gs.GeneralStats', ([], {}), '()\n', (193, 195), True, 'import GeneralStats as gs\n'), ((208, 286), 'numpy.array', 'np.array', (['[[1, 1, 2, 2, 3], [2, 2, 3, 3, 5], [1, 4, 3, 3, 3], [2, 4, 5, 5, 3]]'], {}), '([[1, 1, 2, 2, 3], [2, 2, 3, 3, 5], [1, 4, 3, 3, 3], [2, 4, 5, 5, 3]]... |
tqchen/yarn-ec2 | bootstrap.py | 303f3980ad41770011b72532ed9f7c6bbe876508 | #!/usr/bin/env python
# encoding: utf-8
"""
script to install all the necessary things
for working on a linux machine with nothing
Installing minimum dependencies
"""
import sys
import os
import logging
import subprocess
import xml.etree.ElementTree as ElementTree
import xml.dom.minidom as minidom
import socket
import... | [] |
zmoon/scipy-lecture-notes | intro/matplotlib/examples/plot_good.py | 75a89ddedeb48930dbdb6fe25a76e9ef0587ae21 | """
A simple, good-looking plot
===========================
Demoing some simple features of matplotlib
"""
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(5, 4), dpi=72)
axes = fig.add_axes([0.01, 0.01, .98, 0.98])
X = np.linspace(0, 2, 200)
Y = np... | [((146, 167), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (160, 167), False, 'import matplotlib\n'), ((207, 241), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(5, 4)', 'dpi': '(72)'}), '(figsize=(5, 4), dpi=72)\n', (217, 241), True, 'import matplotlib.pyplot as plt\n'), ((291, 3... |
HiroakiMikami/pfio | pfio/_context.py | 1ac997dcba7babd5d91dd8c4f2793d27a6bab69b | import os
import re
from typing import Tuple
from pfio._typing import Union
from pfio.container import Container
from pfio.io import IO, create_fs_handler
class FileSystemDriverList(object):
def __init__(self):
# TODO(tianqi): dynamically create this list
# as well as the patterns upon loading th... | [((409, 446), 're.compile', 're.compile', (['"""file:\\\\/\\\\/(?P<path>.+)"""'], {}), "('file:\\\\/\\\\/(?P<path>.+)')\n", (419, 446), False, 'import re\n'), ((474, 511), 're.compile', 're.compile', (['"""(?P<path>hdfs:\\\\/\\\\/.+)"""'], {}), "('(?P<path>hdfs:\\\\/\\\\/.+)')\n", (484, 511), False, 'import re\n'), ((1... |
Josue-Zea/tytus | parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/Ifpl.py | f9e4be9a8c03eb698fade7a748972e4f52d46685 | import Analisis_Ascendente.Instrucciones.PLPGSQL.EjecutarFuncion as EjecutarFuncion
from Analisis_Ascendente.Instrucciones.PLPGSQL.plasignacion import Plasignacion
from Analisis_Ascendente.Instrucciones.instruccion import Instruccion
from Analisis_Ascendente.Instrucciones.Create.createTable import CreateTable
from ... | [((7347, 7382), 'C3D.GeneradorEtiquetas.nueva_etiqueta', 'GeneradorEtiquetas.nueva_etiqueta', ([], {}), '()\n', (7380, 7382), True, 'import C3D.GeneradorEtiquetas as GeneradorEtiquetas\n'), ((7408, 7443), 'C3D.GeneradorEtiquetas.nueva_etiqueta', 'GeneradorEtiquetas.nueva_etiqueta', ([], {}), '()\n', (7441, 7443), True,... |
vilkasgroup/epages_client | epages_client/dataobjects/enum_fetch_operator.py | 10e63d957ee45dc5d4df741064806f724fb1be1f | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
class FetchOperator(object):
'''Defines values for fetch operators'''
ADD = 1
REMOVE = 2
REPLACE = 3
| [] |
orca-eaa5a/dokkaebi_scanner | pyhwpscan/hwp_scan.py | 756314376e2cbbce6c03fd908ebd0b8cc27aa7fc | from threading import current_thread
from jsbeautifier.javascript.beautifier import remove_redundant_indentation
from pyparser.oleparser import OleParser
from pyparser.hwp_parser import HwpParser
from scan.init_scan import init_hwp5_scan
from scan.bindata_scanner import BinData_Scanner
from scan.jscript_scanner import... | [((957, 973), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (966, 973), False, 'import os\n'), ((992, 1010), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (1001, 1010), False, 'import os\n'), ((3501, 3520), 'platform.platform', 'platform.platform', ([], {}), '()\n', (3518, 3520), False, ... |
franalgaba/nile | tests/core/test_plugins.py | f771467f27f03c8d20b8032bac64b3ab60436d3c | """
Tests for plugins in core module.
Only unit tests for now.
"""
from unittest.mock import patch
import click
from nile.core.plugins import get_installed_plugins, load_plugins, skip_click_exit
def test_skip_click_exit():
def dummy_method(a, b):
return a + b
dummy_result = dummy_method(1, 2)
... | [((333, 362), 'nile.core.plugins.skip_click_exit', 'skip_click_exit', (['dummy_method'], {}), '(dummy_method)\n', (348, 362), False, 'from nile.core.plugins import get_installed_plugins, load_plugins, skip_click_exit\n'), ((846, 859), 'click.group', 'click.group', ([], {}), '()\n', (857, 859), False, 'import click\n'),... |
Open-Source-eUdeC/UdeCursos-bot | commands/source.py | f900073044e1c74532af532618672501c0a43a13 | async def source(update, context):
source_code = "https://github.com/Open-Source-eUdeC/UdeCursos-bot"
await context.bot.send_message(
chat_id=update.effective_chat.id,
text=(
"*UdeCursos bot v2.0*\n\n"
f"Código fuente: [GitHub]({source_code})"
),
parse_mod... | [] |
MPIB/Lagerregal | history/tests.py | 3c950dffcf4fa164008c5a304c4839bc282a3388 | from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django.test.client import Client
from model_mommy import mommy
from devices.models import Device
from users.models import Lageruser
class HistoryTests(TestCase):
def setUp(self):
self.client = Client()
... | [((306, 314), 'django.test.client.Client', 'Client', ([], {}), '()\n', (312, 314), False, 'from django.test.client import Client\n'), ((336, 403), 'users.models.Lageruser.objects.create_superuser', 'Lageruser.objects.create_superuser', (['"""test"""', '"""test@test.com"""', '"""test"""'], {}), "('test', 'test@test.com'... |
spapas/django-git | django_git_info/management/commands/get_git_info.py | a62215d315263bce5d5d0afcfa14152601f76901 | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from django_git_info import get_git_info
class Command(BaseCommand):
help = 'Gets git info'
#@transaction.commit_manually
def handle(self, *args, **options):
info = get_git_info()
for key in info.ke... | [] |
robert-haas/mevis | mevis/_internal/conversion.py | 1bbf8dfb56aa8fc52b8f38c570ee7b2d2a9d3327 | from collections.abc import Callable as _Callable
import networkx as _nx
from opencog.type_constructors import AtomSpace as _AtomSpace
from .args import check_arg as _check_arg
def convert(data, graph_annotated=True, graph_directed=True,
node_label=None, node_color=None, node_opacity=None, node_size=Non... | [((9626, 9639), 'networkx.DiGraph', '_nx.DiGraph', ([], {}), '()\n', (9637, 9639), True, 'import networkx as _nx\n'), ((9663, 9674), 'networkx.Graph', '_nx.Graph', ([], {}), '()\n', (9672, 9674), True, 'import networkx as _nx\n')] |
seandstewart/typical-pycharm-plugin | testData/completion/classMethodCls.py | 4f6ec99766239421201faae9d75c32fa0ee3565a | from builtins import *
from pydantic import BaseModel
class A(BaseModel):
abc: str
@classmethod
def test(cls):
return cls.<caret>
| [] |
b-com/watcher-metering | watcher_metering/tests/agent/test_agent.py | 7c09b243347146e5a421700d5b07d1d0a5c4d604 | # -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# 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... | [((5908, 5944), 'mock.patch.object', 'patch.object', (['Measurement', '"""as_dict"""'], {}), "(Measurement, 'as_dict')\n", (5920, 5944), False, 'from mock import patch\n'), ((6748, 6791), 'mock.patch.object', 'patch.object', (['DummyMetricPuller', '"""is_alive"""'], {}), "(DummyMetricPuller, 'is_alive')\n", (6760, 6791... |
ndevenish/cctbx_project | mmtbx/bulk_solvent/mosaic.py | 1f1a2627ae20d01d403f367948e7269cef0f0217 | from __future__ import absolute_import, division, print_function
from cctbx.array_family import flex
from scitbx import matrix
import math
from libtbx import adopt_init_args
import scitbx.lbfgs
from mmtbx.bulk_solvent import kbu_refinery
from cctbx import maptbx
import mmtbx.masks
import boost_adaptbx.boost.python as b... | [((336, 377), 'boost_adaptbx.boost.python.import_ext', 'bp.import_ext', (['"""cctbx_asymmetric_map_ext"""'], {}), "('cctbx_asymmetric_map_ext')\n", (349, 377), True, 'import boost_adaptbx.boost.python as bp\n'), ((662, 694), 'boost_adaptbx.boost.python.import_ext', 'bp.import_ext', (['"""mmtbx_masks_ext"""'], {}), "('m... |
lmatz/mars | mars/tensor/execution/tests/test_base_execute.py | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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-... | [((1394, 1411), 'mars.tensor.execution.core.Executor', 'Executor', (['"""numpy"""'], {}), "('numpy')\n", (1402, 1411), False, 'from mars.tensor.execution.core import Executor\n'), ((1463, 1488), 'numpy.random.random', 'np.random.random', (['(11, 8)'], {}), '((11, 8))\n', (1479, 1488), True, 'import numpy as np\n'), ((1... |
drumpt/Co-Mixup | comix-imagenet/init_paths.py | 4c43f0ec873ce6c1e8ab446c7cb9e25089b9b91a | import sys
import matplotlib
matplotlib.use('Agg')
sys.path.insert(0, 'lib')
| [((29, 50), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (43, 50), False, 'import matplotlib\n'), ((51, 76), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""lib"""'], {}), "(0, 'lib')\n", (66, 76), False, 'import sys\n')] |
kcotar/Gaia_clusters_potential | members_abundances_in_out_uncertainties.py | aee2658c40446891d31528f8dec3cec899b63c68 | import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
from glob import glob
from astropy.table import Table, join
from os import chdir, system
from scipy.stats import norm as gauss_norm
from sys import argv
from getopt import getopt
# turn off polyfit ranking warnings
import warnin... | [((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((323, 356), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (346, 356), False, 'import warnings\n'), ((4237, 4302), 'astropy.table.Table.read', 'Table... |
donno2048/python-minifier | src/python_minifier/transforms/remove_pass.py | 9a9ff4dd5d2bb8dc666cae5939c125d420c2ffd5 | import ast
from python_minifier.transforms.suite_transformer import SuiteTransformer
class RemovePass(SuiteTransformer):
"""
Remove Pass keywords from source
If a statement is syntactically necessary, use an empty expression instead
"""
def __call__(self, node):
return self.visit(node)
... | [((649, 659), 'ast.Num', 'ast.Num', (['(0)'], {}), '(0)\n', (656, 659), False, 'import ast\n')] |
gzu300/Linear_Algebra | test/tests.py | 437a285b0230f4da8b0573b04da32ee965b09233 | import unittest
from pkg import Linear_Algebra
import numpy as np
class TestLU(unittest.TestCase):
def setUp(self):
self.U_answer = np.around(np.array([[2,1,0],[0,3/2,1],[0,0,4/3]], dtype=float), decimals=2).tolist()
self.L_answer = np.around(np.array([[1,0,0],[1/2,1,0],[0,2/3,1]], dtype=float), de... | [((1199, 1214), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1212, 1214), False, 'import unittest\n'), ((883, 972), 'numpy.array', 'np.array', (['[[2, -1, 0, 0], [-1, 2, -1, 0], [0, -1, 2, -1], [0, 0, -1, 2]]'], {'dtype': 'float'}), '([[2, -1, 0, 0], [-1, 2, -1, 0], [0, -1, 2, -1], [0, 0, -1, 2]],\n dtype=fl... |
ofekashery/the-blue-alliance | src/backend/common/models/favorite.py | df0e47d054161fe742ac6198a6684247d0713279 | from backend.common.models.mytba import MyTBAModel
class Favorite(MyTBAModel):
"""
In order to make strongly consistent DB requests, instances of this class
should be created with a parent that is the associated Account key.
"""
def __init__(self, *args, **kwargs):
super(Favorite, self)._... | [] |
MontyThibault/centre-of-mass-awareness | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/lib/filebrowsebutton.py | 58778f148e65749e1dfc443043e9fc054ca3ff4d | #----------------------------------------------------------------------
# Name: wxPython.lib.filebrowsebutton
# Purpose: Composite controls that provide a Browse button next to
# either a wxTextCtrl or a wxComboBox. The Browse button
# launches a wxFileDialog and loads the result i... | [] |
whanderley/eden | modules/pygsm/devicewrapper.py | 08ced3be3d52352c54cbd412ed86128fbb68b1d2 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
# arch: pacman -S python-pyserial
# debian/ubuntu: apt-get install python-serial
import serial
import re
import errors
class DeviceWrapper(object):
def __init__(self, logger, *args, **kwargs):
self.device = serial.Serial(*args, **kwarg... | [((292, 322), 'serial.Serial', 'serial.Serial', (['*args'], {}), '(*args, **kwargs)\n', (305, 322), False, 'import serial\n'), ((3328, 3372), 're.match', 're.match', (['"""^\\\\+(CM[ES]) ERROR: (\\\\d+)$"""', 'buf'], {}), "('^\\\\+(CM[ES]) ERROR: (\\\\d+)$', buf)\n", (3336, 3372), False, 'import re\n'), ((1869, 1903), ... |
alqmy/The-Garage-Summer-Of-Code | day1/loops.py | af310d5e5194a62962db2fc1e601099468251efa | # while True:
# # ejecuta esto
# print("Hola")
real = 7
print("Entre un numero entre el 1 y el 10")
guess = int(input())
# =/=
while guess != real:
print("Ese no es el numero")
print("Entre un numero entre el 1 y el 10")
guess = int(input())
# el resto
print("Yay! Lo sacastes!")
| [] |
paulveillard/cybersecurity-penetration-testing | pentest-scripts/learning-python-for-forensics/Chapter 6/rot13.py | a5afff13ec25afd0cf16ef966d35bddb91518af4 | def rotCode(data):
"""
The rotCode function encodes/decodes data using string indexing
:param data: A string
:return: The rot-13 encoded/decoded string
"""
rot_chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', '... | [] |
sunyilgdx/CwVW-SIF | examples/sim_tfidf.py | 85ef56d80512e2f6bff1266e030552075566b240 | import pickle, sys
sys.path.append('../src')
import data_io, sim_algo, eval, params
## run
# wordfiles = [#'../data/paragram_sl999_small.txt', # need to download it from John Wieting's github (https://github.com/jwieting/iclr2016)
# '../data/glove.840B.300d.txt' # need to download it first
# ]
wordfiles = [#... | [((19, 44), 'sys.path.append', 'sys.path.append', (['"""../src"""'], {}), "('../src')\n", (34, 44), False, 'import pickle, sys\n'), ((704, 719), 'params.params', 'params.params', ([], {}), '()\n', (717, 719), False, 'import data_io, sim_algo, eval, params\n'), ((795, 823), 'data_io.getWordmap', 'data_io.getWordmap', ([... |
div72/py2many | tests/cases/cls.py | 60277bc13597bd32d078b88a7390715568115fc6 | class Foo:
def bar(self):
return "a"
if __name__ == "__main__":
f = Foo()
b = f.bar()
print(b) | [] |
jhja/RFNN | theano-rfnn/mnist_loader.py | a63641d6e584df743a5e0a9efaf41911f057a977 | import numpy as np
import os
from random import shuffle
datasets_dir = './../data/'
def one_hot(x,n):
if type(x) == list:
x = np.array(x)
x = x.flatten()
o_h = np.zeros((len(x),n))
o_h[np.arange(len(x)),x] = 1
return o_h
def mnist(ntrain=60000,ntest=10000,onehot=True):
ntrain=np.array(ntrain).astype(int).s... | [((344, 380), 'os.path.join', 'os.path.join', (['datasets_dir', '"""mnist/"""'], {}), "(datasets_dir, 'mnist/')\n", (356, 380), False, 'import os\n'), ((457, 493), 'numpy.fromfile', 'np.fromfile', ([], {'file': 'fd', 'dtype': 'np.uint8'}), '(file=fd, dtype=np.uint8)\n', (468, 493), True, 'import numpy as np\n'), ((630,... |
crltsnch/Ejercicios-grupales | Ejercicio 2.py | 72e01d6489816ea1b9308af1abd62792e5464c93 | import math
import os
import random
import re
import sys
def compareTriplets(a, b):
puntosA=0
puntosB=0
for i in range (0,3):
if a[i]<b[i]:
puntosB+=1
elif a[i]>b[i]:
puntosA+=1
puntosTotales=[puntosA, puntosB]
return puntosTotales
if __name__ == '__mai... | [] |
nityagautam/ReportDashboard-backend | app/routes/router.py | d23fe008cb0df6a703fcd665181897a75b71d5b2 | #===============================================================
# @author: nityanarayan44@live.com
# @written: 08 December 2021
# @desc: Routes for the Backend server
#===============================================================
# Import section with referecne of entry file or main file;
from __main__ i... | [((675, 718), '__main__.application.route', 'application.route', (['"""/test"""'], {'methods': "['GET']"}), "('/test', methods=['GET'])\n", (692, 718), False, 'from __main__ import application\n'), ((787, 826), '__main__.application.route', 'application.route', (['"""/"""'], {'methods': "['GET']"}), "('/', methods=['GE... |
carldlaird/idaes-pse | idaes/generic_models/properties/core/examples/ASU_PR.py | cc7a32ca9fa788f483fa8ef85f3d1186ef4a596f | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | [((2492, 2519), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2509, 2519), False, 'import logging\n')] |
bellanov/calculator | tests/functional/test_calculator.py | a66e68a368a5212247aeff3291c9cb8b508e91be | """TODO: Move the Threads Here"""
| [] |
Sette/autokeras | autokeras/hypermodel/graph.py | c5a83607a899ad545916b3794561d6908d9cdbac | import functools
import pickle
import kerastuner
import tensorflow as tf
from tensorflow.python.util import nest
from autokeras.hypermodel import base
from autokeras.hypermodel import compiler
class Graph(kerastuner.engine.stateful.Stateful):
"""A graph consists of connected Blocks, HyperBlocks, Preprocessors o... | [((780, 800), 'tensorflow.python.util.nest.flatten', 'nest.flatten', (['inputs'], {}), '(inputs)\n', (792, 800), False, 'from tensorflow.python.util import nest\n'), ((824, 845), 'tensorflow.python.util.nest.flatten', 'nest.flatten', (['outputs'], {}), '(outputs)\n', (836, 845), False, 'from tensorflow.python.util impo... |
shreyventure/LeetCode-Solutions | Python/longest-valid-parentheses.py | 74423d65702b78974e390f17c9d6365d17e6eed5 | '''
Speed: 95.97%
Memory: 24.96%
Time complexity: O(n)
Space complexity: O(n)
'''
class Solution(object):
def longestValidParentheses(self, s):
ans=0
stack=[-1]
for i in range(len(s)):
if(s[i]=='('):
stack.append(i)
else:
stack.pop()
... | [] |
i25ffz/openaes | setup.py | a0dbde40d4ce0e4186ea14c4dc9519fe152c018c | from distutils.core import setup, Extension
import os.path
kw = {
'name':"PyOpenAES",
'version':"0.10.0",
'description':"OpenAES cryptographic library for Python.",
'ext_modules':[
Extension(
'openaes',
include_dirs = ['inc', 'src/isaac'],
# define_macros=[('ENABLE_PYTHON', '1')],
sources = [
os.... | [((436, 447), 'distutils.core.setup', 'setup', ([], {}), '(**kw)\n', (441, 447), False, 'from distutils.core import setup, Extension\n')] |
jayvdb/scitools | examples/isosurface_demo2.py | 8df53a3a3bc95377f9fa85c04f3a329a0ec33e67 | #!/usr/bin/env python
# Example taken from:
# http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/f5-3371.html
from scitools.easyviz import *
from time import sleep
from scipy import io
setp(interactive=False)
# Displaying an Isosurface:
mri = io.loadmat('mri_matlab_v6.mat')
D = mri['D']
#Ds = smooth3(D... | [((260, 291), 'scipy.io.loadmat', 'io.loadmat', (['"""mri_matlab_v6.mat"""'], {}), "('mri_matlab_v6.mat')\n", (270, 291), False, 'from scipy import io\n')] |
zibneuro/udvary-et-al-2022 | structural_model/util_morphology.py | 8b456c41e72958677cb6035028d9c23013cb7c7e | import os
import numpy as np
import json
import util_amira
def getEdgeLabelName(label):
if(label == 6):
return "axon"
elif(label == 4):
return "apical"
elif(label == 5):
return "basal"
elif(label == 7):
return "soma"
else:
return "other"
def getSomaPositio... | [((2638, 2684), 'numpy.savetxt', 'np.savetxt', (['transformationFile', 'transformation'], {}), '(transformationFile, transformation)\n', (2648, 2684), True, 'import numpy as np\n'), ((3140, 3170), 'numpy.loadtxt', 'np.loadtxt', (['transformationFile'], {}), '(transformationFile)\n', (3150, 3170), True, 'import numpy as... |
FAIR-Data-Austria/invenio-madmp | invenio_madmp/views.py | 74372ee794f81666f5e9cf08ef448c21b2e428be | """Blueprint definitions for maDMP integration."""
from flask import Blueprint, jsonify, request
from invenio_db import db
from .convert import convert_dmp
from .models import DataManagementPlan
def _summarize_dmp(dmp: DataManagementPlan) -> dict:
"""Create a summary dictionary for the given DMP."""
res = {... | [((965, 1001), 'flask.Blueprint', 'Blueprint', (['"""invenio_madmp"""', '__name__'], {}), "('invenio_madmp', __name__)\n", (974, 1001), False, 'from flask import Blueprint, jsonify, request\n'), ((1312, 1324), 'flask.jsonify', 'jsonify', (['res'], {}), '(res)\n', (1319, 1324), False, 'from flask import Blueprint, jsoni... |
aipassio/visual_retrieval | retrieval/urls.py | ce8dae2ad517a9edb5e278163dd6d0f7ffc1b5f4 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('retrieval_insert', views.retrieval_insert, name='retrieval_insert'),
path('retrieval_get', views.retrieval_get, name='retrieval_get')
] | [((71, 106), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (75, 106), False, 'from django.urls import path\n'), ((112, 185), 'django.urls.path', 'path', (['"""retrieval_insert"""', 'views.retrieval_insert'], {'name': '"""retrieval_insert"""'}), "(... |
noshluk2/Wifi-Signal-Robot-localization | scripts/Interfacing/encoder_class.py | 538e6c4e7a63486f22ab708908c476cd808f720c | import RPi.GPIO as GPIO
import threading
class Encoder(object):
def __init__(self, r_en_a,r_en_b,l_en_a,l_en_b):
GPIO.setmode(GPIO.BCM)
GPIO.setup(r_en_a, GPIO.IN)
GPIO.setup(r_en_b, GPIO.IN)
GPIO.setup(l_en_a, GPIO.IN)
GPIO.setup(l_en_b, GPIO.IN)
self.l_en_a=l_en_a;... | [((126, 148), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (138, 148), True, 'import RPi.GPIO as GPIO\n'), ((157, 184), 'RPi.GPIO.setup', 'GPIO.setup', (['r_en_a', 'GPIO.IN'], {}), '(r_en_a, GPIO.IN)\n', (167, 184), True, 'import RPi.GPIO as GPIO\n'), ((193, 220), 'RPi.GPIO.setup', 'GPIO.setu... |
systori/systori | systori/apps/equipment/urls.py | e309c63e735079ff6032fdaf1db354ec872b28b1 | from django.conf.urls import url
from django.urls import path, include
from systori.apps.user.authorization import office_auth
from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, Mai... | [((500, 527), 'systori.apps.equipment.views.EquipmentListView.as_view', 'EquipmentListView.as_view', ([], {}), '()\n', (525, 527), False, 'from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStop... |
MRXLT/PaddleHub | paddlehub/module/check_info_pb2.py | a9cd941bef2ac5a2d81b2f20422a4fbd9a87eb90 | #coding:utf-8
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: check_info.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protob... | [((558, 584), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (582, 584), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((2503, 2548), 'google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper', 'enum_type_wrapper.EnumTypeWrapper', (['_FILE_TYPE']... |
rursvd/pynumerical2 | 40_3.py | 4b2d33125b64a39099ac8eddef885e0ea11b237d | from numpy import zeros
# Define ab2 function
def ab2(f,t0,tf,y0,n):
h = (tf - t0)/n
t = zeros(n+1)
y = zeros(n+1)
t[0] = t0
y[0] = y0
y[1] = y[0] + h * f(t[0],y[0])
t[1] = t[0] + h
for i in range(1,n):
y[i+1] = y[i] + (3.0/2.0) * h * f(t[i],y[i])-1.0/2.0 * h * f(t[i-1]... | [((99, 111), 'numpy.zeros', 'zeros', (['(n + 1)'], {}), '(n + 1)\n', (104, 111), False, 'from numpy import zeros\n'), ((118, 130), 'numpy.zeros', 'zeros', (['(n + 1)'], {}), '(n + 1)\n', (123, 130), False, 'from numpy import zeros\n')] |
NeonDaniel/lingua-franca | test/test_parse_cs.py | eee95702016b4013b0d81dc74da98cd2d2f53358 | #
# Copyright 2017 Mycroft AI 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 writ... | [((1097, 1119), 'lingua_franca.load_language', 'load_language', (['"""cs-cz"""'], {}), "('cs-cz')\n", (1110, 1119), False, 'from lingua_franca import get_default_lang, set_default_lang, load_language, unload_language\n'), ((1124, 1146), 'lingua_franca.set_default_lang', 'set_default_lang', (['"""cs"""'], {}), "('cs')\n... |
WardenAllen/Uranus | src/net/pluto_ftp.py | 0d20cac631320b558254992c17678ddd1658587b | # !/usr/bin/python
# -*- coding: utf-8 -*-
# @Time : 2020/9/18 12:02
# @Author : WardenAllen
# @File : pluto_ftp.py
# @Brief :
import paramiko
class PlutoFtp :
# paramiko's Sftp() object.
__sftp = object
def connect_by_pass(self, host, port, uname, pwd):
transport = paramiko.Transport(... | [((301, 333), 'paramiko.Transport', 'paramiko.Transport', (['(host, port)'], {}), '((host, port))\n', (319, 333), False, 'import paramiko\n'), ((412, 457), 'paramiko.SFTPClient.from_transport', 'paramiko.SFTPClient.from_transport', (['transport'], {}), '(transport)\n', (446, 457), False, 'import paramiko\n'), ((547, 60... |
alexbrasetvik/Piped | piped/processors/test/__init__.py | 0312c14d6c4c293df378c915cc9787bcc7faed36 | # Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
| [] |
reakfog/personal_computer_voice_assistant | assistance_bot/app.py | 3483f633c57cd2e930f94bcbda9739cde34525aa | import sys
sys.path = ['', '..'] + sys.path[1:]
import daemon
from assistance_bot import core
from functionality.voice_processing import speaking, listening
from functionality.commands import *
if __name__ == '__main__':
speaking.setup_assistant_voice(core.ttsEngine, core.assistant)
while True:
# st... | [((229, 291), 'functionality.voice_processing.speaking.setup_assistant_voice', 'speaking.setup_assistant_voice', (['core.ttsEngine', 'core.assistant'], {}), '(core.ttsEngine, core.assistant)\n', (259, 291), False, 'from functionality.voice_processing import speaking, listening\n'), ((392, 477), 'functionality.voice_pro... |
tgodzik/intellij-community | python/testData/resolve/AssignmentExpressionsAndOuterVar.py | f5ef4191fc30b69db945633951fb160c1cfb7b6f | total = 0
partial_sums = [total := total + v for v in values]
print("Total:", total)
<ref> | [] |
florianhumblot/exhale | exhale/deploy.py | d6fa84fa32ee079c6b70898a1b0863a38e703591 | # -*- coding: utf8 -*-
########################################################################################
# This file is part of exhale. Copyright (c) 2017-2022, Stephen McDowell. #
# Full BSD 3-Clause license available here: #
# ... | [((7789, 7839), 're.search', 're.search', (['re_template', 'configs.exhaleDoxygenStdin'], {}), '(re_template, configs.exhaleDoxygenStdin)\n', (7798, 7839), False, 'import re\n'), ((5253, 5274), 'subprocess.Popen', 'Popen', (['args'], {}), '(args, **kwargs)\n', (5258, 5274), False, 'from subprocess import PIPE, Popen, S... |
rloganiv/bayesian-blackbox | src/bayesian_reliability_comparison.py | 6a111553200b6aa755149e08174abe1a61d37198 | import argparse
import multiprocessing
import os
import random
import numpy as np
from data_utils import DATAFILE_LIST, DATASET_LIST, prepare_data, RESULTS_DIR
from models import SumOfBetaEce
random.seed(2020)
num_cores = multiprocessing.cpu_count()
NUM_BINS = 10
NUM_RUNS = 100
N_list = [100, 200, 500, 1000, 2000, 5... | [((195, 212), 'random.seed', 'random.seed', (['(2020)'], {}), '(2020)\n', (206, 212), False, 'import random\n'), ((225, 252), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (250, 252), False, 'import multiprocessing\n'), ((517, 565), 'data_utils.prepare_data', 'prepare_data', (['DATAFILE_LI... |
SamKG/PsyNeuLink | psyneulink/core/components/functions/statefulfunctions/statefulfunction.py | 70558bcd870868e1688cb7a7c424d29ca336f2df | #
# Princeton University licenses this file to You 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 writ... | [((9174, 9199), 'psyneulink.core.globals.context.handle_external_context', 'handle_external_context', ([], {}), '()\n', (9197, 9199), False, 'from psyneulink.core.globals.context import ContextFlags, handle_external_context\n'), ((22615, 22640), 'psyneulink.core.globals.context.handle_external_context', 'handle_externa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.