id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
9784791
<reponame>wataruito/Codes_in_Emotional_sync_Ito_et_al<filename>synchro_freeze.py ############################################################################### # pipeline to process epochs from two subjects # The original script started computer freezing epoch, but extended to generic epochs. # ''' File format for the...
StarcoderdataPython
6674103
"""Cancel an existing iSCSI account.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting @click.command() @click.argument('volume-id') @click.option('--reason', help="An option...
StarcoderdataPython
11215642
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to Create Video Clip from Prediction. Contains a pipeline to create a video clip to visualize prediction. Revision History: 2021-11-20 (ANI717 - <NAME>): Baseline Software. Example: $ python3 prediction_visualization.py """ #___Import Module...
StarcoderdataPython
1802038
try: import tbats using_bats = True except ImportError: using_bats = False # pending issue possibily similar to sklearn similar to https://github.com/alkaline-ml/pmdarima/pull/455
StarcoderdataPython
6582269
<gh_stars>1-10 from typing import Optional def __arg_count(local: dict) -> None: var_count = 0 for key in local: if local[key] is not None: var_count += 1 if var_count < 3: raise Exception(f'Need at least 3 args: [{var_count}]') # FIRST KINEMATIC EQUATION: # final_velocity = ...
StarcoderdataPython
6486573
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str """ res = [] self._preorder(root, res) return ' '.join(res) def deserialize(self, data): """Decodes your encoded data...
StarcoderdataPython
12809392
class dfw_group: def __init__(self,n): self.id = chr(n + 65) self.nations = [] self.BEG = 0 self.MID = 0 self.UPP = 0 self.GA = 0 self.GB = 0 self.GC = 0 self.GD = 0 self.totalrank = 0 def member_update(self,m,fl...
StarcoderdataPython
6436183
<reponame>costas-basdekis/aox from aox.model import CombinedInfo from aox.summary.base_summary import BaseSummary, summary_registry __all__ = ['EventSummary'] @summary_registry.register class EventSummary(BaseSummary): """ Show the stars for every year, in a horizontal table (columns are years) """ ...
StarcoderdataPython
3429358
<gh_stars>1-10 # # trace_gen.py # # # Packet format is defined in bp_me_nonsynth_pkg.vh # {cmd, addr, uncached, data} # # Trace replay mechanism adds another 4 bits at start for internal TR command class TraceGen: # constructor def __init__(self, addr_width_p, data_width_p): self.addr_width_p = addr_width_p ...
StarcoderdataPython
9785634
from input_output.input import get_configurable_answer from util.count import get_max_path_len from utility.enum import enum PresentAnswer = enum( ASK="a", DELETE="d", QUIT="q" ) def present_dead_distribution_artefacts(dead_distribution_artefacts, level=0): """ Present the distribution artefacts ...
StarcoderdataPython
6409182
''' Package containing unit test modules for various functionality. To run all unit tests, type the following from the system command line: # python -m spectral.tests.run ''' from __future__ import absolute_import, division, print_function, unicode_literals # If abort_on_fail is True, an AssertionError will be ...
StarcoderdataPython
1984291
# -*- coding: utf-8 -*- """QGIS Unit tests for edit widgets. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __au...
StarcoderdataPython
3383476
<filename>main/tests/test_api_docs.py from django.test import TestCase, Client class BaseTest(TestCase): def setUp(self): self.client = Client() return super().setUp() def test_api_docs(self): response = self.client.get('/api/docs') self.assertEqual(response.status_code, 200) ...
StarcoderdataPython
4884386
''' Copyright 2020 <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 required by applicable law or agreed to in writing...
StarcoderdataPython
1774873
from colorama import Fore, Style from enum import Enum from functools import total_ordering class Logger: indents = 0 indentsFlag = True @total_ordering class Levels: # __order__ = "CRITICAL FATAL ERROR SUCCESS WARNING NOTICE INFO VERBOSE DEBUG SPAM ALL" NONE = 100 """ No log is printed if level==NONE""" ...
StarcoderdataPython
11293057
# encoding: utf-8 ''' @author: developer @software: python @file: run34.py @time: 2021/8/18 23:00 @desc: ''' ''' 描述 把一个字符串中所有出现的大写字母都替换成小写字母,同时把小写字母替换成大写字母。 输入 输入一行:待互换的字符串。 输出 输出一行:完成互换的字符串(字符串长度小于80)。 样例输入 If so, you already have a Google Account. You can sign in on the right. 样例输出 iF SO, YOU ALREADY HAVE A gOOGLE...
StarcoderdataPython
11311741
"""Tests for FOOOF core.modutils. Note: decorators (that are in modutils) are currently not tested. """ from fooof import FOOOF from fooof.core.modutils import * ################################################################################################### #######################################################...
StarcoderdataPython
1990542
<reponame>blaxminarayan-r7/insightconnect-plugins<gh_stars>10-100 import insightconnect_plugin_runtime from .schema import ExtractAllInput, ExtractAllOutput, Input, Output, Component # Custom imports below from icon_extractit.util.util import Regex from icon_extractit.util.extractor import extract, parse_time, clear_...
StarcoderdataPython
5199719
import urllib2 from bs4 import BeautifulSoup def crawl_web(seed): # returns index, graph of outlinks tocrawl = [seed] crawled = [] graph = {} # <url>:[list of pages it links to] index = {} while tocrawl: page = tocrawl.pop() if page not in crawled: content = get_page(p...
StarcoderdataPython
11323695
<reponame>cloudbase/oslo.windows # Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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/license...
StarcoderdataPython
3437181
<filename>Packs/GoogleKubernetesEngine/Integrations/GoogleKubernetesEngine/GoogleKubernetesEngine_test.py<gh_stars>1-10 def test_parse_cluster(datadir): from GoogleKubernetesEngine import parse_cluster from json import load parsed_act = parse_cluster(load(open(datadir["cluster_raw_response.json"]))) e...
StarcoderdataPython
271642
import cv2 import imutils import numpy as np from tqdm import tqdm from glob import glob from metrics_losses.metrics_and_losses import * ''' evaluate the images in a directory and log the outputs ''' IMG_FORMATS = '.bmp' DISTORTED_IMAGES_DIR = '../../data/PIPAL_Dataset-Testing_Distorted_Ima/Dis' REFERENCE_IMAGES_DIR ...
StarcoderdataPython
8192427
#!/usr/bin/env python import numpy as np import cv2 import os.path as osp import pickle import time import imutils import math import cPickle as pkl import os SHORT = False import rospy # from hrl_lib.util import load_pickle def load_pickle(filename): with open(filename, 'rb') as f: return pickle.load(f...
StarcoderdataPython
3225988
#coding=utf-8 from flask import Flask app = Flask(__name__) app.config.from_object('config') from app import exhibit from app import search
StarcoderdataPython
4985298
from django.urls import path from . import views from django.views.decorators.cache import cache_page from .views import (IndexView, GroupView, ProfileView, PostView, NewPostView, PostEditView, PostDe...
StarcoderdataPython
94305
<reponame>ghcetraro/my-weather #!/usr/bin/python # Internet de las Cosas - http://internetdelascosas.cl # # Descripcion : Programa que permite obtener la lectura de un sensor DHT11 # Lenguaje : Python # Autor : <NAME> <<EMAIL>> # Dependencias : Libreria de Adafruit https://github.com/adafruit/Adafruit_Pyt...
StarcoderdataPython
3429144
<reponame>davidvhill/ccd<filename>ccd/models/robust_fit.py """ Perform an iteratively re-weighted least squares 'robust regression'. Basically a clone of `statsmodels.robust.robust_linear_model.RLM` without all the lovely, but costly, creature comforts. Reference: http://statsmodels.sourceforge.net/stable/rlm.html...
StarcoderdataPython
6667269
# LOAD NO SLOW MODULES HERE! # This is to keep loading the launcher module fast. import os from firexapp.submit.uid import Uid def get_blaze_dir(logs_dir, instance_name=None): if instance_name is None: instance_name = 'blaze' return os.path.join(logs_dir, Uid.debug_dirname, instance_name)
StarcoderdataPython
3496275
from django.core.mail import send_mail from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render from contact.forms import ContactForm def contact(request): # errors = [] if request.method == 'POST': """ Validation form to be replaced if not reque...
StarcoderdataPython
6443584
### This is a library file for support functions necessary ### for implementing a kNN-algorithm for time series motions import csv import math # data is in the form of a matrix # data is 8 dimensional along feature axis # function to load in csv data def load(file) : matrix = [] with open(file) as csvfile : dat...
StarcoderdataPython
8152505
from PyQt5.QtWidgets import QWidget, QVBoxLayout, \ QListWidget, QPushButton from PyQt5.QtWidgets import QInputDialog, QLineEdit from scgv.qtviews.profiles_window import ShowProfilesWindow class ProfilesActions(QWidget): def __init__(self, main, *args, **kwargs): super(ProfilesActions, self).__init...
StarcoderdataPython
3257527
<reponame>VenkateshBH99/django_local_library from django.conf.urls import url from . import views app_name='predict' urlpatterns=[ url(r'^(?P<pk>\d+)$',views.PredictRisk,name='predict') ]
StarcoderdataPython
8169060
from django.conf.urls import url from django.test.utils import override_settings from django.views import generic from django_webtest import WebTest from .. import forms @override_settings(ROOT_URLCONF=__name__) class Test(WebTest): def test_default_usecase(self): page = self.app.get('/demo/checkout/') ...
StarcoderdataPython
8000033
<reponame>metux/chromium-deb<gh_stars>0 # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ######################################################## # NOTE: THIS FILE IS GENERATED. DO NOT EDIT IT! # # I...
StarcoderdataPython
4831681
from django.contrib import admin # Register your models here. from .models import Person admin.site.register(Person)
StarcoderdataPython
8103090
<filename>pychron/canvas/canvas2D/video_canvas.py # =============================================================================== # Copyright 2011 <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 th...
StarcoderdataPython
9715488
<reponame>GauGau2/dominiontabs from setuptools import setup, find_packages version = '3.5.0' setup( name="domdiv", version=version, entry_points={ 'console_scripts': [ "dominion_dividers = domdiv.main:main" ], }, packages=find_packages(exclude=['tests']), install_re...
StarcoderdataPython
4904090
<filename>src/products/convert_catalog_data.py<gh_stars>1-10 # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 ''' Utility script that can be run locally to convert the catalog data from a CSV file. Usage: python convert_catalog_data.py [-h] CATALOG_CSV_FILE Where...
StarcoderdataPython
1802072
class MargaritaShotgunError(Exception): """ Base Error Class """ class InvalidConfigurationError(MargaritaShotgunError): """ Raised when an unsupported configuration option is supplied """ def __init__(self, key, value, reason='unsupported configuration'): msg = "Invalid Configuration \"{}...
StarcoderdataPython
3222268
import json import numpy as np _json_keys = dict( data="arraydata", dtype="arraydtype", shape="arraysize" ) _complex_keys = dict( real="real", imag="imag" ) def dumps(data, json_keys=None, complex_keys=None): global _json_keys, _complex_keys if json_keys is None: json_key...
StarcoderdataPython
6420463
<reponame>raroes/scientific-silos #!/usr/bin/python3 # this script implements bidirectional breadth-first search for the citation network import sys from datetime import datetime from collections import deque if len(sys.argv) > 1: input_file = sys.argv[1] else: input_file = "interactions_tuplets.txt" print...
StarcoderdataPython
11307056
# # ____ _____ ____ __ __ ____ _ ___ # | \ / ___/| \ | | || || | | \ # | _ ( \_ | o )| | | | | | | | \ # | | |\__ || || | | | | | |___ | D | # | | |/ \ || O || : | | | | || | # | | |\ || || | | | | || | # |__|__| \___||__...
StarcoderdataPython
368475
<gh_stars>0 import operator def alphabetize_names( names: dict ) -> dict: return sorted( names, key=lambda item: [item['last'], item['first']] ) def alphabetize_names_v2( names: dict ) -> dict: return sorted( sorted(names, key=operator.itemgetter('first')), key=op...
StarcoderdataPython
3497583
<filename>mmt/data/preprocessor/text_preprocessor.py from typing import Optional import numpy as np import pandas as pd from pytorch_widedeep.utils.fastai_transforms import Vocab from pytorch_widedeep.utils.text_utils import build_embeddings_matrix, get_texts, pad_sequences from .base_preprocessor import BasePreproce...
StarcoderdataPython
4934671
from collections import namedtuple from typing import Tuple, Union import PIL.Image import matplotlib.pyplot as plt from pydispix.errors import CanvasFormatError Dimensions = namedtuple("Dimensions", ("width", "height")) SizeType = Union[Dimensions, Tuple[int, int]] class Pixel: """A single pixel of the canva...
StarcoderdataPython
8060608
class LocalDiffeoTransform: """ This is a generalization of torch.distributions.transforms.Transform, where the transform is a local diffeomorphism and thus has a discrete set as inverse. """ event_dim = 0 def __init__(self, cache_size=1): self._cache_size = cache_size self._in...
StarcoderdataPython
11216816
import os import sys #Adding directory to the path where Python searches for modules cmd_folder = os.path.dirname('/home/arvind/Documents/Me/My_Projects/Git/Crypto/modules/') sys.path.insert(0, cmd_folder) import mtrand if __name__ == "__main__": mt= [] mtrand.init_by_array(19650218) n= 1 for i in ran...
StarcoderdataPython
346007
import logging from celery import shared_task from django.conf import settings from frisky.models import Workspace, Channel, Member from slack.events import SlackEventParser from slack.processor import SlackEventProcessor, EventProperties from slack.wrapper import SlackWrapper logger = logging.getLogger(__name__) S...
StarcoderdataPython
9721484
"""Executor for x86 Machine code. This Executor may be dangerous for the executing machine This Executor expects a NFN file as following: x86 <entry point name> <base64 encoded x86 library code as string> """ import tempfile import base64 from PiCN.Layers.NFNLayer.NFNExecutor import BaseNFNExecutor from typing impor...
StarcoderdataPython
3317442
<reponame>stungkit/Copycat-abstractive-opinion-summarizer def isnan(x): return x != x def collect_arts(coll, arts): """Collects in-place recently produced artifacts to `coll`.""" for k, v in arts.items(): if k not in coll: coll[k] = [] coll[k].append(v)
StarcoderdataPython
6520746
<gh_stars>1-10 #!/usr/bin/python3 import unittest from botocore.exceptions import ClientError import sys import datetime import threading from queue import Queue from . import util class DomainTestCase(unittest.TestCase): """ Integration tests for SWF domains """ def test_ListDomai...
StarcoderdataPython
11310479
from django.db.models.signals import post_save from django.contrib.auth.models import User from django.dispatch import receiver from .models import Profile @receiver(post_save,sender = User) def created_profile(sender,instance,created,**kwargs): print("Making a Profile") if created: Profile.objects....
StarcoderdataPython
1716788
<reponame>MrDelik/core """The tests for the litejet component.""" from homeassistant.components import switch from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON from . import async_init_integration ENTITY_SWITCH = "switch.mock_switch_1" ENTITY_SWITCH_NUMBER = 1 ENTITY_OTHER_SWITCH = "sw...
StarcoderdataPython
11277140
<reponame>rbradley0/ubnt_inform<filename>inform_server.py # coding: utf-8 ''' Unifi Inform Protocol plugin for Puffin WebServer, all code is from documentation about how the Unifi Inform Protocol works and functions. This script is an updated working rewrite of the script published by Eric W <<EMAIL>> that uses Snappy...
StarcoderdataPython
9732636
<filename>02_classify_mutations/nbconverted/plot_methylation_results.py<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # ## Plot mutation prediction results # In this notebook, we'll compare the results of our mutation prediction experiments for expression and methylation data only (see `README.md` for more details...
StarcoderdataPython
5035665
<filename>myInProject/myInApp/apps.py<gh_stars>0 from django.apps import AppConfig class MyinappConfig(AppConfig): name = 'myInApp'
StarcoderdataPython
99289
from ray.rllib.models.torch.torch_modelv2 import TorchModelV2 from ray.rllib.models import ModelCatalog from ray.rllib.utils.annotations import override from ray.rllib.utils import try_import_torch torch, nn = try_import_torch() from utils.utils import get_conv_output_shape ########################################...
StarcoderdataPython
8138773
import sys PY3 = sys.version_info[0] >= 3 def pytest_ignore_collect(path, config): basename = path.basename if not PY3 and "py3" in basename or PY3 and "py2" in basename or 'pytest' in basename: return True
StarcoderdataPython
8180209
<filename>server/medications/migrations/0008_auto_20190610_1907.py # Generated by Django 2.2.1 on 2019-06-10 19:07 import ckeditor.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('medications', '0007_effect_category'), ] operations = [ ...
StarcoderdataPython
11381797
"""MongoDB Session Interface""" import typing as t from datetime import datetime, timedelta import uuid from bson.tz_util import utc from flask.sessions import SessionInterface, SessionMixin from werkzeug.datastructures import CallbackDict # Type checking if t.TYPE_CHECKING: from flask.app import Flask from f...
StarcoderdataPython
9745506
# -*- coding: utf-8 -* # Copyright (c) 2019 BuildGroup Data Services, Inc. # All rights reserved. # This software is proprietary and confidential and may not under # any circumstances be used, copied, or distributed. from django.contrib.auth.forms import UserCreationForm, UserChangeForm from .models import CaravaggioU...
StarcoderdataPython
8007291
<reponame>drforse/aiogram_oop_framework from aiogram import Dispatcher from .message import MessageView class EditedChannelPostView(MessageView): @classmethod def register(cls, dp: Dispatcher): callback = cls._execute kwargs = cls.register_kwargs if cls.register_kwargs else {} custom...
StarcoderdataPython
6476489
<filename>src/data_loader/utils.py import copy from math import cos, pi, sin from typing import Tuple, Union import numpy as np import torch from PIL import Image from src.data_loader.joints import Joints from src.types import CAMERA_PARAM, JOINTS_3D, JOINTS_25D, SCALE from src.constants import MANO_MAT from torch.uti...
StarcoderdataPython
180800
# -*- coding: utf-8 -*- """ Script Name: __init__.py.py Author: <NAME>/Jimmy - 3D artist. Description: """ # ------------------------------------------------------------------------------------------------------------- from .Action import Action, ShortCut, WidgetAction from .Application import App...
StarcoderdataPython
9747976
import alfred3 as al from alfred3 import admin exp = al.Experiment() class MySpectatorPage(admin.SpectatorPage): def on_exp_access(self): self += al.Text("My spectator page") class MyOperatorPage(admin.OperatorPage): def on_exp_access(self): self += al.Text("My operator page") class MyM...
StarcoderdataPython
6673168
<reponame>EpicEric/base_stations_django<filename>cluster/admin.py from django.contrib.gis import admin from leaflet.admin import LeafletGeoAdmin from cluster.models import BaseStationCluster admin.site.register(BaseStationCluster, LeafletGeoAdmin)
StarcoderdataPython
3252131
import torch from torch import nn from torch.nn import Module from torchvision.transforms import transforms from nn_interpretability.interpretation.backprop.backprop_base import BackPropBase from nn_interpretability.interpretation.backprop.smooth_grad import add_noise class IntegratedGrad(BackPropBase): """ I...
StarcoderdataPython
6689786
<reponame>p0p0p0/Search-Tools # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'f:\HackTools\python\searchtools_test\search.ui' # # Created by: PyQt5 UI code generator 5.15.1 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file un...
StarcoderdataPython
1615629
from flask_sqlalchemy import SQLAlchemy from passlib.hash import pbkdf2_sha256 db = SQLAlchemy() class User(db.Model): __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(100), unique=True, nullable=False) password = db.Column(db.String()) admin = d...
StarcoderdataPython
12844346
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 18 09:08:20 2022 A script to plot mean daily cores for intercomparison of features as a function of time through a season. @author: michaeltown """ #libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import os import...
StarcoderdataPython
3541929
<gh_stars>1-10 from builtins import id as identifier from toga.command import CommandSet from toga.platform import get_platform_factory class Window: """The top level container of a application. Args: id (str): The ID of the window (optional). title (str): Title for the window (optional). ...
StarcoderdataPython
3465524
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import csv import datetime import django import logging import os import pysftp import re import shutil import sys import time import uuid from django.db import connections from django.conf import settings from djimix.core.utils import ...
StarcoderdataPython
4948212
<filename>scr/bie/__init__.py<gh_stars>0 """ BIE for Laplace and Helmholtz Author: <NAME> Karlsruhe Institute of Technology, Germany """ from .derivative import mat_d2, mat_d2_ev, mat_d2_od from .grid import grid, half_grid, parity_base from .helmholtz_exterior_dirichlet import ( helmholtz_dirichl...
StarcoderdataPython
1663638
from __future__ import print_function, unicode_literals from flask import render_template, request, flash, Blueprint from .calcs import dbs_to_excel, recalculate_CO2_from_excel from io import open import os import traceback vindta = Blueprint('vindta', __name__) @vindta.route('/', methods=['GET', 'POST']) def index()...
StarcoderdataPython
31963
<filename>Test.py from Scanner import * from threading import Thread Scanner = Scan_Handler(verbose=False, verbosity="high", threads=50, ports=[80, 443]) Scanner.Start_Scanner("192.168.0.1", "192.168.0.5") def Background (): for data in Scanner.Get_Outputs_Realtime(): print(str(data)) bg = Thread(targe...
StarcoderdataPython
8013300
import random from math import sqrt positions = [] for i in range(16): p = [random.random()*2-1, random.random()*2-1] length = sqrt(p[0]*p[0] + p[1]*p[1]) new_length = random.random() new_length = (new_length*new_length)*0.9 + 0.1 multiplier = new_length / length p[0] *= multiplier p[1] *= multiplier print('...
StarcoderdataPython
9780867
<reponame>Aragami1408/competitive-programming a,b = tuple(int(x) for x in input("").split(" ")) y = 0 while a <= b: a *= 3 b *= 2 y += 1 print(y)
StarcoderdataPython
11248593
<gh_stars>10-100 from typing import Any from fastapi import APIRouter, Body, Depends, HTTPException from fastapi.encoders import jsonable_encoder from pydantic.networks import EmailStr from sqlalchemy.orm import Session import crud import models import schemas from api import deps from core.config import settings fro...
StarcoderdataPython
6485349
n,m = map(int, input().split()) print(max(n,m))
StarcoderdataPython
11388868
<reponame>aliddell/spiketag<filename>spiketag/__init__.py<gh_stars>1-10 # from .spiketag import check_fpga __version__ = '0.1.0' # from .mvc.Control import Sorter import mkl mkl.set_num_threads(1) #prevent the conflicts on the multicore computing (numba, pytorch and ipyparallel) from IPython.core.magic imp...
StarcoderdataPython
5058098
############################################################################# # # simplespeedtest.py # # Description: # # This program continually measures the upload, download and # ping speeds of your internet connection, and then writes that information # in CSV format to ...
StarcoderdataPython
5098576
from django import template from django.templatetags.static import static register = template.Library() # Django incluison tag plays elegant way to separete bootstrap template logic # from app template, that separation is need for theme the projects_type # Pass in kwargs the elements to fill the cards # Please note ...
StarcoderdataPython
72782
<reponame>jo2y/google-cloud-python # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from google.cloud.bigtable_admin_v2.proto import bigtable_table_admin_pb2 as google_dot_cloud_dot_bigtable_dot_admin__v2_dot_proto_dot_bigtable__table__admin__pb2 from google.cloud.bigtable_admin_v2.pro...
StarcoderdataPython
8068627
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ csv2ofx.main ~~~~~~~~~~~~ Provides the primary ofx and qif conversion functions Examples: literal blocks:: python example_google.py Attributes: ENCODING (str): Default file encoding. """ from __future__ import ( absolu...
StarcoderdataPython
6568674
#!/usr/bin/env python2 import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "astrolove")) sys.path.append("/usr/lib/astrolove") import numpy as np import astrolib as AL from optparse import OptionParser parser = OptionParser(usage = "usage: %prog [opts] in_file out_file") parser.add_option("...
StarcoderdataPython
214090
# 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 # distributed under t...
StarcoderdataPython
4995679
<filename>jag/examples/tensorflow/lm/mlflow_utils.py import mlflow from tensorflow.keras.callbacks import Callback class MLflowLogger(Callback): """ Keras callback for logging metrics and final model with MLflow. Metrics are logged after every epoch. The logger keeps track of the best model based on t...
StarcoderdataPython
1691747
import random import numpy as np class epsilon_greedy_strategy(object): def __init__(self, initial_epsilon = 1, decremental_epsilon = 1E-4, epsilon_min = 0.1, seed = 0): self.initial_epsilon = initial_epsilon self.decremental_epsilon = decremental_epsilon self.epsilon_min = epsilon_min ...
StarcoderdataPython
232890
code = bytearray([ 0xa9, 0xff, 0x8d, 0x02, 0x60, 0xa9, 0x55, # lda #$55 0x8d, 0x00, 0x60, #sta $6000 0xa9, 0x00, # lda #00 0x8d, 0x00, 0x60, #sta $6000 0x4c, 0x05, 0x80 #jmp 8005 (#lda $55) ]) rom = code + bytearray([0xea] * (32768 - len(code)) ) rom[0x7ffc] = 0x00 rom[0x7ffd] = 0x...
StarcoderdataPython
4966846
# -*- 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 required by applicable la...
StarcoderdataPython
89223
from cm.model import CMObjectBase from cm import datetime class InterviewManager(CMObjectBase): def get(self, kw): order_sql = self._get_sort_order(kw) by = kw.get('sort_by') if by == 'interview_id': by_sql = 'interview_id' elif by == 'date': by_sql...
StarcoderdataPython
4955105
<reponame>Shreyashwaghe/monk_v1<filename>monk/pytorch/datasets/params.py from pytorch.datasets.imports import * from system.imports import * @accepts([int, tuple], dict, post_trace=True) @TraceFunction(trace_args=False, trace_rv=False) def set_input_size(input_size, system_dict): ''' Set Input data size ...
StarcoderdataPython
3358399
import numpy as np # type: ignore import json import argparse parser = argparse.ArgumentParser() parser.add_argument("--input-file", type=str, help="JSON file containing seqlevel cross-entropies") args = parser.parse_args() def standard_error(npa): return np.std(npa, ddof=1) / np.sqrt(np.size(npa)) def ninetyfi...
StarcoderdataPython
203809
<gh_stars>0 #!/usr/bin/python # Classification (U) """Program: argparser_arg_exist.py Description: Unit testing of arg_exist in gen_class.ArgParser class. Usage: test/unit/gen_class/argparser_arg_exist.py Arguments: """ # Libraries and Global Variables # Standard import sys import os if sy...
StarcoderdataPython
6563481
import os import ConfigParser import option import utility import grapeGit as git import grapeConfig #option that installs wrapper calls to grape as git hooks in this repo. class InstallHooks(option.Option): """ grape installHooks Installs callbacks to grape in .git/hooks, allowing grape-configurable hooks t...
StarcoderdataPython
12824688
<gh_stars>0 nome = str(input('Qual é seu nome ? ')) if nome == 'Bruno': print('Que nome bonito!') elif nome == 'Pedro' or nome == 'Maria' or nome == 'Silva': print('Seu nome é bem popular no Brasil.') elif nome in 'Alessandra': print('Belo nome feminino.') else: print('Seu nome é bem normal.')
StarcoderdataPython
11350271
<reponame>Rodrigo-Flores/CS-Projects<gh_stars>0 import csv class Analizer: def __init__(self, dataset): self.dataset = dataset def age_average(self): with open(self.dataset) as insurances: insurances_df = csv.DictReader(insurances) sum = 0 quantity = 0 ...
StarcoderdataPython
133859
<gh_stars>0 import pytest from ..sanddance import SandDanceWidget def test_default(): w = SandDanceWidget() assert w.height == '60vh'
StarcoderdataPython
6559387
<reponame>Omi0604/DCU-Einstein-<filename>ex1-count-capitals.py<gh_stars>0 #!/usr/bin/env python3 s = input() total = 0 i = 0 while not "A" <= s[i] and s[i] <= "Z": total = i + 1 i = i + 1 print(3)
StarcoderdataPython
250862
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.3' # jupytext_version: 1.0.0 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + {"id": "pAMmqTAvXVN6"...
StarcoderdataPython