id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
1666116 | <reponame>deanwang539/davis_v0.1
from davis import app
app.run()
| StarcoderdataPython |
3387149 | ## A bunch of summary plots for the minimal model
"""
7D, right
PLOT_FIT_QUALITY_VS_DEPTH_effect_ll_per_whisk
STATS__PLOT_FIT_QUALITY_VS_DEPTH_ll_per_whisk
Bar plot of fit quality by cell type and depth
7D, left
PLOT_FIT_QUALITY_VS_DEPTH_vdepth_ll_per_whisk
N/A
Depth plot of fit quality by... | StarcoderdataPython |
1672152 | import faceDet.ViolaJones.Regions as region
import numpy as np
class WeakClassifier:
def __init__(self, positive_regions, negative_regions, threshold, polarity):
"""
This is the actual feature which can also be called a weak classifier.
:param positive_regions: positively contribut... | StarcoderdataPython |
1706816 | <gh_stars>0
from django.conf.urls import url, patterns, include
from ginger.conf.urls import scan
from . import views
urlpatterns = scan(views) + patterns("", url("", include("django.contrib.auth.urls")),) | StarcoderdataPython |
3241713 | <filename>prtgrestcli/enums.py<gh_stars>0
from enum import Enum
class PrtgErrorCodes(Enum):
OK = 0
WARNING = 1
SYSTEM_ERROR = 2
PROTOCOL_ERROR = 3
CONTENT_ERROR = 4
def __str__(self):
return str(self.value)
class PrtgUnits(Enum):
BytesBandwidth = "BytesBandwidth"
BytesMemory =... | StarcoderdataPython |
1682329 | <gh_stars>0
import argparse
import shlex
import subprocess
import itertools
import ipaddress
import time
NODE_0='172.16.58.3'
NODE_1='10.1.1.2'
BRIDGE='br0'
# Syntax: python connect_container.py -B br0 -N click0 -D 3
def attach_container(bridge, container_name):
interfaces=('eth0', 'eth1')
for interface in i... | StarcoderdataPython |
1607037 | # creates: h2.emt.traj
from ase import Atoms
from ase.calculators.emt import EMT
from ase.optimize import QuasiNewton
system = Atoms('H2', positions=[[0.0, 0.0, 0.0],
[0.0, 0.0, 1.0]])
calc = EMT()
system.calc = calc
opt = QuasiNewton(system, trajectory='h2.emt.traj')
opt.run(fmax=0.... | StarcoderdataPython |
1616085 | <gh_stars>0
#
# See ../LICENSE
#
# This file is a configuration example for a MyISAM table with cities, considering Deleted and Non deleted as distinct objects.
#
#
import config_base
import field_isam as isam
import field_inno_antelope as inno
import scanner_shared
import validators
validate_pop = validators.make_... | StarcoderdataPython |
3363681 | <reponame>janiszewskibartlomiej/own_framework_for_e2e_tests
import os
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from page_objects.base_page import BasePage
from utils.automation_functions import (
data_loader,
save_to_json,
get_path_t... | StarcoderdataPython |
85891 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 12 15:40:08 2020
plot composite plots sea level & barotropic currents for ROMS sensitivity experiments with uniform wind speed change and closed english channel,
and difference in responses w.r.t. same experiments with an open english channel
@auth... | StarcoderdataPython |
1606876 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Draw time series from csv files or lists
Data series come from the columns of the csv files multi columns can be used from
the same file. One column for x values (it can be numerical or date/time data) and
more columns for y1, y2, .., yn. Alternativel... | StarcoderdataPython |
4837747 | # Copyright (c) 2017 Ansible Tower by Red Hat
# All Rights Reserved.
from awx.main.utils.insights import filter_insights_api_response
from awx.main.tests.data.insights import TEST_INSIGHTS_HOSTS, TEST_INSIGHTS_PLANS, TEST_INSIGHTS_REMEDIATIONS
def test_filter_insights_api_response():
actual = filter_insights_ap... | StarcoderdataPython |
4800550 | <filename>api/accounts/api.py
from rest_framework.generics import GenericAPIView as View
from rest_framework.response import Response
from rest_framework.status import (
HTTP_201_CREATED,
HTTP_205_RESET_CONTENT,
HTTP_401_UNAUTHORIZED,
)
from rest_framework.permissions import IsAuthenticated
from rest_framew... | StarcoderdataPython |
96125 | """Discover and load entry points from installed packages."""
# Copyright (c) <NAME> and contributors
# Distributed under the terms of the MIT license; see LICENSE file.
from contextlib import contextmanager
import glob
from importlib import import_module
import io
import itertools
import os.path as osp
import re
impo... | StarcoderdataPython |
3366071 | <filename>app/post/urls.py
from django.urls import path
from post.views import (
PostListAPI,
PostLikeSave,
PostDetailAPI,
SearchAPI,
PostLikeList,
PostCreateUpdateDestroy)
app_name = 'post'
urlpatterns = [
path('', PostCreateUpdateDestroy.as_view({
'post': 'create',
'patch... | StarcoderdataPython |
3241560 | <gh_stars>0
print ("Hi!") | StarcoderdataPython |
1681743 | #!/usr/bin/env python
""" performs a large scale test of TB sequence storage.
adds simulated TB samples, groups of which have evolved from common ancestors
This program does not generate the simulated sequences; this is done by make_large_sequence_set.py
#### Scenario tested
A large number of samples are derived from... | StarcoderdataPython |
3241160 | '''original example for checking how far GAM works
Note: uncomment plt.show() to display graphs
'''
example = 2 # 1,2 or 3
import numpy as np
import numpy.random as R
import matplotlib.pyplot as plt
from statsmodels.sandbox.gam import AdditiveModel
from statsmodels.sandbox.gam import Model as GAM #?
from statsmode... | StarcoderdataPython |
3250781 | """
the tests for the main app functionality
"""
from copy_unique import __version__
def test_version() -> None:
"is __version__ a 5-character string"
assert isinstance(__version__, str)
assert len(__version__) == 5
| StarcoderdataPython |
3249294 | import numpy as np
import torch
device = 'cpu'
if torch.cuda.is_available():
device = 'cuda'
def get_save_path(name):
return 'saves/{}.pt'.format(name)
def save_model(model, name):
torch.save(model, get_save_path(name))
def load_model(name):
model = torch.load(get_save_path(name), map_location=dev... | StarcoderdataPython |
1612713 | #!/usr/bin/bash
# -*- coding: utf-8 -*-
def my_append_list(l, e):
"Simuliert die Append-Methode. Hängt e an l an."
l[len(l):] = [e]
return l
def my_append_string(s, e):
"Simuliert die Append-Methode. Hängt e an s an."
s += e
return s
def my_append_tuple(t, e):
"Simuliert die Append-Method... | StarcoderdataPython |
158841 | <gh_stars>10-100
import os
from dotenv import load_dotenv
import pytest
from legislice.download import Client
from authorityspoke.io import loaders, name_index, readers
from authorityspoke.facts import Exhibit
from authorityspoke.rules import Rule
from authorityspoke.io.fake_enactments import FakeClient
load_dotenv... | StarcoderdataPython |
16009 | import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("installed_packages", [
("haproxy20"),
("socat"),
("keepalived"),
("bind"),
])
def test_p... | StarcoderdataPython |
1774357 | <gh_stars>0
import os
from autoPyTorch.pipeline.base.pipeline_node import PipelineNode
from autoPyTorch.utils.config.config_file_parser import ConfigFileParser
from autoPyTorch.utils.config.config_option import ConfigOption, to_bool
from autoPyTorch.utils.hyperparameter_search_space_update import \
parse_hyperpara... | StarcoderdataPython |
1764442 | <reponame>evamwangi/bc-7-Todo_List<gh_stars>0
from flask import Flask, render_template
from flask.ext.bootstrap import Bootstrap
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from config import config
bootstrap = Bootstrap()
db = SQLAlchemy()
#Initialization of the Flask-Login
lo... | StarcoderdataPython |
1777762 | <gh_stars>1-10
# Source:
# https://peterroelants.github.io/posts/neural-network-implementation-part01/
import matplotlib
matplotlib.use('TkAgg')
import sys
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('darkgrid')
np.random.seed(seed=13)
def print_versions():
print('Py... | StarcoderdataPython |
4818454 | #!/usr/bin/env python
"""
FACADE
Use this pattern when:
1. you want to provide a simple interface to a complex subsystem. Subsystems often get more complex as they evolve. Most patterns, when applied, result in more and smaller classes. This makes the subsystem more reusable and easier to customize, but it also bec... | StarcoderdataPython |
4831308 | """Ingest John Hopkins University Covid-19 data.
Load covid data from C3 AI datalake or from JHU and convert it to C3 AI format.
See: https://github.com/reichlab/covid19-forecast-hub/data-truth
"""
import io
import pandas as pd
import requests
from onequietnight.data import c3ai
metrics = ["JHU_ConfirmedCases", "J... | StarcoderdataPython |
3358671 | <filename>trebol/interface.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tornado.gen
import bcrypt
__all__ = ["create_new_user"]
@tornado.gen.coroutine
def get_next_id(db, collection):
counter = yield db.counters.find_and_modify(
{"_id": "{}id".format(collection)},
{"$inc": {"seq": 1}}... | StarcoderdataPython |
1690994 | # NOTICE:
# This file should not be deleted, or ImportError will be raised in Python 2.7 when importing plugin
| StarcoderdataPython |
3201172 | <reponame>matthewdargan/Spotify-Siri-Integration
#You can import any modules required here
#This is name of the module - it can be anything you want
moduleName = "life"
#These are the words you must say for this module to be executed
commandWords = ["meaning","life"]
#This is the main function which will be execute ... | StarcoderdataPython |
3334510 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology.
# SPDX-FileCopyrightText: © 2021 <NAME> <<EMAIL>>
# NOTICE: authors should document their contributions in concisely in NOTICE
# with details inline in source files... | StarcoderdataPython |
1718808 | <filename>NaiveBayes.py
#!/usr/bin/python
import numpy as np
def logit(x):
""" Computes logit function
Parameters
----------
x : {float, int}
Returns
-------
out : {float, int}
Logit value
"""
if x > 0:
out = np.log(1. * x / (1 - x))
return out
def comp... | StarcoderdataPython |
158490 | <gh_stars>100-1000
from modeltranslation.translator import translator, TranslationOptions
from openbook_common.models import Emoji, EmojiGroup, Badge, Language
class EmojiGroupTranslationOptions(TranslationOptions):
fields = ('keyword',)
translator.register(EmojiGroup, EmojiGroupTranslationOptions)
class Emo... | StarcoderdataPython |
4821740 | <reponame>abixadamj/lekcja-enter-przyklady
import sqlite3
from random import randint
connection = sqlite3.connect('hasla.sqlite')
cursor = connection.cursor()
vals = ("login_"+str(randint(1,500)), randint(100,1000) )
try:
cursor.execute('INSERT INTO Hasla ("Username","Password") VALUES (?,?)', vals)
print("U... | StarcoderdataPython |
1784692 | # -*- coding: utf-8 -*-
# @Author: MR_Radish
# @Date: 2018-07-24 11:18:50
# @E-mail: <EMAIL>
# @FileName: imutils.py
# @TODO: imutils, it’s a library that
# we are going to write ourselves and create “convenience”
# methods to do common tasks like translation, rotation, and
# resizing.It made by myself
import ... | StarcoderdataPython |
23822 | from decimal import Decimal
def ensure_decimal(value):
return value if isinstance(value, Decimal) else Decimal(value)
| StarcoderdataPython |
1695730 | <gh_stars>10-100
from typing import Any, Dict, Iterable
import numpy as np
from fugue.workflow.workflow import FugueWorkflow
from tune import Space, Trial, TrialDecision, TrialReport
from tune.constants import TUNE_REPORT_METRIC
from tune.concepts.dataset import TuneDatasetBuilder
from tune.iterative.objective import I... | StarcoderdataPython |
1764096 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import operator
from typing import Callable, Iterable, Sequence, Tuple, TypeVar
from pants.base.deprecated import deprecated
_T = TypeVar("_T")
Filter = Callable[[_T], bool]
def _extra... | StarcoderdataPython |
4929 | <filename>coremltools/converters/mil/frontend/tensorflow/converter.py
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import logging
from coremltools... | StarcoderdataPython |
101302 | <gh_stars>0
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import unittest
import os
import posixpath
import numpy as np
from molmod.units import *
from pyiron.atomi... | StarcoderdataPython |
126372 | <reponame>YuweiYin/Algorithm_YuweiYin
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""=================================================================
@Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3
@File : LC-0089-Gray-Code.py
@Author : [YuweiYin](https://github.com/YuweiYin)
@Date : 2022-01-08
===... | StarcoderdataPython |
1701500 | <reponame>d4l3k/cs425
from PIL import Image
import numpy as np
import math
from scipy import signal
def boxfilter(n):
assert n % 2 == 1, "Dimension must be odd"
return np.full((n,n), 1/(n*n))
def gauss1d(sigma):
# l is the length of the gaussian filter
l = math.ceil(sigma * 6)
if l % 2 == 0:
... | StarcoderdataPython |
3263136 | #soru1
metin = ("Açık bilim, araştırma çıktılarına ve süreçlerine herkesin serbestçe erişmesini, bunların ortak kullanımını, dağıtımını ve üretimini kolaylaştıran bilim uygulamasıdır.")
slices = metin[:20]
print(slices)
#soru2
liste = ["Açık Bilim", "Açık Erişim", "Açık Lisans", "Açık Eğitim", "Açık Veri", "Açık Kültü... | StarcoderdataPython |
3396853 | <gh_stars>1-10
from django.contrib import admin
from .models import Maha1, Incidences
from leaflet.admin import LeafletGeoAdmin
class IncidencesAdmin(LeafletGeoAdmin):
list_display = ['name', 'location']
class MahaAdmin(LeafletGeoAdmin):
pass
admin.site.register(Incidences, IncidencesAdmin)
admin.site.regis... | StarcoderdataPython |
3238316 | import sys
import os
def message(type, content = ''):
return '%s%s;' % (type, content)
def jeton():
return message('J')
def prime(n):
return message('P', str(n))
def unknown(n):
return message('?', str(n))
def noprime(n):
return message('N', str(n))
def decode(str):
type = str[0]
... | StarcoderdataPython |
89142 | <gh_stars>0
"""Admin classes for the ``cmsplugin_blog_categories`` app."""
from django.contrib import admin
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from cmsplugin_blog.admin import EntryAdmin
from simple_translation.admin import TranslationAdmin
from si... | StarcoderdataPython |
3304131 | <filename>pymager/persistence/_schemamigrator.py
"""
Copyright 2010 <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 r... | StarcoderdataPython |
1600071 | # The ArtNET Receiver is based upon the work of
# https://github.com/Blinkinlabs/BlinkyTape_Python/blob/master/artnet-receiver.py by <NAME>
import sys
import time
import socket
from struct import unpack
import threading
UDP_IP = "" # listen on all sockets- INADDR_ANY
UDP_PORT = 0x1936 # Art-net is supposed to only... | StarcoderdataPython |
95362 | <filename>Project Euler Problems/Problem55.py<gh_stars>0
def checkpalindromic(num):
i = 1
newNum = num
while i <= 50:
newNum = newNum + int(str(newNum)[::-1])
i = i + 1
if str(newNum) == str(newNum)[::-1]:
return True
return False
ans = 0
for i in range(1,10... | StarcoderdataPython |
18122 | from typing import Dict, Any
import pytest
from checkov.common.bridgecrew.bc_source import SourceType
from checkov.common.bridgecrew.platform_integration import BcPlatformIntegration, bc_integration
@pytest.fixture()
def mock_bc_integration() -> BcPlatformIntegration:
bc_integration.bc_api_key = "<KEY>"
bc_... | StarcoderdataPython |
1726010 | from interpreter.typing.basic_type import BasicType
class UnionType(BasicType):
def __init__(self, lhs, rhs):
BasicType.__init__(self, None, {}, False)
self.lhs = lhs
self.rhs = rhs
def compare_value(self, other_type):
return self.lhs.compare_value(other_type) or self.rhs.compa... | StarcoderdataPython |
128524 | class C(object):
foo = None
| StarcoderdataPython |
3208305 | import os
import os.path as osp
import numpy as np
from scipy.integrate import odeint
import moviepy.editor as mpy
from qtpy.QtCore import Qt
from qtpy.QtCore import QPointF
from qtpy.QtGui import QColor
from nezzle.graphics import EllipseNode
from nezzle.graphics import TextLabel
from nezzle.graphics import CurvedE... | StarcoderdataPython |
196994 | from dateutil.relativedelta import relativedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Q
import logging
from mooringlicensing.components.approvals.email import send_vessel_nomination_re... | StarcoderdataPython |
1684870 | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Issue object integration functionality via cron job."""
# pylint: disable=invalid-name
import logging
from datetime import datetime
from ggrc import db
from ggrc.models import all_models
from ggrc.inte... | StarcoderdataPython |
106142 | <filename>spark/example/count.py
import pyspark
print("*****", pyspark.SparkContext().parallelize(range(0, 10)).count(), "*****")
| StarcoderdataPython |
3302332 | from libnessus.parser import NessusParser
from libnessus.reportjson import ReportEncoder
import json
from pprint import pprint
nessus_obj_list = NessusParser.parse_fromfile('/vagrant/nessus.xml')
for nessuso in nessus_obj_list:
pprint(json.dumps(nessuso, cls=ReportEncoder))
| StarcoderdataPython |
14881 | <reponame>fjarri/grunnur
import pytest
import numpy
from grunnur import (
cuda_api_id, opencl_api_id,
StaticKernel, VirtualSizeError, API, Context, Queue, MultiQueue, Array, MultiArray
)
from grunnur.template import DefTemplate
from .mock_base import MockKernel, MockDefTemplate, MockDefTemplate
from .mock... | StarcoderdataPython |
1663622 | import tensorflow as tf
class FaceRecGraph(object):
def __init__(self):
self.graph = tf.Graph()
| StarcoderdataPython |
1707468 | from Crypto.Cipher import AES
from Crypto.Hash import SHA256
from Crypto import Random
import hashlib
# travis encrypt PASSWORD=password -a -x
sha = SHA256.new()
sha.update(raw_input('Password:'))
key = sha.hexdigest()[:AES.block_size*2]
text = open('emails.txt', 'rb').read()
iv = text[:AES.block_size]
cipher = text... | StarcoderdataPython |
3358531 | from setuptools import setup
#from setuptools import find_packages
setup(
name="EpiRank",
version="0.0.1",
author="<NAME>",
author_email="<EMAIL>",
packages=['EpiRank'],
include_package_data=False,
url="https://bitbucket.org/wcchin/epirank3",
license="LICENSE.txt",
description... | StarcoderdataPython |
85257 | <reponame>mshvartsman/hydra<filename>tests/test_examples/test_patterns.py<gh_stars>1-10
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import sys
from pathlib import Path
from subprocess import check_output
from typing import Any, List
import pytest
from omegaconf import DictConfig
from hydra.... | StarcoderdataPython |
3365139 | import numpy as np
import calc.mathops as mo
import util.rdate as rd
import ml.gbm as gbm
import sys
import os
import json
def resource_path(res_):
if hasattr(sys, "_MEIPASS"):
return os.path.join(sys._MEIPASS, res_)
return os.path.join(res_)
def print_timestamp():
print rd.get_timestamp()
def... | StarcoderdataPython |
3264514 | from enum import Enum
class StrEnum(str, Enum):
...
class PlatformVersion(StrEnum):
WINDOWS = 'Windows'
LINUX = 'Linux'
MAC = 'Darwin'
| StarcoderdataPython |
3344169 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Config Loader/Saver """
import json
import os
from account import Account, AccountJSONEncoder
class Config:
""" Config class """
_path = os.environ["HOME"] + "/.gitaccount"
_config = {}
def __init__(self, path=None):
""" init Method """
... | StarcoderdataPython |
1699102 | <gh_stars>0
from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from django_better_admin_arrayfield.admin.mixins import DynamicArrayMixin
from solo.admin import SingletonModelAdmin
from .forms import OpenIDConnectConfigForm
from .models import OpenIDConnectConfig
@admin.register(... | StarcoderdataPython |
72098 | <reponame>rimmartin/cctbx_project
from __future__ import division
from scitbx.array_family import flex
from cma_es import cma_es
class cma_es_driver(object):
"""
This object provides one with a easy interface to cma_es optimisation.
For now, no options can be set, this will be added in the future.
"""
def __... | StarcoderdataPython |
3224331 | <reponame>psyphh/xifa<gh_stars>1-10
from .gpcm import GPCM
from .grm import GRM
__all__ = ["GRM",
"GPCM"]
| StarcoderdataPython |
3244341 | <reponame>Seiwell0610/MessageTag
import discord
from discord.ext import commands
import os
print(os.path.basename(__file__))
class Help(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def help(self, ctx):
embed = discord.Embed(title="ヘルプ", co... | StarcoderdataPython |
3252833 | <filename>augraphy/augmentations/gamma.py
import os
import random
import cv2
import numpy as np
from augraphy.base.augmentation import Augmentation
class Gamma(Augmentation):
"""Adjusts the gamma of the whole image by a chosen multiplier.
:param range: Pair of ints determining the range from which to sampl... | StarcoderdataPython |
1771501 | <reponame>deng113jie/ExeTeraCovid<gh_stars>1-10
from io import BytesIO
import unittest
from datetime import datetime
import exetera.core.session as esess
from exeteracovid.algorithms.covid_test import match_assessment
class TestCovidTest(unittest.TestCase):
def test_match_assessment(self):
bio = BytesIO()... | StarcoderdataPython |
150293 | # MIT License
#
# Copyright (c) 2020 <NAME>
#
# 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 without limitation the rights
# to use, copy, modify, merge, publi... | StarcoderdataPython |
90770 | <reponame>davidcollom/Flexget
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from flexget.api.app import base_message
from flexget.utils import json
class TestFormatChecker(object):
config = 'tasks: {}'
def ... | StarcoderdataPython |
3273241 | from . import mesos
Mesos = mesos.Mesos
__version__ = "1.0.0"
__all__ = ['mesos']
| StarcoderdataPython |
30035 | # Eigen pretty printer
__import__('eigengdb').register_eigen_printers(None)
| StarcoderdataPython |
3223696 | <gh_stars>0
def test_log_format():
from parrot_api.core import log_event
log_event(
level='error', status='failure', process_type='delivery', payload={'message': 'test'}
)
| StarcoderdataPython |
171559 | <reponame>iamjdcollins/districtwebsite
from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from mptt.admin import MPTTModelAdmin
from apps.pages.admin import PrecinctMapInline
import apps.common.functions as commonfunctions
from .models import Location, City, State, Zipcode, Language, Translat... | StarcoderdataPython |
4822173 | <filename>rotary_online/rotary_online/doctype/meeting/meeting.py
# -*- coding: utf-8 -*-
# Copyright (c) 2020, <NAME>, Rotaract Charitable Trust and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, getdate, today, to_tim... | StarcoderdataPython |
110993 | from wagtail.blocks.static_block import * # NOQA
| StarcoderdataPython |
1618878 | '''Given models finetuned on existing benchmarks, evaluate on RNPC tasks.'''
import os
import sys
os.chdir("../../../..")
root_dir = os.getcwd()
sys.path.append(f"{root_dir}/source")
# config
from configuration import Config
config_path = (f'source/Qa/eval_on_RNPC/other_models/config.json')
config = Config.from_json... | StarcoderdataPython |
1608134 | from scapy.all import *
from mirage.core.module import WirelessModule
from mirage.libs.esb_utils.scapy_esb_layers import *
from mirage.libs.esb_utils.packets import *
from mirage.libs.esb_utils.constants import *
from mirage.libs.esb_utils.dissectors import *
from mirage.libs.esb_utils.rfstorm import *
from mirage.libs... | StarcoderdataPython |
3303856 | <reponame>aquemy/HCBR
from random import randint
from subprocess import Popen, PIPE
from hcbr import HCBRClassifier
import numpy as np
from sklearn.metrics import accuracy_score, matthews_corrcoef
from sklearn.model_selection import train_test_split, RepeatedStratifiedKFold, RepeatedKFold
HCBR_BIN = '../../../build... | StarcoderdataPython |
3355053 | # standard imports
import datetime
import time
import os
from os import path
import platform
import signal
import pygame
from pygame.locals import QUIT, VIDEORESIZE, KEYDOWN, K_q
import requests
# local imports
import config
def exit_gracefully(signum, frame):
sys.exit(0)
signal.signal(signal.SIGTERM, exit_grace... | StarcoderdataPython |
3204928 | extensions = ["myst_parser"]
exclude_patterns = ["_build"]
myst_disable_syntax = ["emphasis"]
myst_dmath_allow_space = False
mathjax_config = {}
myst_amsmath_enable = True
myst_deflist_enable = True
myst_figure_enable = True
| StarcoderdataPython |
1761162 | """
import math
print(math.sin(1))
print(math.cos(2))
print(math.tan(3))
print(math.pow(2, 2))
print(math.sqrt(4))
from math import sin
print(sin(1))
import math as m
print(m.sin(1))
print(m.cos(2))
print(m.tan(3))
print(m.pow(2, 2))
print(m.sqrt(4))
from math import sin as s
print(s(1))
"""
| StarcoderdataPython |
3378182 | #! python3.8
# -*- coding: utf-8 -*-
# File name: geocoder.py
# Author: <NAME>
# Email: <EMAIL>
# Created: 27.11.2019
# Modified: 27.11.2019
"""
TODO:
Module's docstring
"""
# Standard imports
# ---
# Third party imports
from opencage.geocoder import OpenCageGeocode
# Package imports
from ... | StarcoderdataPython |
3330906 | <reponame>mirceaulinic/irrd
"""Set prefix_length in existing RPSL objects
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2019-03-04 16:14:17.862510
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql as pg
from sqlalchemy.ext.declarative import declarative_base
# revis... | StarcoderdataPython |
1625797 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..registration import Registration
def test_Registration_inputs():
input_map = dict(
args=dict(argstr="%s",),
environ=dict(nohash=True, usedefault=True,),
fixed_image=dict(argstr="-f %s", extensions=None, mandatory=True,),
... | StarcoderdataPython |
4824725 | #!/usr/bin/env python
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# ... | StarcoderdataPython |
1738689 | <reponame>idlesign/django-logexpose
from django.test import TestCase, RequestFactory
from django.http import HttpResponse
from django.utils import timezone
from .loggers.base import BaseLogger
from .loggers.request import RequestLogger
from .loggers.process import ProcessLogger
from .backends.base import BaseDataBacke... | StarcoderdataPython |
4802895 |
import cqparts
from cqparts.display import display
from cqparts.constraint import Fixed, Coincident
from cqparts.constraint import Mate
from cqparts.utils import CoordSystem
from cqparts.catalogue import JSONCatalogue
import cqparts_motors
import os
from .motor_mount import MountedStepper
from .stepper import Steppe... | StarcoderdataPython |
3318044 | USUARIO_TEMA = "CALL get_temas(%s,%s)"
| StarcoderdataPython |
1668032 | #!/usr/bin/python3
"""
Take a list, say for example this one:
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
and write a program that prints out all the elements of the list that are less than 5.
Extras:
Instead of printing the elements one by one, make a new list that has all the elements
less than 5 from this list in ... | StarcoderdataPython |
1734932 | <reponame>eldad-a/BioCRNPyler
from biocrnpyler.chemical_reaction_network import Species, Reaction, ComplexSpecies, ChemicalReactionNetwork
print("Start")
#Names of different supported propensities
propensity_types = ['hillpositive', 'proportionalhillpositive', 'hillnegative', 'proportionalhillnegative', 'massaction',... | StarcoderdataPython |
3352499 | import gi
import math
import cairo
import numpy
from dock import Dock, create_icon, get_gicon_pixbuf, pixbuf2image
gi.require_version('Gtk', '3.0') # noqa
gi.require_version('Gdk', '3.0') # noqa
gi.require_version('Gio', '2.0') # noqa
gi.require_version('GObject', '2.0') # noqa
from applications import AppCache, ... | StarcoderdataPython |
137808 | # Copyright (C) 2010-2011 <NAME>
#
# 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 without limitation the
# rights to use, copy, modify, merge, publish, distrib... | StarcoderdataPython |
3327827 | from .core import *
from .callbacks import *
from .tokenizers import *
from .model_splits import *
from .transforms import *
from .generated_lm import GeneratedLM, GenerateArgs | StarcoderdataPython |
1774761 | <reponame>late-goodbye/codingame-overcomplicated
import logging
from math import floor, sqrt
logging.basicConfig(level=logging.DEBUG)
class Message(object):
def __init__(self, text: str = None):
self.logger = logging.getLogger(type(self).__name__)
self.text = text
self.logger.info('Set t... | StarcoderdataPython |
172269 | # -*- coding: utf-8 -*-
"""
locale test_services module.
"""
import pytest
import pyrin.globalization.locale.services as locale_services
import pyrin.configuration.services as config_services
from pyrin.globalization.locale.exceptions import InvalidLocaleSelectorTypeError, \
LocaleSelectorHasBeenAlreadySetError,... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.