id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
3416497 | """"
Does full table verification for the single hit policies
"""
import warnings
from dmnconverter.tools.decisiontable import DecisionTable
from dmnconverter.transform.meta_language import MetaLanguageConverter
from dmnconverter.tools import texttools as text_tools
# from dmnconverter.verify.unique_policy import Ver... | StarcoderdataPython |
6447398 | <filename>ELK/main.py
from elasticsearch import Elasticsearch
es = Elasticsearch(HOST="http://localhost", PORT=9200)
es = Elasticsearch()
| StarcoderdataPython |
1666255 | import os
import sys
from collections import OrderedDict
from openpyxl import Workbook, load_workbook
from tqdm import tqdm
os.chdir(os.path.dirname(os.path.abspath(__file__)))
SENATE_PATH = "../data/raw/david_leip/Senate Election Data (xls)"
OUTPUT_PATH = "../data/interim/"
candidates = []
county_votes = []
all_par... | StarcoderdataPython |
9785808 | from consts import *
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from ipdb import set_trace
#==============================
class Net(torch.nn.Module):
def __init__(self):
super(Net, self).__init__()
in_nn = STATE_DIM
out_nn = NN_FC_DENSITY
s... | StarcoderdataPython |
4869369 | from django.urls import reverse
from django.contrib.auth.models import Group
from functional_tests.base import FunctionalTest
from apps.accounts.models import User
from apps.accounts.tests.test_models import create_new_user
from apps.accounts.tests.test_views import accounts_route_questionnaires
# @patch('wocat.view... | StarcoderdataPython |
366493 | <reponame>ShaonMajumder/documentor<gh_stars>0
#from distutils.core import setup
from setuptools import setup
from os import path
# read the contents of your README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description =... | StarcoderdataPython |
9607180 | <gh_stars>1-10
#!/usr/bin/env python3
import argparse
import arviz as az
import copy
import csv
import engineering_notation
import hashlib
import numpy as np
import os
import pandas as pd
import platform
import pymc3 as pm
import shutil
import scipy.stats
import statistics
import subprocess
import sys
import time
impo... | StarcoderdataPython |
1941517 | <reponame>goztrk/django-htk<filename>test_scaffold/tests.py
# Python Standard Library Imports
import re
# Django Imports
# https://docs.djangoproject.com/en/1.11/topics/testing/overview/#provided-test-case-classes
from django.test import TestCase
from django.test.client import Client
from django.urls import NoReverseM... | StarcoderdataPython |
11373549 | <gh_stars>0
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------------------- #
# Software de Observaciones Sintéticas S.O.S.
# Units handling
#
# <NAME>, @ 5 May 2021
# Latest Revision: 5 May 2021, 14:00 GMT-6
#
# For all kind of problems, requests of enhancements and bug repo... | StarcoderdataPython |
1918640 | <gh_stars>100-1000
import sys
from optparse import OptionParser, IndentedHelpFormatter
from ripper.constants import *
from ripper.actions.attack import attack_method_labels
def create_parser() -> OptionParser:
"""Initialize parser with options."""
formatter = IndentedHelpFormatter(
indent_increment=2... | StarcoderdataPython |
9787077 | # =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... | StarcoderdataPython |
11319759 | <gh_stars>0
from sympy import *
import re
x = Symbol('x')
y = Symbol('y')
z = Symbol('z')
# if (tipo==1){ alert("numerador");}
# if (tipo==2){ alert("numerador raiz");}
# if (tipo==3){ alert("numerador e denominador");}
# if (tipo==4){ alert("numerador raiz e denominador");}
# if (tipo==5){ alert("numerador raiz e de... | StarcoderdataPython |
8055543 | from m5.SimObject import SimObject
from BaseHarvester import BaseHarvester
from m5.params import *
from m5.proxy import *
class SimpleHarvester(BaseHarvester):
type = 'SimpleHarvester'
cxx_header = "engy/energy_harvester.hh" | StarcoderdataPython |
6584977 | <filename>piquery/piq_feature.py
import cv2 as cv
import numpy as np
import pandas as pd
import os
def parseKeypoints(kp):
return [{'center': p.pt,
'diameter': p.size,
'angle': p.angle,
'class_id': p.class_id,
'octave': p.octave,
'response': p.response} for p in kp... | StarcoderdataPython |
336484 | # coding:utf-8
from view import route, url_for, View
from model.user import User
from tornado.web import authenticated
@route('/signin', name='signin')
class SignIn(View):
def get(self):
self.render('user/signin.html')
def post(self):
username = self.get_argument("username")
password ... | StarcoderdataPython |
1813518 | import argparse
import torch
def get_args(args):
# print(arglist)
# args = parser.parse_args(arglist)
args.cuda = not args.no_cuda and torch.cuda.is_available()
assert args.algo in ["a2c", "ppo", "acktr"]
if args.recurrent_policy:
assert args.algo in [
"a2c",
"pp... | StarcoderdataPython |
3408728 | from shutil import copytree
import subprocess
import pytest
import sys
import os
from shopyo import __version__
pytestmark = pytest.mark.cli_integration
@pytest.mark.usefixtures("restore_cwd")
def test_initialise_after_new(tmp_path):
"""run shopyo new inside a tmp directory foo,
create a venv, install the s... | StarcoderdataPython |
1928422 | <filename>onnx_tf/handlers/backend/floor.py<gh_stars>10-100
import tensorflow as tf
from onnx_tf.handlers.backend_handler import BackendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.handlers.handler import tf_func
from .math_mixin import BasicMathMixin
@onnx_op("Floor")
@tf_func(tf.floor)
class F... | StarcoderdataPython |
12828415 | <reponame>bdrich/neutron-lbaas
# Copyright 2015, <NAME>, Copyright IBM Corporation
#
# 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-... | StarcoderdataPython |
4864602 | from django.contrib import admin
from .models import Election, Candidate, Ticket, FPTPVote, APRVVote, STVVote, STVPreference, STVResult
def archive(modeladmin, request, queryset):
queryset.filter(open=False).update(archived=True)
archive.short_description = "Archive selected elections (if closed)"
class Prefe... | StarcoderdataPython |
12817395 | <filename>website/drawquest/apps/brushes/api.py
from django.shortcuts import get_object_or_404
from canvas.exceptions import ServiceError
from drawquest.api_decorators import api_decorator
from canvas.templatetags.jinja_base import render_jinja_to_string
from canvas.view_guards import require_staff, require_user
from ... | StarcoderdataPython |
9617430 | from models import DeepMindBigGAN, StyleGAN2, GPT2
from latent import DeepMindBigGANLatentSpace, StyleGAN2LatentSpace, GPT2LatentSpace
from utils import biggan_norm, biggan_denorm
configs = dict(
GPT2 = dict(
task = "img2txt",
dim_z = 20,
max_tokens_len = 30,
max_text_len = 50,
... | StarcoderdataPython |
3443201 | from multimds import multimds
import sys
chrom = sys.argv[1]
multimds.full_mds("hic_data/GM12878_combined_{}_100kb.bed".format(chrom), "hic_data/K562_{}_100kb.bed".format(chrom))
| StarcoderdataPython |
385241 | #!/usr/bin/env python3
"""\
Script for managing Zig versions in use.
The script uses and updates the version listed in the README.md file.
current-path can be used to add zig to PATH.
"""
import sys
import json
from argparse import ArgumentParser
from pathlib import Path
import urllib.request
import urllib
import re... | StarcoderdataPython |
153073 | <reponame>shihab4t/Software-Development
import smtplib
import os
from email.message import EmailMessage
EMAIL_ADDRESS = os.environ.get("GMAIL_ADDRESS")
EMAIL_PASSWORD = os.environ.get("GMAIL_APP_PASS")
with smtplib.SMTP_SSL("smtp.gmail.com", 465) as smtp:
smtp.login(EMAIL_ADDRESS, EMAIL_PASSWORD)
reciver = ... | StarcoderdataPython |
1729188 | import numpy
def UIDLoss(probsSeq):
mean=0
for prob in probsSeq:
mean+=prob
mean=mean*1.0/len(probsSeq)
print mean
sd=0
for prob in probsSeq:
sd+=(prob-mean)*(prob-mean)
sd=sd*1.0/len(probsSeq)
return numpy.sqrt(sd)
probs=[0.4,0.5,0.5,0.6,0.5,0.51]
print UIDLo... | StarcoderdataPython |
5090264 | <filename>ws2122-lspm/Lib/site-packages/pm4py/visualization/graphs/util/common.py<gh_stars>1-10
'''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... | StarcoderdataPython |
9725684 | """Assignment - making a sklearn estimator.
The goal of this assignment is to implement by yourself a scikit-learn
estimator for the OneNearestNeighbor and check that it is working properly.
The nearest neighbor classifier predicts for a point X_i the target y_k of
the training sample X_k which is the closest to X_i.... | StarcoderdataPython |
11357427 | from collections import defaultdict
from utils.json_utils import read_json
from utils.date_utils import DATE_HELPER
achievements = defaultdict(list)
def add_achievement(week: int, achievement: str):
achievements[week].append(achievement)
def get_progress():
list_of_progress = []
progress = read_json("da... | StarcoderdataPython |
335244 | <reponame>aleofreitas/pyppmc
# -*- coding: utf-8 -*-
# Copyright 2018 <NAME>
#
# 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... | StarcoderdataPython |
6650398 | <reponame>yookiwooki/AstroLib<gh_stars>0
#!/usr/bin/env python3
"""
rkf45.py - Runge-Kutta-Fehlberg 4(5) algorithm
"""
import numpy as np
import numpy.linalg as LA
import pudb
class OptionsRKF(object):
""" Options for RKF integrator
tol (float): error tolerance
h0 (float): initial step size
... | StarcoderdataPython |
11293019 | from .api import BasisClient
__all__ = ['BasisClient']
| StarcoderdataPython |
11359796 | from requests import post
base_headers = {
'Content-Type' : 'application/json',
}
url = "http://app-name.herokuapp.com/new_link"
data = {
'link':'https://github.com/dmdhrumilmistry/AnonUS'
}
response = post(url=url, json=data).content.decode()
print(response)
| StarcoderdataPython |
6500156 | # while bole:
# n = n + 1
# print(f'Ola Turma {n}')
# while n <= 30:
# n = n + 1
# print('Ola Turma')
# break
# print('Passou!')
# while n <= 20:
# n = n + 1
# print(f'Ola Turma {n}')
# continue
# print('Passou')
from random import randint
sorteio = randint(1,10)
numero ... | StarcoderdataPython |
4823730 | <reponame>sam6134/SLA_WebServer<gh_stars>0
import matplotlib.pyplot as plt
from math import log
import numpy as np
from random import randint
import pickle
import time
# use ggplot style for more sophisticated visuals
with open('fractalStream.pkl', 'rb') as f:
dfFractal = pickle.load(f)
with open('serverStream.pkl',... | StarcoderdataPython |
242736 | <gh_stars>0
import board
import busio
from digitalio import DigitalInOut, Direction, Pull
from time import sleep
#from roboticsmasters_bluetoothuart import BluetoothUART
uart = busio.UART(board.GPS_TX, board.GPS_RX, baudrate=9600)
enable = DigitalInOut(board.SDA)
enable.direction = Direction.OUTPUT
... | StarcoderdataPython |
4846432 | <gh_stars>0
from __future__ import print_function, division
import unittest
class KnowValues(unittest.TestCase):
def test_thrj(self):
""" """
from pyscf.nao.m_thrj import thrj, thrj_nobuf
from sympy.physics.wigner import wigner_3j
for l1 in range(0,3):
for l2 in range(0,3):
for l3 in ... | StarcoderdataPython |
3340518 | import pytest
import aioftp
@pytest.mark.asyncio
async def test_client_list_override(pair_factory, expect_codes_in_exception):
async with pair_factory(logged=False, do_quit=False) as pair:
with expect_codes_in_exception("503"):
await pair.client.get_current_directory()
@pytest.mark.asyncio
... | StarcoderdataPython |
97947 | <filename>incomepropertyevaluatorkit/pdf/pdfdocgen.py
# -*- coding: utf-8 -*-
import os, sys
from xhtml2pdf import pisa
from incomepropertyevaluatorkit.foundation.constants import *
from incomepropertyevaluatorkit.foundation.utils import *
from incomepropertyevaluatorkit.pdf.evaluatorfileformat import *
class PDFDocG... | StarcoderdataPython |
9762741 | <filename>kaggle/toxic_comments/src/features/hate_model.py
import pickle
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
class HateModel(BaseEstimator, TransformerMixin):
def __init__(self, path):
with open(path, 'rb') as f:
self.model = pickle.load(f)
def fit... | StarcoderdataPython |
9668200 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ashkeys5.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
... | StarcoderdataPython |
5160343 | # -----------------------------------------------
# aplotter.py - ascii art function plotter
# Copyright (c) 2006, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions... | StarcoderdataPython |
4900971 | #!/usr/bin/python35
fp = open('hello.txt')
print('fp.read() => \n', fp.read())
fp.seek(0, 0)
print('fp.read(8) => \n', fp.read(8))
fp.close()
| StarcoderdataPython |
6636721 | <filename>translate.py<gh_stars>0
import boto3
def readfile():
file = input('enter a filename here: ')
readfile = open(file, 'r')
txt = readfile.read()
return txt
translate = boto3.client(service_name='translate', region_name='us-west-2', use_ssl=True)
result = translate.translate_text(Text=readfile()... | StarcoderdataPython |
1821788 | <reponame>connorbrinton/gql
"""The primary :mod:`gql` package includes everything you need to
execute GraphQL requests, with the exception of the transports
which are optional:
- the :func:`gql <gql.gql>` method to parse a GraphQL query
- the :class:`Client <gql.Client>` class as the entrypoint to execute requests
... | StarcoderdataPython |
6476126 | from sqlalchemy import Column, Integer, Text, ForeignKey
from sqlalchemy.orm import relationship
from app.db.session import Base
class Comment(Base):
__tablename__ = "comment"
id = Column(Integer, primary_key=True, index=True)
text = Column(Text)
user_id = Column(Integer, ForeignKey("user.id"))
... | StarcoderdataPython |
8002337 | import argparse
import errno
import os
import subprocess
from jinja2 import Template
GODOC_DEFAULT_PORT = 6061
IPYTHON_DEFAULT_PORT = 9999
parser = argparse.ArgumentParser(description='Produce configurable plist files')
parser.add_argument('template', help='The location of the plist template')
parser.add_argument('-... | StarcoderdataPython |
312981 | import ctypes
ERROR_HANDLER_FUNC = ctypes.CFUNCTYPE(None, ctypes.c_char_p, ctypes.c_int,
ctypes.c_char_p, ctypes.c_int,
ctypes.c_char_p)
def py_error_handler(filename, line, function, err, fmt):
pass
c_error_handler = ERROR_HANDLER_FU... | StarcoderdataPython |
386665 | # -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... | StarcoderdataPython |
5091680 | <reponame>Bob-Yeah/kaolin<gh_stars>1-10
# Copyright (c) 2020, NVIDIA CORPORATION. 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/L... | StarcoderdataPython |
5091191 | <filename>mybbs-backend/mybbsbackend/database/api/user.py
from sqlalchemy.orm import exc
from mybbsbackend import database
from mybbsbackend.database.model import user as model_user
class UserAPI:
def get_one_by_username(self, username):
session = database.get_session()
query = session.query(
... | StarcoderdataPython |
239274 | <reponame>Tonyhe666/iOS-Scripting
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# ------------------------android 的xml语言文件解析------------------------------
from xml.dom import minidom
def get_attrvalue(node, attrname):
return node.getAttribute(attrname) if node else ''
def get_nodevalue(node, index = 0):
child = ... | StarcoderdataPython |
6537500 | import requests_mock
from teatime import Issue
def assert_mocked_execute(
target,
rpc_results,
plugin,
context,
rpc_methods,
skipped=False,
):
with requests_mock.Mocker() as mock:
mock.request(
method=requests_mock.ANY,
url=requests_mock.ANY,
re... | StarcoderdataPython |
3551131 | import argparse
import os
import sys
import numpy as np
import torch
import yaml
from runners.real_data_runner import train, semisupervised, transfer, compute_representations, plot_transfer, \
plot_representation, compute_mcc
def parse():
parser = argparse.ArgumentParser(description='')
parser.add_argu... | StarcoderdataPython |
246407 | import numpy as np
from numpy import linalg as la
from sklearn import datasets
from .EM_Factor_analysis import factor_analysis
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# iris data example
def run_demo():
print("play with iris data")
iris = datasets.load_iris()
x = iris.data
y =... | StarcoderdataPython |
4993662 | from __future__ import absolute_import
from __future__ import unicode_literals
from .api import VERBOSE, UserIntervention, IotsaConfig, IotsaWifi, IotsaDevice
| StarcoderdataPython |
9618504 | from math import ceil, floor, trunc
a=12.3456
b=(a)
# print(b)
list=[1,2,3,4,5]
# here we use the shallow copy method to both has the different memory address. using the "copy.copy".
# list1=copy(list)
help(copy.copy)
print("list : ",id(list))
# print("list1 : ",id(list1)) | StarcoderdataPython |
1823872 | <reponame>YunofHD/PSpider
# _*_ coding: utf-8 _*_
"""
inst_fetch.py by xianhu
"""
import time
import random
import logging
import requests
from ..utilities import CONFIG_FETCH_MESSAGE, get_dict_buildin # '.'从上层目录的某个文件夹导入
class Fetcher(object):
"""
class of Fetcher, must include function working()
"""
... | StarcoderdataPython |
6672681 | <filename>krgram/tl/protocol/system.py
from krgram.tl.base import TLConstructor, TLConstructedType
from krgram.tl.core_types.native import TL_long, TL_int, TL_string
from krgram.tl.core_types.vector import Vector
'''
msgs_ack#62d6b459 msg_ids:Vector<long> = MsgsAck;
'''
class msgs_ack(TLConstructor):
ID = 0x62d6b459
... | StarcoderdataPython |
5163199 | <gh_stars>0
# Generated by Django 3.2.11 on 2022-05-06 12:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('observations', '0014_identification_observations_identification_check_confidence_reasons'),
]
operations = [
migrations.AlterFi... | StarcoderdataPython |
1873815 | from .gradient_descent_base import L1BaseGradientDescent
from .gradient_descent_base import L2BaseGradientDescent
from .gradient_descent_base import LinfBaseGradientDescent
from ..models.base import Model
from ..criteria import Misclassification, TargetedMisclassification
from .base import T
from typing import Union, A... | StarcoderdataPython |
12804378 | from collections import defaultdict
from datetime import datetime
from xml.sax.saxutils import escape
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from conference import models
from conference.templatetags.conference import fare_blob
class Command(BaseCommand):... | StarcoderdataPython |
5042325 | XPM_MOD_VERSION = '1.2.1'
XPM_MOD_URL = 'https://github.com/juho-p/wot-debugserver'
XPM_MOD_UPDATE_URL = ''
XPM_GAME_VERSIONS = ['0.9.5']
run = True
import datetime
import tcprepl
def log(text):
ds = datetime.time.strftime(datetime.datetime.now().time(), '%H:%M')
print 'replserver %s: %s' % (ds, text)
def r... | StarcoderdataPython |
1960240 | <gh_stars>1-10
import os
os.environ["TF_DETERMINISTIC_OPS"] = "1"
import tensorflow as tf
from backbones import ModelFactory
tf.random.set_seed(42)
NUM_FRAMES = 512
NUM_FEATURES = 128
MODEL_FACTORY = ModelFactory()
class DeepMetricLearning(tf.keras.Model):
def __init__(self, backbone_name="densenet121", **k... | StarcoderdataPython |
5023687 | import commands
import time
import rospy
def signal_level():
return commands.getoutput("cat /proc/net/wireless | awk 'NR==3 {print $4}'")
if __name__ == '__main__':
rospy.init_node('wifi_signal_level')
while not rospy.is_shutdown():
print signal_level()
time.sleep(0.1)
| StarcoderdataPython |
3244607 | #!/usr/bin/env python3
# Otro script para mostrar los datos del sensor MH-Z14A
# 2021 Josema - <EMAIL>
# Librerías necesarias
# pip install ephem
# pip3 install scrollphathd
# pip3 install pyserial
# sudo apt install libatlas-base-dev
# sudo apt install python3-smbus
import time
import serial
import scrollphathd
impo... | StarcoderdataPython |
6681403 | #!/usr/bin/env python2
import struct
import os
import sys
from binascii import hexlify
if len(sys.argv) < 2:
print "Usage: print_ticket_keys.py decTitleKeys.bin"
sys.exit(0)
if not os.path.isfile(sys.argv[1]):
print "Input file '%s' doesn't exist." % sys.argv[1]
raise SystemExit(0)
with open(sys.argv... | StarcoderdataPython |
6500895 | <gh_stars>1-10
# =========================================
# IMPORTS
# --------------------------------------
import rootpath
rootpath.append()
# =========================================
# EXPORTS
# --------------------------------------
from totalrecall.profilers import *
| StarcoderdataPython |
4900612 | <reponame>player1537-forks/spack<filename>var/spack/repos/builtin/packages/nettle/package.py
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class N... | StarcoderdataPython |
9752034 | <filename>2021/solutions/day3.py<gh_stars>0
# Using integer division messed up my solution for part 2 >:(
def read_file(test = True):
if test:
filename = '../tests/day3.txt'
else:
filename = '../input/day3.txt'
with open(filename) as file:
temp = [line.strip() for line in file]
... | StarcoderdataPython |
9714931 | <gh_stars>100-1000
"""Test SegmentationMetricsByPixels and SegmentationMetricsByInstances classes.
Also act as tests for ClassificationMetrics, since it's identical to
SegmentationMetricsByPixels.
Structurally, file consists of four classes, which respectively check:
- basic assembly process (shapes compatibility, con... | StarcoderdataPython |
3585625 | <filename>schapke/cresi/data_prep/move_single_dir.py
python data_prep/speed_masks.py \
--geojson_dir /spacenet/dataset/train/AOI_5_Khartoum/geojson_roads_speed \
--image_dir /spacenet/dataset/train/AOI_5_Khartoum/PS-RGB \
--output_conversion_csv /wdata/out.csv \
--output_mask_dir /wdata/train/masks
| StarcoderdataPython |
200910 | <filename>pytglib/api/types/rich_text_strikethrough.py
from ..utils import Object
class RichTextStrikethrough(Object):
"""
A strikethrough rich text
Attributes:
ID (:obj:`str`): ``RichTextStrikethrough``
Args:
text (:class:`telegram.api.types.RichText`):
Text
Retu... | StarcoderdataPython |
6653401 | <gh_stars>0
# Altere o script para que o usuário informe:
# - nome
# - montante inicial
# - tempo de investimento
# Então imprima uma mensagem contendo o nome e o resultado para os dois investimentos.
# Lembrete:
# - Poupança: rendimento de 0,469% ao mês
# - CDI: retorno de 105% do CDI, que rende 7,5% ao ano
def compo... | StarcoderdataPython |
3554441 | <gh_stars>10-100
import pydda
import pyart
import numpy as np
from netCDF4 import Dataset
from scipy.interpolate import interp1d
from datetime import datetime
def test_add_era_interim_field():
Grid0 = pyart.io.read_grid(pydda.tests.EXAMPLE_RADAR0)
Grid0 = pydda.constraints.make_constraint_from_era_interim(
... | StarcoderdataPython |
1972886 | <reponame>mpc24-dataanalytics/web-scraping-challenge
#!/usr/bin/env python
# coding: utf-8
# In[18]:
# Dependencies
from bs4 import BeautifulSoup
from splinter import Browser
import pandas as pd
import time
from selenium import webdriver
import re
def scrape_info():
mars={}
#Visit NASA Mars News url ... | StarcoderdataPython |
4829391 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
This module handles desktop notifications and supports multiple backends, depending on
the platform.
"""
# system imports
import platform
from threading import RLock
import logging
import asyncio
from pathlib import Path
from typing import (
Type,
Union,
Optional,... | StarcoderdataPython |
9708746 | <reponame>Nelson-iitp/mdlog
#-----------------------------------------------------------------------------------------------------
# mdlog/md.py
#-----------------------------------------------------------------------------------------------------
import os.path, sys
from os import makedirs
#---------------------------... | StarcoderdataPython |
162452 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Netheos (http://www.netheos.net)
#
# 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 req... | StarcoderdataPython |
3452537 | FREQUENCY = 60
MEMORY_SIZE = 0x1000
PROGRAM_OFFSET = 0x200
SZ_INSTR = 0x2
SCREEN_ROWS = 32
SCREEN_COLS = 64
INSTRUCTIONS_PER_CYCLE = 9
FONT_OFFSET = 0x000
FONT_SIZE = 5
FONTDATA = (
"F0909090F0" # 0
"2060202070" # 1
"F010F080F0" # 2
"F010F010F0" # 3
"9090F01010" # 4
"F080F010F0" # 5
"... | StarcoderdataPython |
27449 | #!/usr/bin/env python2
"""Context for all tests."""
from __future__ import absolute_import
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)) + "../lcovparse"))
import lcovparse # pylint: disable=wrong-import-position,unused-import
| StarcoderdataPython |
99940 | <reponame>LittleYUYU/Interactive-Semantic-Parsing
#utils.py
import tensorflow as tf
import numpy as np
from nltk import word_tokenize
import config
# color
# Usage: print bcolors.WARNING + "Warning: No active frommets remain. Continue?" + bcolors.ENDC
class bcolors:
PINK = '\033[95m'
BLUE = '\033[94m'
GRE... | StarcoderdataPython |
4889588 | import matplotlib.pyplot as plt
import pytest
from qm.qua import *
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import SimulationConfig
import numpy as np
from qualang_tools.bakery.bakery import baking
from copy import deepcopy
def gauss(amplitude, mu, sigma, length):
t = np.lin... | StarcoderdataPython |
4918252 | """
Language Description Status Browser
-----------------------------------
The description status of languages can be investigated in relation to the vitality (or
endangerment) of a language.
"""
from collections import defaultdict
import json
import attr
from pyramid.view import view_config
from sqlalchemy import f... | StarcoderdataPython |
370521 | <gh_stars>1-10
MODEL_TYPES = ["autoencoding", "seq-to-seq"]
| StarcoderdataPython |
6516931 | <reponame>alexshin/django-postges-lookups-any
from django.db import models
class ModelA(models.Model):
name = models.CharField('Test Name A', max_length=100)
external_id = models.PositiveIntegerField('Test ID A')
class ModelB(models.Model):
name = models.CharField('Test Name B', max_length=100)
exte... | StarcoderdataPython |
3588335 | import random
import inspect
# Day 1 Exercise
print("""
Day 1 - Exercises
-----------------
Alice in the Wonderland - alpha frequency distribution table
""")
filename = "alice_in_wonderland.txt"
file = open(filename, "r")
fileContent = file.read().lower()
alpha = 'abcdefghijklmnopqrstuvwxyz'
frequency = []
for i in ... | StarcoderdataPython |
6568591 | <reponame>rtloftin/strategically_efficient_rl
from normal_form.games.zero_sum import RandomZeroSumGame
from normal_form.games.bernoulli import RandomBernoulliGame
from normal_form.games.roshambo import Roshambo
from normal_form.games.hybrid_roshambo import HybridRoshambo
from normal_form.games.unique_equilibrium import... | StarcoderdataPython |
303947 | # Copyright 2013 Rackspace, Inc.
"""Tests for bobby.views."""
import json
import StringIO
import mock
from twisted.internet import defer
from twisted.trial import unittest
from twisted.web.test.requesthelper import DummyRequest
from bobby import views
from bobby.worker import BobbyWorker
class BobbyDummyRequest(Dum... | StarcoderdataPython |
1763135 | from setuptools import setup
setup(
name='python-google-api-clients',
packages=[
'google_api_clients',
'google_api_clients.bigquery',
'google_api_clients.pubsub',
],
version='0.0.1',
author='<NAME>',
author_email='<EMAIL>',
description='Google API Clients for Python'... | StarcoderdataPython |
3407769 | from pathlib import Path
import pytest
from flexmock import flexmock
from packit.config.job_config import JobType, JobConfigTriggerType
from packit.api import PackitAPI
from packit.cli import utils
from packit.cli.utils import get_packit_api
from packit.config import JobConfig
from packit.local_project import LocalPr... | StarcoderdataPython |
9619943 | <gh_stars>1-10
# import necessary packages
from datetime import datetime
from sklearn.metrics import (log_loss, confusion_matrix, accuracy_score,
f1_score, make_scorer)
from sklearn.ensemble import RandomForestClassifier
from sklearn.compose import ColumnTransformer
from sklearn.pipeline im... | StarcoderdataPython |
8108780 | <filename>kisensum/openadr/openadr/vtn/migrations/0040_remove_report_site.py<gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-20 18:18
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('vtn', '0039_... | StarcoderdataPython |
8054130 | <gh_stars>1-10
import asyncio
import sys
from kademlia_aio.services import logging_to_console, setup_event_loop, start_node
logging_to_console()
setup_event_loop()
start_node(*sys.argv[1:3])
asyncio.get_event_loop().run_forever()
| StarcoderdataPython |
4934125 | <reponame>simonsobs/acondbs<gh_stars>0
import pytest
from acondbs import create_app
from acondbs.db.ops import define_tables
##__________________________________________________________________||
params = [
[True, 200, "<!DOCTYPE html>"],
[False, 400, "errors"],
]
@pytest.mark.parametrize("graphiql, code, ... | StarcoderdataPython |
6556782 | <reponame>abuyukcakir/coevol-python<filename>reality_mining_prep.py<gh_stars>0
import networkx as nx
import numpy as np
import scipy as sp
import pandas as pd
from CoEVOL import CoEVOL
import sys
from datetime import datetime
from dateutil.parser import parse
from scipy.io import loadmat
from functools import reduce... | StarcoderdataPython |
6550862 | from chew import compare
def test_load_fingerprint(path_tests):
header, fingerprint = compare.load_fingerprint(str(path_tests / "data/igsr.HG00102.TP73.npz"))
assert header == "HG00102-N1-DNA1-WES1"
assert fingerprint.shape == (3, 23770)
| StarcoderdataPython |
1972383 | <reponame>RyanArnasonML/stock-analysis<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 8 21:46:06 2021
@author: ryanar
"""
import numpy as np
import yfinance
import talib as ta
import pandas as pd
my_data = yfinance.download('AAPL', '2013-1-1','2021-2-28')
def ma(Data, lookback, what='Close'):
... | StarcoderdataPython |
212062 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.base.buil... | StarcoderdataPython |
11373942 | <filename>armulator/armv6/opcodes/abstract_opcodes/smc.py<gh_stars>10-100
from armulator.armv6.opcodes.abstract_opcode import AbstractOpcode
from armulator.armv6.arm_exceptions import SMCException, UndefinedInstructionException
from bitstring import BitArray
from armulator.armv6.configurations import have_security_ext,... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.