id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
3246889 | input = """
a(1) v a(2).
b(1) v b(2).
okay :- not #count{X:a(X),b(X)}>1, #count{V:a(V),b(V)}>0.
"""
output = """
{a(1), b(1), okay}
{a(1), b(2)}
{a(2), b(1)}
{a(2), b(2), okay}
"""
| StarcoderdataPython |
4806428 | # -*- coding: utf-8 -*-
"""
Created on Thu May 4 15:17:30 2017
@author: nberliner
"""
import numpy as np
import pandas as pd
from features.seaIce import get_seaIce
from features.krillbase import KrillBase
from features.temperature import Temperature
from utils.NestDistance import NestDistance
from utils.utils impor... | StarcoderdataPython |
1770831 | <filename>PiGPIO/views/views.py
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from PiGPIO.models import Program, Dashboard
from PiGPIO.helper import raspi
@login_required
def index(request):
buttons = Dashboard.objects.filter(active=True).all()
return render(r... | StarcoderdataPython |
43312 | #!/usr/bin/env python
#encoding=utf-8
# Copyright (c) 2012 Baidu, Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#... | StarcoderdataPython |
3239263 | from setuptools import setup
setup(
name='tudir',
version='0.0.1',
packages=['networks', 'networks.task_heads', 'networks.transformers', 'dataset'],
) | StarcoderdataPython |
3327220 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.pkg.builtin.libflame import LibflameBase
class Amdlibflame(LibflameBase):
"""libFLAME is a portable librar... | StarcoderdataPython |
135404 | <filename>python/send-to-eventhub.py
import json
import logging
import os
import random
import time
import string
from dotenv import load_dotenv
from azure.eventhub import EventHubProducerClient, EventData
def random_text(n=3):
return ''.join([string.ascii_lowercase[random.randint(0, 25)] for i in range(n)])
if... | StarcoderdataPython |
3291648 | import pymongo
from flask import Flask, render_template, request, jsonify, make_response
from utils.converters import RegexConverter
app = Flask(__name__)
app.secret_key = 'movidesk'
app.url_map.converters['regex'] = RegexConverter
from views import *
# testing some things
# testing again
# teste
if __name__ == '__... | StarcoderdataPython |
3355970 | <gh_stars>10-100
from locale import windows_locale
from PyQt5.QtWidgets import QLineEdit, QDialog, QTabWidget, QLabel, QPushButton
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt
from PyQt5 import uic
import numpy as np
from data.user_input.project.printMessageInput import PrintMessageInput
window_title = "... | StarcoderdataPython |
3365825 | from django import forms
from django.contrib.auth.models import User
from Easynote.models import Notes
from Easynote.lib import const
class AuthenticationForm(forms.Form):
"""
AuthenticationForm class. Inherit from Form class.
:fields username: User username. Must be a str.
:fields password: User password. Mus... | StarcoderdataPython |
3385262 | <gh_stars>0
from pyvisdk.base.managed_object_types import ManagedObjectTypes
from pyvisdk.base.base_entity import BaseEntity
import logging
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
class HostPatchMan... | StarcoderdataPython |
1659004 | #!/usr/bin/env python3
# testcases.py
import json
import math
import os.path
import sys
import traceback
from argparse import ArgumentParser
from typing import NamedTuple, List, Dict, Any, Optional
import logging
import hwsuite
_log = logging.getLogger(__name__)
_DEFAULT_CASE_ID_PRECISION = 2
_DEFAULT_DEFINITIONS_FI... | StarcoderdataPython |
3247371 | from django.shortcuts import get_object_or_404, render
# Create your views here.
from .models import BlogAuthor, Blog, BlogComment
def index(request):
"""View function for home page of site."""
return render(request, 'index.html',)
from django.views import generic
class BlogListView(generic.ListView):
... | StarcoderdataPython |
69887 | class A(object):
__sizeof__ = 17
print(__sizeof__)
# <ref> | StarcoderdataPython |
1778078 | import matplotlib.pyplot as plt
import base64
from io import BytesIO
import numpy as np
def get_graph():
buffer=BytesIO()
plt.savefig(buffer,format='png')
buffer.seek(0)
image_png=buffer.getvalue()
graph=base64.b64encode(image_png)
graph=graph.decode('utf-8')
buffer.close()
return graph... | StarcoderdataPython |
3398658 | <reponame>excalibur1987/team-management
from functools import wraps
from typing import Callable, List, Union
from flask_restx import Model, OrderedModel, fields
from flask_restx.namespace import Namespace
from app.database import BaseModel
from .parsers import offset_parser
class ExtendedNameSpace(Namespace):
... | StarcoderdataPython |
1793949 | <gh_stars>0
"""All datastore models live in this module"""
import datetime
from google.appengine.ext import ndb
class Torrent(ndb.Model):
"""A main model for representing an individual Torrent entry."""
title = ndb.StringProperty(indexed=False, required=True)
btih = ndb.StringProperty(indexed=False, requ... | StarcoderdataPython |
4835231 | <gh_stars>0
#!/usr/bin/env python3
from dataclasses import dataclass
from elftools.elf.elffile import ELFFile
from elftools.elf.sections import Section, SymbolTableSection
from typing import List, Tuple, Dict, Generator, Union, Set
from collections import defaultdict
import os, sys
import json
## Configuration:
# sec... | StarcoderdataPython |
4035 | import numpy as np
import scipy
import scipy.io
import pylab
import numpy
import glob
import pyfits
def mklc(t, nspot=200, incl=(scipy.pi)*5./12., amp=1., tau=30.5, p=10.0):
diffrot = 0.
''' This is a simplified version of the class-based routines in
spot_model.py. It generates a light curves for dark, p... | StarcoderdataPython |
186032 | import os
TORNADO_PORT = 8888
POSTGRES = {
'host': '127.0.0.1',
'port': 5432,
'user': 'admin',
'password': '<PASSWORD>',
'database': 'open_graph_links',
}
PROTOCOL = 'http'
HOST = '127.0.0.1'
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DOWNLOAD_DIR_NAME = 'media'
DOWNLOAD_DIR = os.pat... | StarcoderdataPython |
3395987 | import tkinter as tk
from tkinter import ttk
root = tk.Tk()
mygreen = "#d2ffd2"
myred = "#dd0202"
style = ttk.Style()
style.theme_create( "yummy", parent="alt", settings={
"TNotebook": {"configure": {"tabmargins": [2, 5, 2, 0] } },
"TNotebook.Tab": {
"configure": {"padding": [5, 1], "bac... | StarcoderdataPython |
25172 | import discord
import asyncio
import aiofiles
from discord.ext import commands
intents = discord.Intents.all()
client = commands.Bot(command_prefix=commands.when_mentioned_or('!'),intents=intents)
client.ticket_configs = {}
@client.command()
async def ping(ctx):
embed=discord.Embed(title="Bot Ping",description=... | StarcoderdataPython |
144798 | <filename>ca_fighter.py
#! /usr/bin/python
import copy
import curses
import pprint
import ca_equipment
import ca_timers
class ThingsInFight(object):
'''
Base class to manage timers, equipment, and notes for Fighters and Venues.
'''
def __init__(self,
name, # string, name o... | StarcoderdataPython |
176341 | #!/usr/bin/env python3
import sys
import subprocess
from .kast import *
from .kastManip import *
from .kast import _notif, _warning, _fatal
def ruleHasId(sentence, ruleIds):
if isKRule(sentence):
ruleId = getAttribute(sentence, 'UNIQUE_ID')
return ruleId is not None and ruleId in ruleId... | StarcoderdataPython |
4821101 | import json
import logging
import os
# Get environment variables
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO").upper()
# Configure logging
logger = logging.getLogger()
logger.setLevel(LOG_LEVEL)
def remove_policy(input_path: str, output_path: str):
"""Remove all IAM policies from a CloudFormation json template
... | StarcoderdataPython |
3210967 | #-*- codeing: utf-8 -*-
import sys
"""
tip
ord()
chr()
input
Kingdom
output
ASCII code for 'K' is 75
ASCII code for 'i' is 105
ASCII code for 'n' is 110
ASCII code for 'g' is 103
ASCII code for 'd' is 100
ASCII code for 'o' is 111
ASCII code for 'm' is 109
713
"""
if __name__ == '__main__':
_str = input()
_sum =... | StarcoderdataPython |
3258083 | from scse.controller import miniscot as miniSCOT
from scse.default_run_parameters.national_grid_default_run_parameters import DEFAULT_RUN_PARAMETERS
class miniSCOTnotebook():
def __init__(
self,
simulation_seed=DEFAULT_RUN_PARAMETERS.simulation_seed,
start_date=DEFAULT_RUN_PAR... | StarcoderdataPython |
3303210 | <reponame>ahnitz/pegasus
#!/usr/bin/env python3
from Pegasus.api import *
# --- Workflow -----------------------------------------------------------------
wf = Workflow("sleep-wf")
sleep_1 = Job("sleep").add_args(2)
sleep_2 = Job("sleep").add_args(2)
wf.add_jobs(sleep_1, sleep_2)
wf.add_dependency(job=sleep_1, chil... | StarcoderdataPython |
1653187 | <reponame>mwregan2/MiriTE
#!/usr/bin/env python
#
# Script 'convert_droop'
#
# :History:
#
# 20 Feb 2013: Created
# 26 Feb 2013: Removed "inputtype" input parameter. Added SUBARRAY as a
# header keyword to copy over.
# 25 Jun 2013: Added astropy.io.ascii as an alternative to asciitable.
# 22 Aug 2013: co... | StarcoderdataPython |
4831492 | <reponame>biud436/font-parser
class NameRecord:
def __init__(self):
self.platform_id = 0
self.encoding_id = 0
self.language_id = 0
self.name_id = 0
self.string_length = 0
self.string_offset = 0
self.name = ""
self.hex_offset = "" | StarcoderdataPython |
3391916 | # coding=UTF-8
"""Data previewer functions
Functions and data structures that are needed for the ckan data preview.
"""
import urlparse
import pylons.config as config
import ckan.plugins as p
DEFAULT_DIRECT_EMBED = ['png', 'jpg', 'gif']
DEFAULT_LOADABLE_IFRAME = ['html', 'htm', 'rdf+xml', 'owl+xml', 'xml', 'n3', ... | StarcoderdataPython |
1616376 | <reponame>rajeshr188/dea
from django.db import models
from mptt.models import MPTTModel,TreeForeignKey
import datetime
from django.db.models import Sum
from django.db.models.functions import Coalesce
# Create your models here.
# cr credit,dr debit
class TransactionType_DE(models.Model):
XactTypeCode = models.CharFi... | StarcoderdataPython |
166159 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AnttechBlockchainDefinSaasPaymentCancelResponse(AlipayResponse):
def __init__(self):
super(AnttechBlockchainDefinSaasPaymentCancelResponse, self).__init__()
self._ava... | StarcoderdataPython |
1712018 |
import bpy
import yerface_blender.SceneUtilities
import yerface_blender.WebsocketReader
isPreviewRunning = False
myPreviewTimer = None
myReader = None
myUpdater = None
class YerFacePreviewStartOperator(bpy.types.Operator):
bl_idname = "wm.yerface_preview_start"
bl_label = "YerFace Preview Start"
bl_desc... | StarcoderdataPython |
185553 | """
# Custom colormap
This example shows how to create and use a custom colormap.
"""
import numpy as np
import numpy.random as nr
from datoviz import app, canvas, run, colormap
# Create the canvas, panel, and visual.
c = canvas(show_fps=True)
ctx = c.gpu().context()
panel = c.scene().panel(controller='panzoom')
v... | StarcoderdataPython |
1669485 | <filename>tests/unit/compute/test_ebs_nuke.py
# -*- coding: utf-8 -*-
"""Tests for the ebs nuke class."""
import boto3
import time
from moto import mock_ec2
from package.nuke.compute.ebs import NukeEbs
from .utils import create_ebs
import pytest
@pytest.mark.parametrize(
"aws_region, older_than_seconds, resu... | StarcoderdataPython |
84432 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(name='arpy',
version='0.1.1',
description='Library for accessing "ar" files',
author=u'<NAME>',
author_email='<EMAIL>',
url='http://bitbucket.org/viraptor/arpy',
py_modules=['arpy'],
license="Simplified BSD",
)
| StarcoderdataPython |
3305958 | <filename>meta_mb/workers/metrpo/worker_data.py
import time, pickle
from meta_mb.logger import logger
from meta_mb.workers.base import Worker
class WorkerData(Worker):
def __init__(self, simulation_sleep):
super().__init__()
self.simulation_sleep = simulation_sleep
self.env = None
... | StarcoderdataPython |
4826912 | <reponame>vijayRT/inkbot
#tweepy1.py - To test trend obtaining
import sys
sys.path.append('/home/vijay/.local/lib/python2.7/site-packages')
import tweepy
import woeid
import yweather
import time
import os
import sys
reload(sys)
#Configure Tweepy API
t0 = time.time()
consumer_key = 'Osyy0PSrhMRpnIWxjBLzLJeKR'
con... | StarcoderdataPython |
3269500 | <reponame>Douwe-Spaanderman/ChessVideoAI<gh_stars>0
import setuptools
def readme():
with open("README.md", "r", encoding="utf-8") as fh:
return fh.read()
setuptools.setup(
name="ChessVideoAI",
version="0.0.1",
author="<NAME>",
author_email="<EMAIL>",
description="Deep learning project ... | StarcoderdataPython |
1612138 | <reponame>profesormig/quimica3a
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import core.models.quota
class Migration(migrations.Migration):
dependencies = [
('core', '0051_non_null_key_instance_action'),
]
operations = [
migra... | StarcoderdataPython |
1628583 | #!/usr/bin/env python3
"""Tests for cve_scan."""
from collections import defaultdict
import datetime as dt
import unittest
import cve_scan
class CveScanTest(unittest.TestCase):
def test_parse_cve_json(self):
cve_json = {
'CVE_Items': [
{
'cve': {
'CVE_d... | StarcoderdataPython |
1679226 | """
This module provide the defence method for THERMOMETER ENCODING's implement.
THERMOMETER ENCODING: ONE HOT WAY TO RESIST ADVERSARIAL EXAMPLES
"""
from builtins import range
import logging
logger=logging.getLogger(__name__)
import numpy as np
from keras.utils import to_categorical
__all__ = [
'ThermometerEn... | StarcoderdataPython |
1742272 | # Lint as: python3
# Copyright 2020 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 ... | StarcoderdataPython |
3282479 | <reponame>samyuyagati/Pequin<gh_stars>0
'''
Copyright 2021 <NAME> <<EMAIL>>
<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 deal in the Software without
restriction, including wit... | StarcoderdataPython |
161013 | import os
base_dir = '/rds/general/user/bheineik/home/'
genomeDir= base_dir + 'genomes/pombe_20201008_star'
fastqbase = base_dir + 'rna_seq_data/20210315_pombe_ox_bulk/Unaligned/'
outfilebase = base_dir + 'rna_seq_data/20210315_pombe_ox_bulk/mapped/'
readFilesCommand= 'zcat' #Use to decompress fastq.gz files
... | StarcoderdataPython |
11465 | from app import db, login
from flask_login import UserMixin
from datetime import datetime
from flask import url_for, redirect
from werkzeug.security import generate_password_hash, check_password_hash
class users(UserMixin, db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True, autoinc... | StarcoderdataPython |
1612660 | frase = str(input('Digite uma Frase: ')).strip() # Retira os espaços no início e fim
print('A Letra A aperece {} vezes'.format(frase.upper().count('A')))
print('A posição que ela aparece 1° vez é {}'.format(frase.upper().find('A')+1)) # +1 é para que não conte a posição ZERO
print('A posição que ela aparece por último ... | StarcoderdataPython |
3220446 | <reponame>sjamgade/python-socks<gh_stars>0
import curio.io
import curio.socket
from ... import _abc as abc
from ..._errors import ProxyError
DEFAULT_RECEIVE_SIZE = 65536
class CurioSocketStream(abc.AsyncSocketStream):
_socket: curio.io.Socket = None
def __init__(self, sock: curio.io.Socket):
self._... | StarcoderdataPython |
1798075 | from django.contrib import sitemaps
from django.core.urlresolvers import reverse
class SupportPageSitemap(sitemaps.Sitemap):
priority = 0.5
changefreq = 'daily'
def items(self):
return ['console', 'lp-designers', 'lp-creatives', 'lp-founders',
'lp-startupweekend', 'lp-learning-to-code', ... | StarcoderdataPython |
3399623 | <filename>python_script/extract_vertex_group.py
import bpy
import sys
import os
def find_max_group(weights):
max_weight = 0
max_index = 0
for i in range(len(weights)):
item = weights[i]
if item > max_weight:
max_weight = item
max_index = i
return max_index
def e... | StarcoderdataPython |
3309354 | <reponame>WaveBlocks/WaveBlocks
"""The WaveBlocks Project
@author: <NAME>
@copyright: Copyright (C) 2010, 2011 <NAME>
@license: Modified BSD License
"""
from legend import legend
from color_map import color_map
from plotcf import plotcf
from stemcf import stemcf
from plotcm import plotcm
#try:
# from surfcf impor... | StarcoderdataPython |
3335443 | <reponame>philipp01wagner/gym-pybullet-drones<filename>examples/test_straight_flight.py
import time
import gym
import numpy as np
import argparse
from stable_baselines3 import A2C, PPO, DDPG, SAC, TD3
from stable_baselines3.common.env_checker import check_env
import pybullet as p
from gym_pybullet_drones.envs.single_ag... | StarcoderdataPython |
110965 | <reponame>anna-ka/segmentation.evaluation<filename>src/python/main/segeval/window/Pk.py
'''
Implementation of the Pk segmentation evaluation metric described in
[BeefermanBerger1999]_
@author: <NAME>
@contact: <EMAIL>
'''
#===============================================================================
# Copyright (c)... | StarcoderdataPython |
131050 | <reponame>ninarina12/e3nn<gh_stars>100-1000
from typing import Tuple
import torch
def direct_sum(*matrices):
r"""Direct sum of matrices, put them in the diagonal
"""
front_indices = matrices[0].shape[:-2]
m = sum(x.size(-2) for x in matrices)
n = sum(x.size(-1) for x in matrices)
total_shape ... | StarcoderdataPython |
3350423 | #!/usr/bin/env python
from setuptools import setup
from pip.req import parse_requirements
def local_requirements():
install_reqs = parse_requirements('./requirements.txt')
return [str(ir.req) for ir in install_reqs]
setup(name='steamapi',
version='0.1',
description='An object-oriented Python 2.7+... | StarcoderdataPython |
1722489 | <reponame>BerlinRDT/roaddetection<filename>src/data/download_raw.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from google.cloud import storage
from google.cloud.exceptions import NotFound
import os.path
local_images_dir = 'data/raw/images/'
def download(blob):
source_blob_name = blob.name
file_name = source_blob... | StarcoderdataPython |
1685917 | import sys
import glob
import unittest
def create_test_suite():
test_file_strings = glob.glob('tests/test_*.py')
module_strings = ['tests.'+str[6:len(str)-3] for str in test_file_strings]
suites = [unittest.defaultTestLoader.loadTestsFromName(name) \
for name in module_strings]
testSuite = unittest.TestSuite(su... | StarcoderdataPython |
3337947 | <reponame>software-mansion/protostar
from collections import OrderedDict
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Dict, List, Optional, cast
import flatdict
import tomli
import tomli_w
from protostar.commands.test.expected_event import collect_immediate_subdirectories
... | StarcoderdataPython |
181781 | import pickle
import torch
import trimesh
from .util import set_module, create_quads
@set_module('deep_surfel')
def export_mesh(file, deep_surfel_scene, only_filled=False, features_as_colors=False, surfel_transformation=None):
inside_inds = ~torch.isinf(deep_surfel_scene.locations).any(-1)
if only_filled:
... | StarcoderdataPython |
1793097 | <reponame>WilliamMayor/scytale.xyz<gh_stars>1-10
from scytale.ciphers.base import Cipher
from scytale.exceptions import ScytaleError
class RailFence(Cipher):
name = "RailFence"
default = 5
def __init__(self, key=None):
self.key = self.validate(key)
def validate(self, key):
if key is ... | StarcoderdataPython |
4826267 | import requests
import json
import csv
import time
from html.parser import HTMLParser
timeout = 10
class ThesisHTMLParser(HTMLParser):
def __init__(self, url, query = None) :
super().__init__()
self.fields = {}
self.fields['url'] = url
self.fields['query'] = query
... | StarcoderdataPython |
1687976 | <gh_stars>0
#!/usr/bin/env python3
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.o... | StarcoderdataPython |
3463 | <gh_stars>0
# Copyright (c) 2018-2021 <NAME>
# License: MIT License
# source: http://www.lee-mac.com/bulgeconversion.html
# source: http://www.afralisp.net/archive/lisp/Bulges1.htm
from typing import Any, TYPE_CHECKING, Tuple
import math
from ezdxf.math import Vec2
if TYPE_CHECKING:
from ezdxf.eztypes import Verte... | StarcoderdataPython |
1711289 | <gh_stars>0
from __future__ import print_function
from __future__ import absolute_import
from .ControlCommon import *
import sys
import re
import fnmatch
from itertools import chain
try:
from .CommunityRTE import CommunityRTEControl
except ImportError:
CommunityRTEControl = None
def complete_rte_name(prefix... | StarcoderdataPython |
3322351 | <reponame>dslab-epfl/svshi<filename>src/generator/tests/parser_test.py
from ..parsing.device import Device
from ..parsing.parser import Parser, ParserException
import pytest
DEVICES_FOLDER_PATH = "tests/devices"
def test_parser_devices_equal():
device1 = Device("binary_sensor_instance_name", "BinarySensor", "bi... | StarcoderdataPython |
3364669 | import Linkelist
class Stack:
def __init__(self) -> None:
self.data = Linkelist.Linkedlist()
def push(self,data):
newNode = Linkelist.Node(data)
self.data.insert(newNode)
def pop(self):
self.data.delete()
def printStack(self):
self.data.printNodein... | StarcoderdataPython |
1687223 | # -*- coding: utf-8 -*-
########
# Copyright (c) 2015 Fastconnect - Atost. 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/LICENS... | StarcoderdataPython |
57987 | from .behavior_action_server import BehaviorActionServer
__all__ = [
'BehaviorActionServer'
]
| StarcoderdataPython |
3273297 | import argparse
from ipaddress import ip_address
from itertools import chain
import logging
from multiprocessing import Process, Queue
import os
import statistics
from time import perf_counter
from typing import Tuple, List, Optional
from twisted.internet import defer
from twisted.python.failure import Failure
from d... | StarcoderdataPython |
1683221 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Experimentation script.
Analysis based on letter frequencies and letter frequencies resolved by
position. Main purpose is to generate optimal starter words for humans
to use to catch as many letters as possible.
This script evolved from a few lines of tria... | StarcoderdataPython |
165835 | <filename>python/common/rsi_email.py
import python.common.helper as helper
from python.common.config import Config
import python.common.common_email_services as common_email_services
from datetime import datetime
import json
import logging
from jinja2 import Environment, select_autoescape, FileSystemLoader
logging.bas... | StarcoderdataPython |
21483 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import base64
import os
import zlib
from .environment import get_environment
from . import util
def iter_results_paths... | StarcoderdataPython |
54808 | from sklearn.base import BaseEstimator, TransformerMixin
from autogluon.features.generators import OneHotEncoderFeatureGenerator
class OheFeaturesGenerator(BaseEstimator, TransformerMixin):
def __init__(self):
self._feature_names = []
self._encoder = None
def fit(self, X, y=None):
se... | StarcoderdataPython |
1732877 | <filename>geoevents/feedback/forms.py
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
from django import forms
from geoevents.core.forms import StyledModelForm
f... | StarcoderdataPython |
8188 | <reponame>pageuppeople-opensource/relational-data-loader
import logging
from rdl.data_sources.MsSqlDataSource import MsSqlDataSource
from rdl.data_sources.AWSLambdaDataSource import AWSLambdaDataSource
class DataSourceFactory(object):
def __init__(self, logger=None):
self.logger = logger or logging.getLog... | StarcoderdataPython |
3301943 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The calibration test suite.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA
import os
import unittest
import numpy as np
from obspy import read
from obspy.signal.ca... | StarcoderdataPython |
106497 | <filename>pyspedas/mms/tests/validation/scm.py
from pyspedas import mms_load_scm
from pytplot import get_data
mms_load_scm()
t, d = get_data('mms1_scm_acb_gse_scsrvy_srvy_l2')
print(t[0:10].round(6).tolist())
print(d[10000].tolist())
print(d[50000].tolist())
print(d[100000].tolist())
print(d[200000].tolist())
p... | StarcoderdataPython |
1762941 | <gh_stars>1-10
"""
Setup development environment
"""
import time
import network
import machine
import gc
try:
import appconfig
except:
class AppConfig(object):
def __init__(self, ssid:str, password:str) -> None:
self.wifi_ssid = ssid
self.wifi_password = password
ssid = inp... | StarcoderdataPython |
3310455 | # * The MIT License (MIT) Copyright (c) 2017 by <NAME>.
# * The formulation and display of an AUdio Spectrum using an ESp8266 or ESP32 and SSD1306 or SH1106 OLED Display using a Fast Fourier Transform
# * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docu... | StarcoderdataPython |
1634138 | <filename>setup.py
from setuptools import setup
setup(name='fnplus',
version='0.4.1',
description='Yet another functional programming library',
url='http://github.com/mdowds/fnplus',
author='<NAME>',
license='MIT',
packages=['fnplus'],
test_suite='fnplus.tests',
zip_safe=False)
| StarcoderdataPython |
127138 | """
Sample some tests
"""
from python_template import fizzbuzz
def test_fizzbuzz():
"""
test for fizzbuzz func
"""
assert fizzbuzz(11) == "11"
assert fizzbuzz(12) == "fizz"
assert fizzbuzz(15) == "fizzbuzz"
assert fizzbuzz(20) == "buzz"
| StarcoderdataPython |
94217 | <reponame>christopinka/django-civil
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from civil.library.admin import BaseAdmin
from .models import *
#==============================================================================
class NameOnlyAdmin(Bas... | StarcoderdataPython |
194140 | <reponame>GilianPonte/Deep-Learning
#Code taken from https://www.tensorflow.org/tutorials/images/classification
from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Fl... | StarcoderdataPython |
70813 | <gh_stars>10-100
from unittest import TestCase
from brnolm.runtime.model_statistics import scaled_int_str
class ScaledIntRepreTests(TestCase):
def test_order_0(self):
self.assertEqual(scaled_int_str(0), '0')
def test_order_1(self):
self.assertEqual(scaled_int_str(10), '10')
def test_ord... | StarcoderdataPython |
3272400 | ETH_GATEWAY_STATS_INTERVAL = 60
ETH_GATEWAY_STATS_LOOKBACK = 1
ETH_ON_BLOCK_FEED_STATS_INTERVAL_S = 5 * 60
ETH_ON_BLOCK_FEED_STATS_LOOKBACK = 1
| StarcoderdataPython |
124545 | # Generated by Django 3.2.7 on 2021-09-10 17:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('project', '0005_auto_20210910_1320'),
]
operations = [
migrations.RemoveField(
model_name='project',
name='principle_address... | StarcoderdataPython |
41345 | <filename>multi_agent_rmp.py
# RMPflow basic classes
# @author <NAME>
# @date April 8, 2019
from rmp import RMPRoot, RMPNode
from rmp_leaf import CollisionAvoidance, CollisionAvoidanceDecentralized, GoalAttractorUni
import numpy as np
from numpy.linalg import norm
from scipy.integrate import solve_ivp
import matplot... | StarcoderdataPython |
3285864 | <filename>common/bulk_import.py<gh_stars>0
import datetime
import re
from django.contrib.auth.models import User
from common.models import Class, Semester, Subject
from io import StringIO
from lxml.html import parse
class ImportException(Exception):
pass
class BulkImport:
def is_allowed(self, clazz, no_lectur... | StarcoderdataPython |
35311 | <filename>regulation/settings.py
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
import importlib
import os
import sys
# Try to load the settings module
try:
local_settings = importlib.import_module(
os.environ.get('REGML_SETTINGS_FILE', 'settings'))... | StarcoderdataPython |
3220034 | """ Example or something
"""
import pandas as pd
from alpha_vantage.timeseries import TimeSeries
import config_terminal as cfg
import res_menu as rm
from discovery import disc_menu as dm
from due_diligence import dd_menu as ddm
from fundamental_analysis import fa_menu as fam
from helper_funcs import *
from prediction... | StarcoderdataPython |
98208 | """
bluew.daemon
~~~~~~~~~~~~~~~~~
This module provides a Daemon object that tries its best to keep connections
alive, and has the ability to reproduce certain steps when a reconnection is
needed.
:copyright: (c) 2017 by <NAME>.
:license: MIT, see LICENSE for more details.
"""
def daemonize(func):
"""
A fu... | StarcoderdataPython |
1696560 | from multiprocessing.pool import ThreadPool
import urllib
import urllib.request
import re
import os
import time
import sys
import glob
from bs4 import BeautifulSoup
from pyunpack import Archive
from threading import Lock
class Downloader:
def __init__(self, processes):
directory = ""
self.process... | StarcoderdataPython |
3376874 | from django.conf.urls import url
from apps.event.views import EventListCreateView, EventTypeListView, EventDetailView, EventAcceptView, EventDeclineView
urlpatterns = [
url(r'^types/?$', EventTypeListView.as_view(), name='event_types'),
url(r'^$', EventListCreateView.as_view(), name='events'),
url(r'^perso... | StarcoderdataPython |
1679975 | <filename>jumodjango/etc/gfk_manager.py
from django.db.models import Manager
from django.db.models.query import QuerySet
from django.contrib.contenttypes.generic import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
# Adapt... | StarcoderdataPython |
3287550 | <filename>ib2/settings.py<gh_stars>1-10
"""
Django settings for ib2 project.
Generated by 'django-admin startproject' using Django 2.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en... | StarcoderdataPython |
49146 | <gh_stars>1-10
"""
Callbacks parser
"""
from __future__ import unicode_literals
from . import webhook_attachments
from .types import webhook_types
def parse_payload(payload):
# pylint: disable=too-many-return-statements
if 'message' in payload:
return MessageReceived(payload)
elif 'delivery' in p... | StarcoderdataPython |
1647260 | import unittest
from drgpy.msdrg import DRGEngine
class TestMCD00(unittest.TestCase):
def test_mdcs00(self):
de = DRGEngine()
drg_lst = de.get_drg_all(["I10", "E0800"], ["02YA0Z0"])
self.assertTrue("001" in drg_lst)
drg_lst = de.get_drg_all(["I10"], ["02YA0Z0"])
self.asse... | StarcoderdataPython |
3254833 | <filename>get_user_credentials.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Get user oauth credentials.
Utility to help with getting the access token for a user
"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import sys
import logging
import tw... | StarcoderdataPython |
3297074 | import tqdm
sources = {}
def source(fn):
"""Append function to available sources for the CLI."""
sources[fn.__name__] = fn
return fn
def _scrape_ids(ids, scraper, name, progress=False):
parsed_scripts = []
iterator = tqdm.tqdm(ids, 'Processing {} scripts'.format(name)) if progress else ids
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.