id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
1725211 | from typing import Any
from typing import Tuple
from .config_base import ConfigBase
from .config_env import ConfigEnv
class Config(object):
# todo use args ?
def __init__(self, order=(ConfigEnv(),)):
# type: (Tuple[ConfigBase]) -> None
"""
Args:
order (tuple): tuple of Co... | StarcoderdataPython |
389728 | <reponame>ParspooyeshFanavar/pyibsng
"""Search batch API method."""
from ibsng.handler.handler import Handler
class searchBatch(Handler):
"""Search batch method class."""
def control(self):
"""Validate inputs after setup method.
:return: None
:rtype: None
"""
self.is_... | StarcoderdataPython |
1727261 | <filename>fastapi_mail/errors.py
class NotAvilableService(Exception):
def __init__(self, expression, message):
self.expression = expression
self.message = message
class TypeExecption(TypeError):
def __init__(self, expression):
self.expression = expression
class ConnectionErrors(Excep... | StarcoderdataPython |
12842174 | import argparse
from datetime import datetime, timedelta
from pathlib import Path
from typing import NamedTuple
import dask
import numpy as np
from snobedo.lib import ModisGeoTiff
from snobedo.lib.command_line_helpers import add_dask_options, \
add_water_year_option
from snobedo.lib.dask_utils import run_with_cli... | StarcoderdataPython |
3201536 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 10 13:17:52 2020
@author: <NAME>, Finnish Meteorological Institute
@licence: MIT licence Copyright
"""
import matplotlib
import numpy
import os
import pathlib
import seaborn
from Data import Data
from FileSystem import FileSystem
from PlotTweak imp... | StarcoderdataPython |
3584426 | <gh_stars>1-10
from update import *
from ui import *
from session import *
| StarcoderdataPython |
11216707 | import fresh_tomatoes
import media
toy_story = media.Movie("Toy Story",
"A story of a boy and his toys that come to life",
"http://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg",
"https://www.youtube.com/watch?v=vwyZH85NQC4")
#print(toy_sto... | StarcoderdataPython |
9733304 | <gh_stars>10-100
from core.Config import alphabet
class Vigenere_Square:
"""
Name: {cyan}The Vigenere Square{reset}
Description: {cyan}An encryption and decryption technique that use word or string provided as key and adding it to each number that represent letter in alphabet.{reset}
Possi... | StarcoderdataPython |
6689332 | <reponame>pombredanne/quine-mccluskey
#!/usr/bin/env python
# qm.py -- A Quine McCluskey Python implementation
#
# Copyright (c) 2006-2013 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
#... | StarcoderdataPython |
336581 | from abc import ABC, abstractproperty
class Base(ABC):
@abstract
@property
def some_method(self):
pass
class <weak_warning descr="Class Sub must implement all abstract methods">S<caret>ub</weak_warning>(Base):
pass | StarcoderdataPython |
8056891 | # -*- coding: utf-8 -*-
import sys
import base64
import requests
try:
requests.packages.urllib3.disable_warnings()
except AttributeError:
pass
class Rest():
def __init__(self, BASE_URL, USERNAME, SECRET, DEBUG, VERBOSE, DRY_RUN, LOGGER):
self.base_url = BASE_URL
self.use... | StarcoderdataPython |
3361795 | <filename>styling/views.py<gh_stars>1-10
import json
from api.view_utils import JsonResponse, pass_errors_to_response
from styling.utils import rendering_task, get_available_options
@pass_errors_to_response
def options(request):
params = json.loads(request.body)
kind = params.get("kind")
available_opts = ... | StarcoderdataPython |
292888 | <filename>vestaboard/vbUrls.py
subscription = 'https://platform.vestaboard.com/subscriptions'
post = "https://platform.vestaboard.com/subscriptions/{}/message" | StarcoderdataPython |
8170284 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Author: <NAME> and <NAME>
#Email: <EMAIL> and <EMAIL>
#For licensing see the LICENSE file in the top level directory.
"""
Allows for the computation of the PQ-Gram edit distance of two trees. To
calculate the distance, a Profile object must first be created for each tree,... | StarcoderdataPython |
3202057 | ##########################################################
# detect_lanes.py
#
# SPDX-FileCopyrightText: Copyright 2021 <NAME>
#
# SPDX-License-Identifier: MIT
#
# Lane detection on video files
#
# ########################################################
#
# Import libraries
import cv2
#
import numpy as np
import os
... | StarcoderdataPython |
1784699 | <reponame>shirou/dipus
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
import os
from sphinx.builders import Builder
from sphinx.util.osutil import ensuredir, os_path
from sphinx.util.nodes import inline_all_toctrees
from sphinx.util.console import bold, darkgreen, brown
from sphinx.errors import SphinxEr... | StarcoderdataPython |
296545 | import os
os.environ["OMP_NUM_THREADS"] = "1"
# os.environ['KMP_AFFINITY']='compact,1,0'
import multiprocessing
import numpy as np
import ConfigSpace as CS
from hpbandster.core.worker import Worker
from src.learna.agent import NetworkConfig, get_network, AgentConfig
from src.learna.environment import RnaDesignEnvi... | StarcoderdataPython |
6412117 | def century(year):
return year // 100 if year % 100 == 0 else year // 100 + 1
| StarcoderdataPython |
12854575 | # coding: utf-8
from flask.ext import wtf
import flask
import wtforms
import auth
import config
import model
import util
from main import app
###############################################################################
# Admin Stuff
###############################################################################... | StarcoderdataPython |
4883508 | <filename>src/TB3Util/tb3step.py<gh_stars>0
import midi
#Represents a single step in the TB-3 sequencer
class TB3Step:
KEY_NOTE = "NOTE"
KEY_ACCENT = "ACCENT"
KEY_CLEAR = "CLEAR"
KEY_SLIDE = "SLIDE"
def __init__(self,step_dict=None):
if(step_dict == None):
self._init()
else:
self._init(step_dict[TB3St... | StarcoderdataPython |
22662 | # Copyright 2017 Rice University
#
# 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 writin... | StarcoderdataPython |
3546958 | # This file is part of App3 (http://code.google.com/p/app3).
#
# Copyright (C) 2009 <NAME> http://geewax.org/
# All rights reserved.
#
# This software is licensed as described in the file COPYING.txt,
# which you should have received as part of this distribution.
import logging
import hmac
import base64
from datetim... | StarcoderdataPython |
5024767 | import itertools
from math import ceil, floor
import numpy as np
from numpy.random import randint, random
from .utils import ensure_multiplicity
from scipy.ndimage import zoom
OVERLAP_MODE = ["NO_OVERLAP", "ALLOW", "FORCE"]
def extract_tile_function(tile_shape, perform_augmentation=True, overlap_mode=OVERLAP_MODE[1],... | StarcoderdataPython |
5141528 | <reponame>edwinb-ai/segnet
import tensorflow.keras as K
from segmed.models import Unet
from segmed.metrics.metrics import jaccard_index
import numpy as np
from . import SimpleDataset
class TestSimpleUnet(SimpleDataset):
@staticmethod
def test_simple_unet_is_model():
"""Test that the model is an actual... | StarcoderdataPython |
222165 | <filename>src/plotting/plotting.py
import os
import sys
import pickle
import matplotlib.pyplot as plt
import numpy as np
import h5py
import argparse
from mpl_toolkits.axes_grid1 import make_axes_locatable
import pylab as PL
import matplotlib
from matplotlib import cbook
import matplotlib.gridspec as gridspec
from matpl... | StarcoderdataPython |
11399902 | <filename>video_gray.py<gh_stars>1-10
import argparse
from cv2 import *
import numpy as np
arg=argparse.ArgumentParser()
arg.add_argument("--path",help="INPUT VIDEO PATH ",default=0)
args=vars(arg.parse_args())
cap=cv2.VideoCapture(args['path'])
while (True):
check,frame=cap.read()
gray=cvtColor(frame,COLOR_RG... | StarcoderdataPython |
11397163 | <gh_stars>1-10
import abjad
from abjad.tools import abctools
from abjad.tools import scoretools
from abjad.tools import systemtools
class StopTrillSpan(abctools.AbjadValueObject):
__slots__ = ()
def _get_lilypond_format_bundle(self, component):
import consort
parentage = abjad.inspect(compon... | StarcoderdataPython |
12811860 | import json
import torch
import numpy as np
def convert_sentence_to_adjacency_matrix(sentence):
'''
Input: sentence in json
Output: adjancency matrix (gold standard)
'''
sentence_len = len(sentence['words'])
# Initialize a matrix of size N x N
adjancency_matrix = np.zeros((sentence_len, ... | StarcoderdataPython |
3267941 | <gh_stars>1-10
import unittest
from tests import initialize_screenshot
from tft import game, board, utils, tracker, parser, debugger
TestFile = "parser_test_data.json"
Test1080PDefault = "/Users/henry/Downloads/TFT Screenshots/board_1080_1.png"
Test1440PDefault = "/Users/henry/Downloads/TFT Screenshots/board_1440_5.p... | StarcoderdataPython |
4991298 | # -*- coding: utf-8 -*-
import ccxt
import time
import json
import argparse
class Argv (object):
pass
argv = Argv()
parser = argparse.ArgumentParser()
parser.add_argument('--nonce', type=int, help='integer')
parser.add_argument('exchange', type=str, help='exchange id in lowercase', nargs='?')
parser.add_argu... | StarcoderdataPython |
3255006 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17-9-22 下午1:39
# @Author : <NAME>
# @Site : http://github.com/TJCVRS
# @File : data_provider.py
# @IDE: PyCharm Community Edition
"""
Provide the training and testing data for shadow net
"""
import os.path as ops
import numpy as np
import ... | StarcoderdataPython |
29203 | <reponame>akshshar/bigmuddy-network-telemetry-proto
#!/usr/bin/env python
# Standard python libs
import os,sys
sys.path.append("./src/genpy")
import ast, pprint
import pdb
import yaml, json
import telemetry_pb2
from mdt_grpc_dialin import mdt_grpc_dialin_pb2
from mdt_grpc_dialin import mdt_grpc_dialin_pb2_grpc
impor... | StarcoderdataPython |
11378307 | from celery import shared_task
from .models import TransferBatch, TransferFile
@shared_task(bind=True, time_limit=600, default_retry_delay=30, max_retries=3)
def file_pending_to_downloading(self, fileId):
file = TransferFile.objects.get(id=fileId)
file.status = 'DL'
file.save()
print("File Pending and... | StarcoderdataPython |
11276252 | <gh_stars>10-100
#!/usr/bin/python
import sys
class juniper(object):
def __init__(self):
self.FAMILY = ["QzF3n6/9CAtpu0O", "B1IREhcSyrleKvMW8LXx", "7N-dVbwsY2g4oaJZGUDj", "iHkq.mPf5T"]
self.EXTRA = dict()
for x, item in enumerate(self.FAMILY):
for c in item:
self.EXTRA[c] = 3 - x
self.NUM_ALPHA = ... | StarcoderdataPython |
8004902 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.... | StarcoderdataPython |
6635312 | # Copyright 2017-2020 The GPflow Contributors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | StarcoderdataPython |
3278956 | from __future__ import print_function
# third party libraries
from theano.tensor import matrix, lvector
from opendeep.log.logger import config_root_logger
from opendeep.models import Prototype, Dense, Softmax
from opendeep.optimization import AdaDelta
from opendeep.optimization.loss import Neg_LL
from opendeep.data imp... | StarcoderdataPython |
185728 | <reponame>SDomarecki/Specusticc<filename>specusticc/agent/agent.py
from specusticc.configs_init.model.agent_config import AgentConfig
from specusticc.data_postprocessing.data_postprocessor import DataPostprocessor
from specusticc.data_preprocessing.preprocessed_data import PreprocessedData
from specusticc.model_creatin... | StarcoderdataPython |
11375705 | <reponame>xiangruhuang/mmdetection3d
_base_ = './centerpoint_0075voxel_second_secfpn_dcn_' \
'circlenms_4x8_cyclic_20e_waymo.py'
point_cloud_range = [-75.2, -75.2, -2.0, 75.2, 75.2, 4.0]
file_client_args = dict(backend='disk')
class_names = [
'Car', 'Pedestrian', 'Cyclist'
]
dataset_type = 'WaymoDataset'... | StarcoderdataPython |
11326 | <filename>tests/integration/storage_memory/test_storage_memory_write.py
import logging
import pytest
from moto import mock_ec2, mock_iam, mock_sts
from cloudwanderer.cloud_wanderer_resource import CloudWandererResource
from cloudwanderer.storage_connectors import MemoryStorageConnector
from cloudwanderer.urn import U... | StarcoderdataPython |
11215861 | <filename>lab4/src/imageproc_cl.py
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
from pathlib import Path
import glob
import yaml
from datetime import date
from scipy import ndimage
import cv2 as cv
from itertools import combinations
from itertools import product
from imageprocessing... | StarcoderdataPython |
11255853 | <filename>autolavadox/urls.py
"""autolavadox URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$',... | StarcoderdataPython |
22497 | <filename>python/paddle/fluid/tests/unittests/test_python_bf16_numpy_datatype.py<gh_stars>10-100
# Copyright (c) 2022 PaddlePaddle Authors. 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 ... | StarcoderdataPython |
347741 | <reponame>Aditya-AS/Question-Answering-System
import os
import sys
import inspect
# Add the project's lib/ folder to the python path. This makes it so
# that if the required libraries are available in the lib/ directory
# they will be used even if they were not installed into Python's
# site-packages/ directo... | StarcoderdataPython |
128535 | # -*- coding: utf-8 -*-
# http://www.apache.org/licenses/LICENSE-2.0.txt
#
# Copyright 2016 Intel 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/li... | StarcoderdataPython |
1997199 | <filename>hydrus/core/HydrusEncryption.py
import os
import stat
try:
import OpenSSL
OPENSSL_OK = True
except:
OPENSSL_OK = False
def GenerateOpenSSLCertAndKeyFile( cert_path, key_path ):
key = OpenSSL.crypto.PKey()
key.generate_key( OpenSSL.crypto.TYPE_RSA, 2048 )... | StarcoderdataPython |
1706614 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | StarcoderdataPython |
280988 | <filename>topaz/parser.py
from rpython.rlib.objectmodel import specialize
from rpython.rlib.rbigint import rbigint
from rply import ParserGenerator, Token, ParsingError
from rply.token import BaseBox, SourcePosition
from topaz import ast
from topaz.astcompiler import (
SymbolTable, BlockSymbolTable, SharedScopeSy... | StarcoderdataPython |
6690942 | <gh_stars>10-100
# -*- coding: utf-8 -*-
from ..auth import auth
#
# Copyright (c) 2019 <NAME>.
#
# This file is part of Dremio Client
# (see https://github.com/rymurr/dremio_client).
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distrib... | StarcoderdataPython |
1894289 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ======================================================================
# Copyright 2016 <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
#
#... | StarcoderdataPython |
6534008 | __author__ = 'rcj1492'
__created__ = '2018.02'
__license__ = 'MIT'
def compile_run_kwargs(service_config, service_repo, service_alias, service_tag, service_path, system_envvar):
from os import path
run_kwargs = {
'image_name': service_repo,
'container_alias': service_alias,
'image_t... | StarcoderdataPython |
3581519 | <reponame>willhayslett/gehome<gh_stars>10-100
from .ge_exception import GeException
class GeDuplicateApplianceError(GeException):
"""Error raised when a duplicate appliance is attempted to be added"""
pass
| StarcoderdataPython |
310431 | <gh_stars>0
#!/usr/local/bin/python
# -*- coding:utf-8 -*-
# 订阅
from RedisHelper import RedisHelper
obj = RedisHelper()
obj.publish('nihao')#发布
| StarcoderdataPython |
1604342 | <reponame>SpencerEricksen/PCBA_downloads_oxphos
import pandas as pd
import numpy as np
df1 = pd.read_csv('all_oxphos_aids_cids.csv')
df2 = pd.read_csv('./assay_descriptions/all_assays_desc.csv', sep="|")
df3 = df2.merge( df1, how='right', on='AID')
df3.to_csv('all_oxphos_aids_cids_assaydesc.csv', sep="|", index=False ... | StarcoderdataPython |
1988306 | <filename>blockchain-api/utils.py
import hashlib
import json
#Creates a SHA-256 hash of provided data
def hash(data, serialized=False):
if not serialized:
data = serialize(data)
return hashlib.sha256(data).hexdigest()
def serialize(data):
if isinstance(data, dict):
return json.dumps(data,... | StarcoderdataPython |
9731715 | from __future__ import unicode_literals
from django.conf import settings
from django.utils import translation
from parler.models import TranslationDoesNotExist
from parler import appsettings
from .utils import AppTestCase
from .testapp.models import SimpleModel, AnyLanguageModel, EmptyModel
class ModelAttributeTests(... | StarcoderdataPython |
3400131 | from flask import Flask, jsonify, request, render_template, url_for, flash
from flask_wtf import form, Form
from wtforms import PasswordField
from wtforms.validators import DataRequired
import dbconn, student_auth,hash,os,re,json_gen, redis_updater
from flask_mail import Mail,Message
from itsdangerous import URLSafe... | StarcoderdataPython |
8158019 | <gh_stars>0
#!/usr/bin/env python3
"""A basic CLI for the API. It allows to list, create and
delete services, exploits and targets."""
import sys
import logging
import argparse
import requests
LOGGER = logging.getLogger()
ARGS = argparse.ArgumentParser(description='CTF-PWN CLI')
SUBARGS = ARGS.add_subparsers(dest='cmd... | StarcoderdataPython |
5023886 | #!/usr/bin/python
import sys
import subprocess
import getopt
import random
# Program to format a benchmark run and submit it to the latedays job queue
def usage(name):
print "Usage: %s -h -J -s NAME -a ARGS -r ROOT -d DIGITS"
print " -h Print this message"
print " -J Don't submit job (j... | StarcoderdataPython |
5087047 | import os
import re
import pickle
import msession
from ocr import ocr
def login(username: str, password: str):
session = msession.session
session.cookies.clear()
res = session.get(msession.urls.cas, verify=False)
lt = re.findall(r'name="lt" value="(.*)"', res.text)
captcha_url = msession.urls.capt... | StarcoderdataPython |
3488766 | <reponame>vysakh-menon-aot/lear<gh_stars>1-10
# Copyright © 2021 Province of British Columbia
#
# 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.... | StarcoderdataPython |
1690534 | # -*- coding: utf-8 -*-
# Copyright (C) 2013-2015 MUJIN 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... | StarcoderdataPython |
8199899 | from lux.core import LuxCommand, Setting
from lux.extensions.rest import session_backend
class Command(LuxCommand):
help = "Clear Sessions"
option_list = (
Setting('app_name',
nargs='?',
desc=('Optional app name. If omitted the default '
'applicati... | StarcoderdataPython |
4804293 | import time
from pathlib import Path
import cv2
from ir_tracker.utils import calibration_manager, debug_server, picam_wrapper
def draw_info(image, text):
cv2.putText(image, text, (10, 50), cv2.FONT_HERSHEY_SIMPLEX, 1,
(255, 255, 0), 2, cv2.LINE_AA)
CHESSBOARD_HEIGHT = 8
CHESSBOARD_WIDTH = 5
PIC... | StarcoderdataPython |
4958775 | <filename>dopamine/thesis/scratch/test_rng_pytree.py
# NOTE keeping rngs on their own and splitting them as necessary is
# faster than using my custom PyTree generator class. For now I will
# keep using because it provides a cleaner interface, but it ideally
# needs improvements. Look into https://cgarciae.github.io/tr... | StarcoderdataPython |
6673811 | <gh_stars>100-1000
from django.conf.urls import url
from usaspending_api.accounts.views import tas as views
from usaspending_api.common.views import RemovedEndpointView
# bind ViewSets to URLs
tas_list = RemovedEndpointView.as_view({"get": "retrieve", "post": "retrieve"})
tas_detail = RemovedEndpointView.as_view({"ge... | StarcoderdataPython |
1715169 | """
_speech_synthesizer.py
Copyright 1999-present 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-2.0
Unless required by applicab... | StarcoderdataPython |
4992396 | from tmps.star.propagator.factory import get, get_from_hamiltonian | StarcoderdataPython |
3450519 | import pandas as pd
import pysam
import argparse
import pickle
def parse_args():
parser=argparse.ArgumentParser(description="get gc content from a bed file")
parser.add_argument("--input_bed")
parser.add_argument("--ref_fasta")
parser.add_argument("--out_pickle")
return parser.parse_args()
def main... | StarcoderdataPython |
1958122 | <gh_stars>1-10
from fastapi import Depends, HTTPException, Request
from aim.web.api.utils import APIRouter # wrapper for fastapi.APIRouter
from sqlalchemy.orm import Session
from aim.web.api.dashboards.models import Dashboard
from aim.web.api.dashboard_apps.models import ExploreState
from aim.web.api.dashboards.seria... | StarcoderdataPython |
6580877 | <gh_stars>100-1000
""" Example on how to finetune on the HardHat dataset
using custom layers. This script assume the dataset is already download
on your computer in raw and Tensorflow Object detection csv format.
Please, for more information, checkout the following notebooks:
- DETR : How to setup a custom datas... | StarcoderdataPython |
1613779 | <filename>tests/test_root.py
def test_namespace():
"""
A trivially simple test that will run on all platforms.
"""
__import__('jaraco')
| StarcoderdataPython |
6478291 | <reponame>shinnng/platon-utils
import decimal
from hypothesis import given
from hypothesis import strategies as st
import pytest
from platon_utils.currency import MAX_VON, MIN_VON, from_von, to_von, units
@given(
amount_in_von=st.integers(min_value=MIN_VON, max_value=MAX_VON),
intermediate_unit=st.sampled_f... | StarcoderdataPython |
1986941 | # AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified).
__all__ = ['device', 'INDUCING_POINT_STRIDE', 'get_data']
# Cell
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.distributions as dist
import torch.nn as nn
import torch.nn.functional as F
from torch.... | StarcoderdataPython |
8021932 | <reponame>ngbla/memoire_bigdata_face
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 22 06:15:43 2021
@author: ngbla
"""
from __future__ import print_function
# import the necessary packages
import cv2 as cv
print(cv.__version__)
import numpy as np
print(np.__version__)
#-- Import de la fonction ... | StarcoderdataPython |
4881901 | <gh_stars>10-100
r"""
Reward Tracing
==============
.. autosummary::
:nosignatures:
coax.reward_tracing.NStep
coax.reward_tracing.MonteCarlo
coax.reward_tracing.TransitionBatch
----
The term **reward tracing** refers to the process of turning raw experience into
:class:`TransitionBatch <coax.reward_... | StarcoderdataPython |
6683895 | #python2.*
__author__ = 'wangchao'
import hashlib
def main():
print 1
print MD5encrypt('10000Rb498d0f8bfab48b7a2abdf25ee51c5a51480402506335{"MsgInfo":{"CommType":"REQ","TxnType":"ActivateCertificate","TxnVersion":"0.0.1","Charset":"UTF-8"},"ChannelInfo":{"ChannelLang":"zh_CN","ChannelHostIP":"10.100.70.100",... | StarcoderdataPython |
137750 | import time
import os
import pandas as pd
import re
# %a 星期的简写。如 星期三为Web
# %A 星期的全写。如 星期三为Wednesday
# %b 月份的简写。如4月份为Apr
# %B 月份的全写。如4月份为April
# %c: 日期时间的字符串表示。(如: 04/07/10 10:43:39)
# %d: 日在这个月中的天数(是这个月的第几天)
# %f: 微秒(范围[0,999999])
# %H: 小时(24小时制,[0, 23])
# %I: 小时(12小时制,[0, 11])
# %j: 日在年中的天数 [001,366](是当年的第几天)
# ... | StarcoderdataPython |
231534 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Created on 04.20.2021
Updated on 04.23.2021
Author: <EMAIL>
'''
import os
import cv2
import copy
import numpy as np
from PIL import Image
from PyQt5.QtWidgets import QLabel, QApplication
from PyQt5.QtCore import Qt, QSize, QPoint, QRect, QLineF, pyqtSlot
from PyQt5.QtGui... | StarcoderdataPython |
6479354 | <reponame>Carlososuna11/codewars-handbook
import codewars_test as test
import timeit
from solution import alphametics
test.describe('Example Tests')
example_tests = (
('SEND + MORE == MONEY','9567 + 1085 = 10652'),# 0..9: 0.4 / 0..5,9..6
('ZEROES + ONES == BINARY','698392 + 3192 = 701584'),# 0..9: 9.7 / 0..5,9..6
(... | StarcoderdataPython |
3491655 | <reponame>vtheno/pyLexical
from datatype import *
class Expr(metaclass=TypeMeta):pass
class SYM(Expr):
def __init__(self,name):
self.name = name
class IF(Expr):
def __init__(self,e1,e2,e3):
self.e1 = e1
self.e2 = e2
self.e3 = e3
def test1():
a = SYM('a')
b = IF(a,a,a)
... | StarcoderdataPython |
11267185 | #!/usr/bin/python
"""
Script to copy images to Wikimedia Commons, or to another wiki.
Syntax:
python pwb.py imagetransfer {<pagename>|<generator>} [<options>]
The following parameters are supported:
-interwiki Look for images in pages found through interwiki links.
-keepname Keep the filename and do n... | StarcoderdataPython |
377659 | <filename>emol/emol/initialize/errors.py
# -*- coding: utf-8 -*-
"""Set up custom error handlers."""
# standard library imports
# third-party imports
from flask import render_template, request, Response, current_app
# application imports
def init_error_handlers():
"""Custom error pages for the app."""
curr... | StarcoderdataPython |
9686094 | <gh_stars>10-100
from invoke import task
from pyinvokedepends import depends
@depends(on=["./hello.c"], creates=["./a.out"])
@task
def test(c):
#c.run("gcc hello.c")
c.run("touch a.out", echo=True)
| StarcoderdataPython |
6565469 | # Quest will use QPool questions tagged 'quest'
import os
import logging
import datetime
import subprocess
from django.db import models
from django.utils.translation import ugettext_noop
from django.conf import settings
from django.db.models import Sum
from wouso.core.user.models import Player
from wouso.core.game.mode... | StarcoderdataPython |
11384803 | frase = int(input('digite um número:'))
u = frase // 1 % 10
d = frase // 10 % 10
c = frase // 100 % 10
m = frase // 1000 % 10
print ('analizando o número {}'.format(frase))
print ('unidade = {}'.format(u))
print ('dezena = {}'.format(d))
print ('centena = {}'.format(c))
print ('milhar = {}'.format (... | StarcoderdataPython |
205102 | <reponame>muelli/twisted
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.checkers}.
"""
try:
import crypt
except ImportError:
cryptSkip = 'cannot run without crypt module'
else:
cryptSkip = ''
import os
from base64 import encodebytes
from collection... | StarcoderdataPython |
112399 | from state import called
def setup():
called.append('test_pak1.setup')
def teardown():
called.append('test_pak1.teardown')
def test_one_one():
called.append('test_pak1.test_one_one')
def test_one_two():
called.append('test_pak1.test_one_two')
| StarcoderdataPython |
9632033 | <filename>sudoku_solver/constant.py
VERSION = '0.6.0'
WIDTH = 500
HEIGHT = 510
BUTTON_FONT = 'arial 15'
ENTRY_BLOCK_FONT = 'arial 30'
| StarcoderdataPython |
11225311 | from odoo import api, models, fields
from odoo import tools
class KickerStat(models.Model):
_auto = False
_name = "kicker.stat"
_description = "Kicker Statistic"
_rec_name = 'date'
_order = 'date desc'
player_id = fields.Many2one('res.partner', string='Player', readonly=True)
session_id =... | StarcoderdataPython |
4940442 | <reponame>ovekaaven/django-xmpp-server<filename>xmppserver/xmpp/matcher.py
from slixmpp import StanzaPath
def is_server_stanza(stanza):
target = stanza['to']
if target.user != '':
return False
if target.domain != '' and \
target.domain != stanza.stream.host:
return False
return T... | StarcoderdataPython |
149093 | <reponame>jjalvare/subarulink<gh_stars>1-10
# SPDX-License-Identifier: Apache-2.0
"""
subarulink - A Python Package for interacting with Subaru Starlink Remote Services API.
connection.py - provides management for HTTP sessions to Subaru API
For more details about this api, please refer to the documentation at
https... | StarcoderdataPython |
8097982 | <reponame>wwydmanski/Chemformer
import torch
from rdkit import Chem, RDLogger
class DecodeSampler:
def __init__(
self,
tokeniser,
max_seq_len,
length_norm=None
):
self.tokeniser = tokeniser
self.max_seq_len = max_seq_len
self.length_norm = length_norm
... | StarcoderdataPython |
9647636 | import yaml
import streamlit as st
from yaml.loader import SafeLoader
import streamlit.components.v1 as components
from hasher import Hasher
from authenticate import Authenticate
_RELEASE = True
if not _RELEASE:
# hashed_passwords = Hasher(['<PASSWORD>', '<PASSWORD>']).generate()
with open('../... | StarcoderdataPython |
9688486 | <filename>server/provider_base.py
# Copyright 2017-2021 Lawrence Livermore National Security, LLC and other
# CallFlow Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: MIT
# ------------------------------------------------------------------------------
import os
import shuti... | StarcoderdataPython |
5042638 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Derived Parameters
------------------
The engineering archive has pseudo-MSIDs that are derived via computation from
telemetry MSIDs. All derived parameter names begin with the characters "DP_"
(not case sensitive as usual). Otherwise there is no di... | StarcoderdataPython |
174480 |
class SearchUI:
'''SearchUI provides a means of easily assembling a search interface
for either Elasticsearch or LunrJS powered search services'''
def __init__(self, cfg):
self.cfg = {}
for key in cfg.keys():
self.cfg[key] = cfg.get(key, None)
if not ('id' in self.cfg):... | StarcoderdataPython |
4930227 | from __future__ import absolute_import
from flask import (
Blueprint, abort, flash, g, jsonify, redirect, render_template, request,
session, url_for
)
bp = Blueprint('main', __name__)
@bp.route('/')
def index():
return redirect(url_for('todos.show_index_view'))
| StarcoderdataPython |
6431184 | <gh_stars>0
# Generated by Django 2.0.1 on 2018-02-15 22:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classy', '0009_classification_logs_user_id'),
]
operations = [
migrations.AlterField(
model_name='classification',
... | StarcoderdataPython |
1685103 | <reponame>ShapedRogue/python-youtube-downloader<gh_stars>1-10
import pytube # this is where i imported the pytube module which is necessary for this script
print(
"Enter the YouTube video URL") # This is where we tell the user to input the url in which then pytube grabs the download
a = input()
b = pytube... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.