id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
3387191 | <reponame>arkuhn/PneumoniaClassifier<filename>generatorDemo.py
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
image_augmentor = ImageDataGenerator (
rescale=1./255,
horizontal_flip=True,
fill_mode='nearest'
)
base_image = load_img('data/TEST/NORMAL/IM-0001-... | StarcoderdataPython |
3383488 | <gh_stars>1000+
from django.forms import CheckboxSelectMultiple
from ralph.admin.mixins import RalphAdminForm
from ralph.sim_cards.models import SIMCard
class SIMCardForm(RalphAdminForm):
class Meta:
model = SIMCard
exclude = []
widgets = {
'features': CheckboxSelectMultiple,
... | StarcoderdataPython |
63867 | """
Given a lowercase string, s, return the index fo the first character that appears just once in a string.
If every character appears more than once, return -1
Example input:
s: "Who wants hot watermelon?"
Example Output:
8
Explanation:
"who wants hot watermelon?"
^
012345678
The first charactter ... | StarcoderdataPython |
1797824 | <reponame>sh4rpy/mail_notifications<filename>notifications/tasks.py<gh_stars>0
from django.conf import settings
from django.core.mail import send_mail
from mail_notifications.celery import app as celery_app
@celery_app.task
def send_notification_task(subject, message, recipients):
send_mail(
subject=subj... | StarcoderdataPython |
3323724 | '''
This class represents a table in the database
It is mostly used as a parameter for pythonmysequel.Connection methods
'''
from pythonmysequel.values import _ValueType
class Table:
def __init__(self,
table_name:str, **values:_ValueType) -> None:
self.table_name = table_name
self.... | StarcoderdataPython |
77276 | from collections import namedtuple
import os
from azure.mgmt.storage import StorageManagementClient
from azure_devtools.scenario_tests.preparers import (
AbstractPreparer,
SingleValueReplacer,
)
from azure_devtools.scenario_tests.exceptions import AzureTestError
from . import AzureMgmtPreparer, ResourceGroup... | StarcoderdataPython |
3263894 | <reponame>froukees/querybook
import numpy as np
from lib.table_upload.common import UploadTableColumnType
dtype_to_upload_column_type = {
np.dtype("bool"): UploadTableColumnType.BOOLEAN,
np.dtype("float64"): UploadTableColumnType.FLOAT,
np.dtype("int64"): UploadTableColumnType.INTEGER,
np.dtype("objec... | StarcoderdataPython |
3399548 | <gh_stars>0
"""Copyright 2014 <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, software
... | StarcoderdataPython |
1787025 | <gh_stars>0
# -*- encoding: utf-8 -*-
from flask.ext.sqlalchemy import SQLAlchemy
from vpnchooser.applicaton import app
db = SQLAlchemy(app)
| StarcoderdataPython |
3258102 | # coding=utf-8
# Copyright 2018 The TensorFlow 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 requ... | StarcoderdataPython |
3396014 | # Copyright 2012-2014 Ravello Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | StarcoderdataPython |
3372337 | from collections.abc import Sequence
from typing import List
import pandas as pd
from engine.core.StateUtil import StateUtil
class JourneyEntity:
def __init__(self) -> None:
self.description = None
self.journey = None
self.family = None
self.avaSlo = None
self.expSlo = No... | StarcoderdataPython |
119063 | from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import WebDriverException
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by ... | StarcoderdataPython |
3348967 | #namespacer for objc
#(c) Francesco "redsh" Rossi 2013
import os,sys,json,subprocess
out = subprocess.check_output(['grep', '-rn', '@inte'+'rface', '.'])
prefix = 'RD_'
print('//Paste the following to your prefix.h')
lines = out.split('\n')
for l in lines:
print l
for l in lines:
l = l.split('@inte'+'rface ')
... | StarcoderdataPython |
3250030 | from modelClass import model
from init_proposedPGMM_timeBased import init_proposedPGMM_timeBased
from EM_tensorGMM import EM_tensorGMM
from reproduction_DSGMR import reproduction_DSGMR
from plotGMM import plotGMM
import numpy as np
class TPGMM_GMR(object):
def __init__(self, nbStates, nbFrames, nbVar):
sel... | StarcoderdataPython |
3303594 | <gh_stars>1-10
""" Data model for mapping KiSAO terms for algorithms and their parameters
to COBRApy methods and their arguments
:Author: <NAME> <<EMAIL>>
:Date: 2020-12-31
:Copyright: 2020, BioSimulators Team
:License: MIT
"""
from biosimulators_utils.data_model import ValueType
import cobra.flux_analysis
import col... | StarcoderdataPython |
3262911 | <reponame>m-naumann/corridor<filename>python_api/scripts/main_corridor_editor.py
"""
===========
Corridor Editor
===========
Derived from the path_editor.py example, available at matplotlib.org:
https://matplotlib.org/gallery/event_handling/path_editor.html#sphx-glr-gallery-event-handling-path-editor-py
"""
import n... | StarcoderdataPython |
4840243 | <gh_stars>1-10
from __future__ import print_function
import re
import getpass
import sys
import os
import indextuning_utility as idx_utility
import indextuning_indextempoutput
import indextuning_dirchecker
import datetime
import shutil
import argparse
import logging
from logging.config import dictConfig
import requests... | StarcoderdataPython |
115585 | # pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring,line-too-long
from unittest import TestCase
import eze.utils.windowslex as windowslex
class TestWindowslex(TestCase):
def test_join__with_at(self):
# Given
expected_output = 'trufflehog3 -json "mel@a$£" ... | StarcoderdataPython |
3260772 | ##
## Name: bulls.py
## Purpose: Classes representing bulletin summaries and data.
##
## Copyright (C) 2004-2006 <NAME>, All Rights Reserved.
##
## Some BlitzMail installations (notably, the original at Dartmouth
## College) provide a "bulletin" service similar to local Usenet news
## groups. The main interface to ... | StarcoderdataPython |
1650716 | <filename>python_modules/dagster-test/dagster_test/graph_job_op_toys/big_honkin_asset_graph.py
import random
from typing import Sequence
from dagster.core.asset_defs import AssetIn, asset, build_assets_job
N_ASSETS = 1000
def generate_big_honkin_assets() -> Sequence:
random.seed(5438790)
assets = []
fo... | StarcoderdataPython |
3342685 | ######################################################################
# NotesToType.py : a script which turns notes detected by the
# microphone into keyboard output.
# Dependencies: numpy, pyaudio, pyautogui, audioop
# The default configuration for notes are:
# C4 -> COPY (CTRL + C)
# D4 -> PASTE (CTRL + V)
#... | StarcoderdataPython |
113922 | <gh_stars>0
from django.urls import path
from . import views
app_name = 'polls'
urlpatterns = [
path('', views.IndexView.as_view(), name='Index'),
path('<int:pk>/soyelmejor/', views.DetailView.as_view(), name='Detail'),
path('<int:pk>/results/', views.ResultsView.as_view(), name='Results'),
path('<int... | StarcoderdataPython |
3225036 | #!/usr/bin/env python3
import csv
def read_employees(csv_file_location):
with open(csv_file_location) as file:
csv.register_dialect('empDialect', skipinitialspace=True, strict=True)
employee_file = csv.DictReader(open(csv_file_location), dialect = 'empDialect')
e... | StarcoderdataPython |
1605042 | <gh_stars>0
import logging
logger = logging.getLogger('nmtpytorch')
import torch
from .am_transformer import AttentiveMultimodalTransformer
from ..layers import (
SequentialImaginationDecoder,
SequentialImaginationDecoderV2
)
def get_aux_task_decoder(aux_task):
return {
'imagination': Sequentia... | StarcoderdataPython |
1797975 | from opendata.settings.dev import *
RECAPTCHA_PRIVATE_KEY = "no-secret-only-for-testing"
| StarcoderdataPython |
3213119 | import warnings
warnings.warn("This package is experimental and could change or "
"be removed in the future. "
"`ml.features.normalization` can be used instead.")
from .c_scaler_sklearn import CScalerSkLearn
from .c_scaler_norm import CScalerNorm
from .c_scaler_minmax import CScalerMinMax
f... | StarcoderdataPython |
1608187 | <gh_stars>10-100
import sys
import os
import subprocess
from setuptools import setup, find_packages
import get_stanford_models
get_stanford_models.main()
packages = [p for p in find_packages() if "pycocoevalcap" in p]
setup(
name="pycocoevalcap",
packages=packages,
package_dir={"pycocoevalcap": "pycocoev... | StarcoderdataPython |
3223437 | # -*- coding: utf-8 -*-
from django.contrib.auth import get_user_model
User = get_user_model()
class SuBackend(object):
supports_inactive_user = False
def authenticate(self, request=None, su=False, user_id=None, **kwargs):
if not su:
return None
try:
user = User._de... | StarcoderdataPython |
1704357 | <filename>hknweb/tutoring/views.py
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.template import loader
from .models import Tutor
from .models import Day
from .models import Slot
def future(request):
return HttpResponse("Hello, world. You're at the future index."... | StarcoderdataPython |
3299771 | <filename>bluesky_mpl/heuristics/image.py
import functools
import logging
import numpy
from traitlets import default
from traitlets.traitlets import Dict, Type
from traitlets.config import Configurable
from ..utils import load_config, Callable
log = logging.getLogger('bluesky_mpl')
def first_frame(event_page, imag... | StarcoderdataPython |
3270094 | <reponame>elviva404/wagtail-torchbox
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-01-15 21:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import tbx.core.blocks
import wagtail.core.blocks
import wagtail.co... | StarcoderdataPython |
3291645 | /home/runner/.cache/pip/pool/9b/3d/37/959995d1b99cf65b1844850eba3ec3b2ee4fb70abe52d195ab915d559e | StarcoderdataPython |
1610675 | <reponame>sandeepinigithub/IPM<gh_stars>0
from django.db import models
class User(models.Model):
user_name= models.CharField(max_length=50)
user_password= models.CharField(max_length=50)
def _str_(self):
return self.user_name+'-'+self.user_password
| StarcoderdataPython |
3380389 | #-*- coding:utf-8 -*-
from setuptools import setup, find_packages
import sys, os
setup(
name='universalmutator',
version='1.0.16',
description='Universal regexp-based mutation tool',
long_description_content_type="text/markdown",
long_description=open('README.md').read(),
packages=['universalm... | StarcoderdataPython |
52840 | <reponame>barisozbas/IEEExtreme<gh_stars>1-10
import math
r = float(raw_input())
gap = lambda (a1,b1), (a2,b2) : math.sqrt( (a1 - a2) * (a1 - a2) + (b1- b2) * (b1-b2) )
polar = lambda r , angle : ( math.cos( angle ) * r, math.sin( angle ) * r)
coord = {0 : (0,0)}
for i in xrange (0,26):
letter, angle = raw_input... | StarcoderdataPython |
1740149 | from django.db import models
# Create your models here.
class Article(models.Model):
class Meta:
ordering = ('-timestamp',)
slug = models.CharField(max_length=100)
name = models.CharField(max_length=255)
is_published = models.BooleanField(default=False)
timestamp = models.DateTimeField(auto... | StarcoderdataPython |
3389936 | import wave
import os
from helpers import *
from rtttl_parser import RtttlParser
from synthesizer import Synthesizer
from effects_processor import EffectsProcessor
from struct import pack
class WavGenerator(object):
def __init__(self, song_id, organ_registry, rtttl, effects = ['none']):
self.song_id ... | StarcoderdataPython |
60885 | <filename>depfetch/pm/__init__.py
from depfetch.pm import apt
| StarcoderdataPython |
121084 | import scipy.io as sio
from pathlib import Path
import numpy as np
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui
mask = np.array([np.ones(32), np.ones(32), np.ones(32),np.concatenate((np.zeros(14), np.ones(18))),
np.concatenate((np.zeros(14), np.ones(18))),
np.concat... | StarcoderdataPython |
67424 | # all the imports
# from __future__ import with_statement
# from contextlib import closing
from flask import (
Flask,
request,
session,
make_response,
g,
redirect,
url_for,
abort,
render_template,
flash,
)
import random
import os
import csv
import re
import blurbs
import result... | StarcoderdataPython |
90751 | <filename>scripts/artifacts/smanagerCrash.py
import sqlite3
import textwrap
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly
def get_smanagerCrash(files_found, report_folder, seeker, wrap_text):
file_foun... | StarcoderdataPython |
182488 | <reponame>pagopa/cstar-cli
import psycopg2
import psycopg2.extras
import pandas as pd
import pandas.io.sql as psql
import random
from datetime import timedelta, datetime, date
import string
from .constants import CITIZEN_RANKING_EXT_SCHEMA
class Awardperiod() :
def __init__(self, args):
self.args = args
... | StarcoderdataPython |
1669340 | from .driverUpdater import DriverUpdater # pylint: disable=wrong-import-position
| StarcoderdataPython |
3325555 | <gh_stars>0
from django.urls import path
from . import views
app_name = 'labs'
urlpatterns = [
path('', views.index, name='index'),
path('run/', views.run, name='run'),
path('delete/<id>', views.delete, name='delete'),
]
| StarcoderdataPython |
147886 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2018-01-25 18:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('menu', '0010_auto_20180125_1325'),
]
operations = [
migrations.RemoveField(
... | StarcoderdataPython |
3337328 | <reponame>sabneet95/Quantum-Computing
'''Quantum Fourier Transform Simulator for Shor's Algorithm'''
import cirq
import numpy as np
# define the initial four qubits
q0 = cirq.GridQubit(0, 0) # |0〉
q1 = cirq.GridQubit(0, 1) # |0〉
q2 = cirq.GridQubit(1, 0) # |0〉
q3 = cirq.GridQubit(1, 1) # |0〉
def main():
'''Simul... | StarcoderdataPython |
3377 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from setuptools import setup
with open("README.md") as f:
readme = f.read()
setup(
name="dpr",
version="... | StarcoderdataPython |
1724005 | import config
from novaclient import client
nt = client.Client(config.VERSION, config.USER, config.PASSWORD, config.TENANT, config.AUTH_URL, insecure=True)
print nt.flavors.list()
print nt.servers.list()
# nt.servers
print nt.keypairs.list()
print nt.images.list()
print nt.quotas.get()
| StarcoderdataPython |
3298577 | import pyqtgraph as pg
import os
import numpy as np
path = os.path.dirname(os.path.abspath(__file__))
uiFile = os.path.join(path, '../ui/ecg_summary.ui')
ECGSummaryView, TemplateBaseClass = pg.Qt.loadUiType(uiFile)
class ECGSummaryWidget(TemplateBaseClass):
def __init__(self, ecg, raw):
TemplateBaseClas... | StarcoderdataPython |
1646571 | from tracker import RetinaTracker
from pyretina.optimize import GD
from pyretina.retina import ReferencePlaneRetinaModel
class GDTracker(RetinaTracker):
def __init__(self, seeder_model, n_seeds, n_steps,
alpha_regime, sigma_regime,
threshold=2.9, reference_z = 100.0):
retina_model ... | StarcoderdataPython |
96445 | import requests
import checking_functions
#res = requests.get("http://localhost:8080/v1.0/Datastreams?$filter=name eq 'test-6'")
#obj = res.json()
#print(obj["value"])
res = checking_functions.get_item_by_name("http://localhost:8080/v1.0/Datastreams?$filter=name eq 'test-6'")
print(res) | StarcoderdataPython |
1712280 |
# This file is generated by setup.py. DO NOT EDIT.
import _ndarray
import os
include_dir = 'c:\\python25\\Include\\numarray'
version = '1.5.2'
hasUInt64 = _ndarray.hasUInt64()
LP64 = _ndarray.lp64()
if not len(include_dir): # default to same directory as numarray .py's
import numinclu... | StarcoderdataPython |
3378079 | <reponame>AllenMusk/Rotating-frame<filename>utils/polyiou.py<gh_stars>10-100
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.1
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_py... | StarcoderdataPython |
3210224 | <reponame>aframires/freesound-loop-annotator
import fnmatch
import json
import csv
import os
def get_filenames_in_dir(dir_name, keyword='*', skip_foldername='', match_case=True, verbose=True):
names = []
folders = []
fullnames = []
if verbose:
print(dir_name)
# check if the folder exis... | StarcoderdataPython |
1696937 | <reponame>miraedbswo/DMS-Backend-V3-Student<gh_stars>1-10
import re
import ssl
import os
import pymysql
from datetime import datetime, timedelta
from urllib.request import urlopen
from bs4 import BeautifulSoup
_url_base = \
'https://stu.dje.go.kr/sts_sci_md00_001.do?schulCode=G100000170&schulCrseScCode=4&schulKnd... | StarcoderdataPython |
4373 | """Realty Info"""
import os
import requests
from dotenv import load_dotenv
from fastapi import APIRouter, Depends
import sqlalchemy
from pydantic import BaseModel, SecretStr
from app import config
from app.walk_score import *
load_dotenv()
router = APIRouter()
headers = {'x-rapidapi-key': os.getenv('api_key'),
... | StarcoderdataPython |
1624951 | #!/usr/bin/env python3
# coding=utf-8
"""
A script to delete songs from your Google Music library using https://github.com/simon-weber/gmusicapi.
More information at https://github.com/thebigmunch/gmusicapi-scripts.
Usage:
gmdelete (-h | --help)
gmdelete [options] [-f FILTER]... [-F FILTER]...
Options:
-h, --h... | StarcoderdataPython |
1642512 | <gh_stars>0
"""
@file: embeddings.py
@time: 2020-12-02 16:41:16
"""
import logging
import os
import numpy as np
import tensorflow as tf
from tqdm import tqdm
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
# 感谢https://fas... | StarcoderdataPython |
1668473 | <filename>tests/munki/test_munki_install_probe_views.py
from functools import reduce
import operator
from django.contrib.auth.models import Group, Permission
from django.db.models import Q
from django.urls import reverse
from django.utils.crypto import get_random_string
from django.test import TestCase, override_settin... | StarcoderdataPython |
1709999 | """ Pretrain the PointNet SemSeg Branch
"""
import argparse
import tensorflow as tf
import numpy as np
import os
import sys
import importlib
import random
import h5py
import json
from datetime import datetime
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
print BASE_DIR
sys.path.append(BASE_DIR)
sys.path.appen... | StarcoderdataPython |
4829384 | <filename>avatars/di.py
import config
import logging
__all__ = ['inject']
_factories = {logging.Logger.__name__:
lambda t: logging.getLogger(t.__name__)}
_singeltons = {config.AppConfig.__name__:
config.current}
def inject(ctor):
"""Dependency injection decorator for __init__ meth... | StarcoderdataPython |
1776929 | <gh_stars>10-100
import numpy as np
import pickle
import random
def normalize_3d(pose):
# pose: [bsize, 17, 3]
xs = pose[:,:,0:1]
ys = pose[:,:,1:2]
ls = np.sqrt(xs[:,1:]**2 + ys[:,1:]**2)
scale = np.mean(ls, axis=1, keepdims=True)
pose = pose/scale
pose = pose - pose[:,0:1,:]
return pose
def RotationMatrix... | StarcoderdataPython |
3393855 | <gh_stars>1-10
import math
import torch.nn.functional as F
from torch import nn
from torch.nn import init
class LeNet5(nn.Module):
def __init__(self):
super(LeNet5, self).__init__()
self.conv1 = nn.Conv2d(1, 20, 5, 1)
self.conv2 = nn.Conv2d(20, 50, 5, 1)
self.fc1 = nn.Linear(4*4*50, 500)
self.fc2 = nn.Lin... | StarcoderdataPython |
86852 | <filename>src/observation_wrappers.py
import gym
import numpy as np
class CorridorObservationWrapper(gym.ObservationWrapper):
def observation(self, obs):
return obs,
class FSWObservationWrapper(gym.ObservationWrapper):
def observation(self, observation):
return observation,
class WoodsBina... | StarcoderdataPython |
36737 | <gh_stars>0
from numpy.core.defchararray import array
from tensorflow.keras.models import Model
from tensorflow.keras.models import load_model
from tensorflow.keras.datasets import mnist
from PIL import Image
from tqdm import tqdm
import matplotlib.pyplot as plt
import statistics
import numpy as np
import pickle
import... | StarcoderdataPython |
3214899 | <reponame>bekzodbuyukov/Python
import sys
class SmartString:
""" Own Data Type Class for working with Strings """
def __init__(self, file_name: str, chosen_word: str) -> None:
self.file_name = file_name
self.chosen_word = chosen_word
self.file_content = []
self.special_sentence... | StarcoderdataPython |
1738272 | #!/usr/bin/env python
# vim:ts=4:sts=4:sw=4:et
#
# Author: <NAME>
# Date: 2018-05-04 18:34:23 +0100 (Fri, 04 May 2018)
#
# https://github.com/harisekhon/nagios-plugins
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally se... | StarcoderdataPython |
123933 | <reponame>LeeLin2602/backend
#-*- encoding: UTF-8 -*-
from .auth import *
from .domains import *
from .ddns import * | StarcoderdataPython |
1659299 | <reponame>unfoldingWord-box3/lexicon-poc
# Generated by Django 3.1.3 on 2021-05-26 07:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('annotation', '0005_auto_20210525_1009'),
]
operations = [
migratio... | StarcoderdataPython |
3381526 | """Switcher water heater unofficial API and bridge, Network protocols.
.. codeauthor:: <NAME> <<EMAIL>>
"""
# fmt: off
from asyncio import (
AbstractEventLoop, BaseTransport, DatagramProtocol, Event, Future, Queue,
QueueEmpty, QueueFull, Transport, ensure_future)
from datetime import datetime
from... | StarcoderdataPython |
3277135 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, <NAME>
#
# This code is subject to the (new) BSD license:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the abov... | StarcoderdataPython |
122836 | #!/usr/bin/env python
import sys
import PySimpleGUI as sg
# Recipe for getting keys, one at a time as they are released
# If want to use the space bar, then be sure and disable the "default focus"
layout = [[sg.Text("Press a key or scroll mouse")],
[sg.Text("", size=(18, 1), key='text')],
[sg.Butt... | StarcoderdataPython |
4800158 | words = []
def get_word(index):
return words[index]
| StarcoderdataPython |
41528 | # -*- coding: utf-8 -*-
"""
@File: evaluator.py
@Description: This is an application for evaluating clustering performance
on 20 newsgroup data.
@Author: <NAME>
@EMail: <EMAIL>
@Created_on: 04/05/2017
@python_version: 3.5
==============================================... | StarcoderdataPython |
1644010 | #!/usr/bin/env python3
import sys
with open(sys.argv[1]) as input:
lines = input.readlines()
numbers = [int(line.strip()) for line in lines]
# Part 1
print(sum(y > x for x, y in zip(numbers[:-1], numbers[1:])))
# Part 2
print(sum(y > x for x, y in zip(numbers[:-3], numbers[3:])))
| StarcoderdataPython |
3303183 | <filename>10/9/solve.py<gh_stars>0
enc = '3633363A33353B393038383C363236333635313A353336'
enc = [int(enc[i:i + 2], 16) for i in range(0, len(enc), 2)]
dec = '514;248;980;347;145;332'
dec = [ord(c) for c in dec]
key = [e ^ d for e, d in zip(enc, dec)]
enc2 = '3A3A333A333137393D39313C3C3634333431353A37363D'
enc2 = [in... | StarcoderdataPython |
3344841 | <reponame>johncollinsai/post-high-frequency-data
"""Tornado handlers for nbconvert."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import io
import os
import zipfile
from anyio.to_thread import run_sync
from ipython_genutils import text
from ipython_genutils.py3... | StarcoderdataPython |
3309678 | """Procedural-Generated Dungeon RPG
mygame.py
this is a prototype for a procedural-generated dungeon RPG
has bare-minimum graphics
created by rtgher 26/11/2014->
"""
__version__=0.2
__status__="Prototype"
__author__="<EMAIL>"
#License
""" The software itself is a free product. Anyone can download and inst... | StarcoderdataPython |
144845 | # (C) Copyright NuoDB, Inc. 2017-2020
#
# This source code is licensed under the MIT license found in the LICENSE
# file in the root directory of this source tree.
from nuomon_monitor import MetricsListener, EventListener
from nuomon_util import *
from pubsub import pub
import threading
from pynuoca.nuoca_util import... | StarcoderdataPython |
52477 | #pylint: skip-file
"""
NOTE: This is a local copy of the readers module, taken from the
support-tools/timeseries repository.
Provides functions to read FTDC data from either an FTDC file or from
a file containing serverStatus JSON documents, one per line. Each
reader takes a filename argument and returns a generator t... | StarcoderdataPython |
3250330 | #!/usr/bin/env python3
"""
Author : <NAME> <<EMAIL>>
Date : 2021-09-22
Purpose: concatenate a file
"""
import argparse
# pylint: disable=W0105
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='conca... | StarcoderdataPython |
1775595 | <gh_stars>0
import os
def validate_key(key, keyname='Key'):
"""
Check input is valid key (Experiment id, metric name...)
"""
if not isinstance(key, str):
msg = '{} must be str, given: {}{}'
raise ValueError(msg.format(keyname, key, type(key)))
if ':' in key:
msg = '{} canno... | StarcoderdataPython |
1607942 | from unittest import TestCase
from lib.solutions.checkout import checkout
class CheckoutTestCase(TestCase):
# Our price table and offers:
# +------+-------+------------------------+
# | Item | Price | Special offers |
# +------+-------+------------------------+
# | A | 50 | 3A for ... | StarcoderdataPython |
188642 | <reponame>Muson117/SharedAccountLibrary
''' models registered to Django admin interface '''
from django.contrib import admin
# Register your models here.
from .models import Employee, Account
#admin.site.register(Employee)
#admin.site.register(Account)
@admin.register(Employee)
class EmployeeAdmin(admin.ModelAdmin):... | StarcoderdataPython |
3296095 | <filename>act/queryinconsistency.py
import hashlib
from sre_parse import Pattern
from tokenize import String
import paramiko
import re
from utils.inout import *
import sys
from settings import BENCHMARK_GROUNDTRUTH_PATH, DATA_DIR, SARIF_DIR
sys.path.append(join_path(sys.path[0], BENCHMARK_GROUNDTRUTH_PATH))
print sys.... | StarcoderdataPython |
78553 | <reponame>lyskevin/cpbook-code
import math
def isOn(S, j):
return (S & (1<<j))
def setBit(S, j):
return (S | (1<<j))
def clearBit(S, j):
return (S & (~(1<<j)))
def toggleBit(S, j):
return (S ^ (1<<j))
def lowBit(S):
return (S&(-S))
def setAll(n):
return ((1<<n)-1)
def modulo(S, N): # retu... | StarcoderdataPython |
1641220 | from flask import Flask, render_template, Response
from markupsafe import escape
import cv2
import glob
import asyncio
loop = asyncio.get_event_loop()
camera_index = glob.glob("/dev/video?")
# "rtsp://root:pass@192.168.0.91:554/axis-media/media.amp")
# CAM_PATH = "rtsp://admin:123456@10.0.10.123:554/ISAPI/Streamin... | StarcoderdataPython |
1607326 | <filename>software/firmware/sched/sched.py
# sched.py
# Copyright (c) 2020 <NAME>
# Released under the MIT License (MIT) - see LICENSE file
import uasyncio as asyncio
from sched.primitives import launch
from time import time
from sched.cron import cron
async def schedule(func, *args, times=None, **kwargs):
fcron... | StarcoderdataPython |
1737454 | import dash_mantine_components as dmc
# fmt: off
swatches = [
"#25262b", "#868e96", "#fa5252", "#e64980", "#be4bdb", "#7950f2", "#4c6ef5",
"#228be6", "#15aabf", "#12b886", "#40c057", "#82c91e", "#fab005", "#fd7e14"
]
# fmt: on
component = dmc.ColorPicker(swatches=swatches, swatchesPerRow=7, withPicker=False)
| StarcoderdataPython |
3223595 | <reponame>optimum-web/oneandone-cloudserver-sdk-python
import os
import re
import json
import unittest
import responses
from oneandone.client import OneAndOneService
from oneandone.client import SharedStorage, AttachServer
class TestSharedStorage(unittest.TestCase):
def setUp(self):
self.client = OneAndOneService... | StarcoderdataPython |
3236870 | #!/usr/bin/env python3
from setuptools import setup
from distutils.util import convert_path
import codecs
# Load version information
main_ns = {}
ver_path = convert_path('devprod/version.py')
with codecs.open(ver_path, 'rb', 'utf8') as ver_file:
exec(ver_file.read(), main_ns)
# Load README.md
readme_path = conver... | StarcoderdataPython |
3250494 | import argparse
import ast
import sys
from typing import Tuple
import pandas as pd
from bs4 import BeautifulSoup
from analysis.src.python.data_analysis.model.column_name import Complexity, Difficulty, StepColumns, TopicColumns
from analysis.src.python.data_analysis.utils.df_utils import merge_dfs, read_df, write_df
... | StarcoderdataPython |
3343397 | <gh_stars>1-10
"""
Created on Sun Oct 10 14:57:50 2010
Author: josef-pktd, <NAME>
License: BSD
TODO: check everywhere initialization of signal.lfilter
"""
import numpy as np
from scipy import signal, optimize
from statsmodels.base.model import GenericLikelihoodModel
#copied from sandbox/regression/mle.py
#rename ... | StarcoderdataPython |
119855 | <reponame>minhtuan221/architecture-collection<gh_stars>1-10
import logging
import os
import pathlib
import sys
from logging.handlers import TimedRotatingFileHandler
# ----------------------------------------------------------------------
def set_gunicorn_custom_logger(path='./logs', is_absolute_path=False,
... | StarcoderdataPython |
108776 | <gh_stars>1-10
step(
"""
create unique index unq_image_tag_image_id_tag_id
on image_tag (image_id, tag_id)
""",
"""
drop index unq_image_tag_image_id_tag_id
"""
)
| StarcoderdataPython |
173120 | <reponame>drix00/pysemeels
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: pysemeels.egerton2011.sigdis
.. moduleauthor:: <NAME> <<EMAIL>>
Calculates cross sections for bulk atomic displacement or surface sputtering for both SPHERICAL and
PLANAR escape potentials.
sigdis.m calculates cross s... | StarcoderdataPython |
3275706 | <gh_stars>1-10
from __future__ import unicode_literals
from django.apps import AppConfig
class EngineAppConfig(AppConfig):
name = 'apps.engine_app'
| StarcoderdataPython |
14067 | <reponame>Noschvie/roundup<filename>roundup/backends/blobfiles.py
#
# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
# This module is free software, and you may redistribute it and/or modify
# under the same terms as Python, so long as this copyright message and
# disclaimer are retained i... | StarcoderdataPython |
50398 | <reponame>vuanvin/pytorch<gh_stars>1-10
load("@rules_cuda//cuda:defs.bzl", "cuda_library")
NVCC_COPTS = ["--expt-relaxed-constexpr", "--expt-extended-lambda"]
def cu_library(name, srcs, copts = [], **kwargs):
cuda_library(name, srcs = srcs, copts = NVCC_COPTS + copts, **kwargs)
| StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.