id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
4855651
#changeText.py #A.Colwell(2014) ''' Program counts to 10 using a text box. The numbers change almost every second. ''' from graphics import * from time import sleep w=GraphWin('Changing Text',300,200) text=Text(Point(150,106),'0') text.draw(w) for i in range(10): sleep(1) text.setText(str(i+1...
StarcoderdataPython
3347896
<gh_stars>0 import logging import traceback from datetime import timedelta from functools import wraps from typing import Callable, Optional from airflow_monitor.shared.base_tracking_service import ( BaseDbndTrackingService, WebServersConfigurationService, ) from dbnd._core.errors import DatabandError from db...
StarcoderdataPython
1779395
<reponame>3dgiordano/taurus """ Module holds JMX handlers implementations Copyright 2017 BlazeMeter 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...
StarcoderdataPython
3482361
#!/usr/bin/env python import os import sys import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LogNorm import argparse import seaborn.apionly as sns import composition.support_functions.paths as paths from composition.support_functions.checkdir import checkdir from composition.analysis.lo...
StarcoderdataPython
9643793
<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import sorl.thumbnail.fields import mptt.fields import bitfield.models from django.db import models, migrations from publication_backbone.utils.media import get_media_path from publication_backbone.models_bases.polymorphic_mp...
StarcoderdataPython
3554963
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2017-11-20 17:55 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('inventory', '0033_auto_20171108_1749'), ] operations = [ migrations.AlterFi...
StarcoderdataPython
11296181
import numpy as np import scipy from ... import operators __all__ = ['ssa','kernel_ssa'] #----------------------------------------------------------------- __EPSILON__ = 1e-4 def ssa(x, order, mode='toeplitz', lags=None, averaging=True, extrasize = False): ''' Estimation the signal components based on...
StarcoderdataPython
77103
<reponame>cristianoandrad/ExerciciosPythonCursoEmVideo<gh_stars>0 # Crie um programa que leia vários números inteiros pelo teclado. O programa só vai parar quando o usuário digitar o valor 999, que é a condição de parada. No final, mostre quantos números foram digitados e qual foi a soma entre eles (desconsiderando o f...
StarcoderdataPython
6515725
<filename>tests/functional/modules/ims_psb_gen/uss_file/test_invalid_input.py # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from ansible.module_utils.basic import AnsibleModule from pprint import pprint import pytest import ansible.utils import ansible.errors import ansibl...
StarcoderdataPython
11243146
#!/usr/bin/env python import argparse import pcgrutils from cyvcf2 import VCF, Writer import os logger = pcgrutils.getlogger('pcgr-flatten-multisample') def __main__(): parser = argparse.ArgumentParser(description='Flatten multisample VCF file to single sample VCF files') parser.add_argument('vcf_file', he...
StarcoderdataPython
1815985
"""this module acertain the correctness of vectorizer.""" #oggpnosn #hkhr """create different variants of the same sentence and feed it to the vectorizer, it shouldn't output drastically different embedding."""
StarcoderdataPython
6694495
"""Integration tests for acquisition of COVID hospitalization.""" # standard library import unittest from unittest.mock import MagicMock # first party from delphi.epidata.acquisition.covid_hosp.common.database import Database from delphi.epidata.acquisition.covid_hosp.common.test_utils import UnitTestUtils from delph...
StarcoderdataPython
1674223
<reponame>jamesscottbrown/bionano-wetLabAccelerator import os import logging import sys from unittest import TestCase from nose.plugins.attrib import attr from testconfig import config from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities class _BaseTest(TestCas...
StarcoderdataPython
145546
"""Module for unit testing."""
StarcoderdataPython
1894648
#!/usr/bin/env python3 # # Copyright (c) 2015 - 2022, Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # import os import sys import pandas import signal import unittest import subprocess import geopmpy.launcher import geopmpy.io import geopmpy.policy_store from integration.test import util @util.skip_...
StarcoderdataPython
1615921
pkgname = "bsdutils" _commit="<KEY>" version = "0.0.1" revision = 3 wrksrc = f"bsdutils-{_commit}" bootstrap = True build_style = "meson" makedepends = [ "acl-devel", "ncurses-devel", "libedit-devel", "openssl-devel", "musl-fts-devel", "musl-rpmatch-devel", "libxo-devel" ] short_desc = "Alternative to GNU coreu...
StarcoderdataPython
6523365
<filename>scripts/QTL_control_overlap.py #!/usr/bin/env python # this script checks: # if any of the QTL confidence intervals overlap with locations of the TE control genes as cited in literature # if any of the QTL confidence intervals overlap with locations of piRNAs # USE: QTL_control_overlap.py # NOTE: must fi...
StarcoderdataPython
3283424
"""jc - JSON CLI output utility `lsblk` command output parser Usage (cli): $ lsblk | jc --lsblk or $ jc lsblk Usage (module): import jc.parsers.lsblk result = jc.parsers.lsblk.parse(lsblk_command_output) Compatibility: 'linux' Examples: $ lsblk | jc --lsblk -p [ { ...
StarcoderdataPython
3493230
"""File wrapping sync related functions, You will see that this files uses the workspace repo/org and the github repo/org together with the raw Api of git for example. We are aware this is not the best design and ideally all git calls should be hidden within the workspace module but we chose to be pragmatic for the...
StarcoderdataPython
9703090
<reponame>openmpf/openmpf-build-tools #!/usr/bin/env python3 ############################################################################# # NOTICE # # # # This software (or tech...
StarcoderdataPython
11322461
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals, division, absolute_import from builtins import (bytes, dict, int, list, object, range, str, # noqa ascii, chr, hex, input, next, oct, open, pow, round, super, filter, map, zip) from future import standard_library...
StarcoderdataPython
9670407
<reponame>Louisecatlover/dronekit-python #!/usr/bin/env python # -*- coding: utf-8 -*- """ © Copyright 2015-2016, 3D Robotics. guided_set_speed_yaw.py: (Copter Only) This example shows how to move/direct Copter and send commands in GUIDED mode using DroneKit Python. Example documentation: http://python.dronekit.io/e...
StarcoderdataPython
175889
from flask import Flask from flask import render_template from flask import request from flask import session from flask import redirect # I will learn after that will use from flask import url_for # I will learn after that will use from flask import flash # I will learn after that will use import pymysql.cursors i...
StarcoderdataPython
4852360
<gh_stars>1-10 # pylint: disable=no-member import math import random import time from os.path import join, exists import torch from torchvision import transforms import numpy as np import pickle import gym import gym.envs.box2d from torch.distributions import Normal, Categorical #from utils import sample_mdrnn_laten...
StarcoderdataPython
11257153
import os import pandas as pd import numpy as np import tensorflow as tf import librosa import tqdm from sklearn.utils.class_weight import compute_class_weight from sklearn.model_selection import train_test_split from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Embedding from t...
StarcoderdataPython
6541371
<reponame>district10/three.py from threepy.material.Material import * # Surface materials from threepy.material.SurfaceBasicMaterial import * from threepy.material.SurfaceLightMaterial import * # Line materials from threepy.material.LineBasicMaterial import * from threepy.material.LineSegmentMaterial import * from th...
StarcoderdataPython
8156565
import importlib.resources import itertools import logging from typing import Optional, Generator, Union, Iterable, cast from pathlib import Path from os import PathLike import re import csv from dataclasses import dataclass from importlib.resources import open_text as open_text_resource LOG = logging.getLogger(__nam...
StarcoderdataPython
155788
import pytest from allennlp.data.dataset_readers import TextClassificationJsonReader from allennlp.common.util import ensure_list from allennlp.common.testing import AllenNlpTestCase class TestTextClassificationJsonReader: @pytest.mark.parametrize("lazy", (True, False)) def test_set_skip_indexing_true(self, ...
StarcoderdataPython
19881
<reponame>RussianPlex/plex-tvkultura PREFIX = "/video/tvkultura" NAME = "TVKultura.Ru" ICON = "tvkultura.png" ART = "tvkultura.jpg" BASE_URL = "https://tvkultura.ru/" BRAND_URL = BASE_URL+"brand/" # Channel initialization def Start(): ObjectContainer.title1 = NAME HTTP.Headers['User-Agent'] = 'Mozilla/5.0 (W...
StarcoderdataPython
1679538
from flask import Flask, render_template, Response, jsonify, request, json import os from datetime import datetime import sys import base64 import cv2 from werkzeug import datastructures from options import load_options from datasets import Dataset from models import load_model import random from utility_functions impo...
StarcoderdataPython
1859414
<reponame>christabor/more_collections<gh_stars>0 from more_collections import tuples import pytest def test_dict_tuple1(): assert tuples.typedtuple(dict)({}) == ({},) def test_dict_tuple1_invalid_arity(): with pytest.raises(ValueError): assert tuples.typedtuple(dict)({}, {}) def test_dict_tuple1_...
StarcoderdataPython
1668297
# Copyright (c) 2009, <NAME>'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """macOS platform implementation.""" import collections import contextlib import errno import functools import os from socket import AF_INET from collections import...
StarcoderdataPython
3251880
<gh_stars>10-100 def d(**dct): return dct def topology(): return d( Cell=d( keys=['name'], items=[ d(attribute='properties'), d(child='Node'), d(child='ServerCluster'), ], ), ServerCluster=d( ...
StarcoderdataPython
5106082
<reponame>quanhua92/learning-notes import wx from pubsub import pub class ChangerWidget(wx.Frame): CHANGE = 10 def __init__(self, parent=None): super(ChangerWidget, self).__init__(parent, -1, "Changer View") sizer = wx.BoxSizer(wx.VERTICAL) self.add = wx.Button(self, -1, "Add Money")...
StarcoderdataPython
5003954
<reponame>lion7/virtualbmc # Copyright 2016 Red Hat, 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....
StarcoderdataPython
3590118
# Copyright 2018 <NAME> (<EMAIL>) # 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 writi...
StarcoderdataPython
11319327
from rest_framework import serializers from blog.models import Post class PostListSerializer(serializers.ModelSerializer): class Meta: model = Post fields = ['id', 'title', 'user', "Description", 'published_at', 'active', 'slug'] read_only_fields = ['id'] # can not be editable
StarcoderdataPython
6501080
from Tkinter import Tk, BOTH, END, IntVar, StringVar, LEFT from ttk import Button, Checkbutton, Frame, Style, Combobox, Label, Entry from tkFileDialog import askopenfilename import tkMessageBox from helpers import * import os abspath = os.path.abspath(__file__) dname = os.path.dirname(abspath) os.chdir(dnam...
StarcoderdataPython
3471143
# Test that the function to get football data works import unittest from footy import get_football_data, FOOTY_URL from test.common import VALID_RESULTS, EMPTY_RESULTS import requests_mock from json import JSONDecodeError class TestGetFootballData(unittest.TestCase): """ Test that the football JSON is parsed ...
StarcoderdataPython
101205
import os res = os.popen("build/ARM/gem5.opt configs/example/se.py -c configs/fi/qs-arm").read() #print(res)
StarcoderdataPython
11238267
<filename>olimpiada/ejercicios/olimpiada II/figura.py<gh_stars>0 filas = input("introduzca numero de filas: ") for i in range(filas): for space in range((filas-(i+1))): print " ", for j in range(i+1): print "*", if j < i: print "o", print ""
StarcoderdataPython
1724449
from math import * import sys import error_calc import os import time import track_checker import recalculatePath from Point import Point from vehicleState import VehicleState import model import rospy from custom_msgs.msg import Position from helper_functions import * class PathPlanner: #TODO: Left and right...
StarcoderdataPython
3526659
<filename>yoti_python_sdk/doc_scan/session/create/objective/proof_of_address_objective.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from yoti_python_sdk.doc_scan.constants import PROOF_OF_ADDRESS from .objective import Objective class ProofOfAddressObjective(Objective): """ Proof of add...
StarcoderdataPython
11375291
import sys import os #Importing issue with gpaw-python? #However cannot use this for module importing sys.path.append(os.path.join(os.path.dirname(__file__), "../../")) import numpy from bulk.build import StructureBuilder from bulk.calc import MaterCalc import unittest from ase.parallel import parprint class Test(unit...
StarcoderdataPython
6596007
<filename>app.py #!/usr/bin/env python3 """ Flask & SocketIO based webapp that connects with a Slack workspace and carries messages between the two (hayk (owner) talks from Slack, user talks from webapp) """ import os from flask import Flask, render_template, request, Response from flask_cors import CORS from flask_s...
StarcoderdataPython
1674827
# see https://www.codewars.com/kata/5efae11e2d12df00331f91a6/solutions/python from TestFunction import Test import hashlib def crack(hash): for i in range(0, 99999): pin = '0'*(5-len(str(i))) + str(i) guess = hashlib.md5(pin.encode()).hexdigest() if guess == hash: break return pin test = Test(...
StarcoderdataPython
116749
from rest_framework import serializers from ...models.investment import Investment class InvestmentSerializer(serializers.ModelSerializer): class Meta: model = Investment fields = ('__all__')
StarcoderdataPython
4923381
<filename>texture_example.py #!/usr/bin/env python """ Illustrates texturing on a glyph and also illustrates how easy it is to change that texture when you treat it as a numpy array. You can change the numpy array in-place and have TVTK re-render the scene. TVTK sees a view of this array without doing any data transf...
StarcoderdataPython
279694
<reponame>Tomatosoup97/mimiker from .struct import TailQueue from .cmd import UserCommand from .utils import TextTable, global_var class KernelSegments(UserCommand): """List physical memory segments""" def __init__(self): super().__init__('segments') def __call__(self, args): table = Tex...
StarcoderdataPython
1736507
<reponame>dazed-gerbil/dg_calculations<gh_stars>0 """Conversions used: Fahrenheit Subtract 32, then multiply by 5/9ths Celsius Celsius Multiply by 9/5ths, then add 32 Fahrenheit""" def centigrade_to_fahrenheit(centigrade: float) -> float: return (centigrade * (9 / 5)) + 32 def fahrenheit_to_centigrade(fahrenhei...
StarcoderdataPython
9640156
""" Utilities for interprocess communication between Python and Storm. """ from __future__ import absolute_import, print_function, unicode_literals try: import simplejson as json except ImportError: import json import logging import logging.handlers import os import sys from collections import deque from threa...
StarcoderdataPython
214621
<filename>lensit/qcinv/chain_samples.py from __future__ import print_function from lensit.qcinv import cd_solve import numpy as np def get_defaultmgchain(lmax_sky, lsides, datshape, tol=1e-5, iter_max=np.inf, dense_file='', **kwargs): # FIXME : assert datshape[0] == datshape[1], datshape nside_max = dats...
StarcoderdataPython
6500241
<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-11 01:42 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.sw...
StarcoderdataPython
1900907
<reponame>aymgal/LensModelAPI __author__ = 'aymgal' import inspect import json from copy import deepcopy def get_class_names(instance): class_names = [c.__name__ for c in inspect.getmro(instance.__class__)] return class_names[0], ' < '.join(class_names[:-1]) def filter_dict(dictionary, exclude_keys=None):...
StarcoderdataPython
237788
from django.utils.translation import ugettext_lazy as _ from cms.plugin_pool import plugin_pool from cmsplus.forms import PlusPluginFormBase, get_style_form_fields from cmsplus.plugin_base import PlusPluginBase, StylePluginMixin # SearchResultList # ---------------- # class SearchResultListForm(PlusPluginFormBase):...
StarcoderdataPython
8106184
#!/usr/bin/env python # -*- coding: utf-8 -*- """""" __author__ = 'leferrad' #from rl3.agent.td_lambda import * from rl3.agent.elm import * from rl3.agent.feature import LBPFeatureTransformer from rl3.environment.base import CubeEnvironment from rl3.util.plot import plot_moving_avg import matplotlib.pyplot as plt i...
StarcoderdataPython
5133900
# This file is not meant for public use and will be removed in SciPy v2.0.0. # Use the `scipy.spatial` namespace for importing the functions # included below. import warnings from . import _ckdtree __all__ = [ # noqa: F822 'cKDTree', 'cKDTreeNode', 'coo_entries', 'operator', 'ordered_pairs', ...
StarcoderdataPython
3281310
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # """ Tests for codeanalysis.py """ # Standard library imports import os # Test library imports import pytest # Local imports from spyder.utils.codeanalysis import (check_with_pep8, check_with_pyflakes,...
StarcoderdataPython
11359692
<filename>experiment_scripts/exp4/generateTrials.py import random #Pilot Version ###################### # language variables # ###################### #IOT test this script, set solo_run to true. solo_run = False input_word_list= ['pim','dak','vorg','yeen','grah','skod','gled', 'veek','blit','peka','s...
StarcoderdataPython
9692734
<reponame>ISISComputingGroup/EPICS-DeviceEmulator<gh_stars>1-10 from lewis.adapters.stream import StreamInterface from lewis.utils.command_builder import CmdBuilder from lewis.utils.replies import conditional_reply if_connected = conditional_reply("connected") class EurothermStreamInterface(StreamInterface): """...
StarcoderdataPython
280211
import logging as LOG from tcutils.verification_util import VerificationUtilBase LOG.basicConfig(format='%(levelname)s: %(message)s', level=LOG.DEBUG) class PolicyGeneratorClient(VerificationUtilBase): def __init__(self, inputs, logger=LOG): port = inputs.policy_generator_port ip = inputs.policy_...
StarcoderdataPython
11263755
<reponame>gr33n-made/catalyst<filename>tests/catalyst/dl/test_runner.py # flake8: noqa import shutil import torch from torch.utils.data import DataLoader, TensorDataset from catalyst.dl import Callback, CallbackOrder, SupervisedRunner def test_epoch_increasing(): class IncreaseCheckerCallback(Callback): ...
StarcoderdataPython
1800434
import calendar import time from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple from django.conf import settings from django.http import HttpRequest from django.utils import translation from two_factor.utils import default_device from version import ZULIP_MERGE_BASE from zerver.conte...
StarcoderdataPython
1877580
# License: BSD 3 clause import numpy as np from aslsd.basis_kernels.basis_kernel import BasisKernel from aslsd.utilities import useful_functions as uf dict_upsilon = {} def upsilon_delayedexp_null(t, s, vars_1, vars_2): return 0.*t dict_upsilon['NullKernel'] = upsilon_delayedexp_null def upsilon_delayedex...
StarcoderdataPython
4982217
<filename>examples/Ragoza2017/plot.py<gh_stars>1-10 import pandas as pd import seaborn as sns from matplotlib import pyplot as plt df_all = [] for a in ["augmentation", "no-augmentation"]: for p in ["train", "test"]: df = pd.read_csv(f"results/{a}-{p}.csv", header=None).rename( columns={0: "Ep...
StarcoderdataPython
337740
from activate import activate_venv_or_die activate_venv_or_die()
StarcoderdataPython
11238793
from __future__ import print_function import pycurl def perform(target, write_function=None): """ Perform an HTTP request against a given target gathering some basic timing and content size values. """ fnc = write_function or (lambda x: None) assert target connection = pycurl.Curl() c...
StarcoderdataPython
3229278
import pymongo from bson.son import SON import pprint import json import requests import re import time from bson.regex import Regex def connect(): global client global db global colKeywordSeedValidated global colKeywordFirstValidated global colKeywordSecondValidated from pymongo import MongoClient try: clien...
StarcoderdataPython
3466089
from django.conf import settings from django.test import TestCase from django.urls import reverse from mymoney.apps.bankaccounts.factories import BankAccountFactory from ..factories import UserFactory class ContextProcessorsTestCase(TestCase): def test_extra(self): user = UserFactory(user_permissions=...
StarcoderdataPython
289963
import numpy as np class MetricsFactory: def build(self, names): metrics = [] for name in names: if name == 'accuracy': metrics.append(accuracy) return metrics def accuracy(predicted, target): return np.mean(predicted==target)
StarcoderdataPython
5025963
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
StarcoderdataPython
9677078
from libs.datasets import data_source from covidactnow.datapublic.common_fields import CommonFields from libs.datasets.sources import can_scraper_helpers as ccd_helpers class CDCNewVaccinesCountiesDataset(data_source.CanScraperBase): """In ~June 2021, CDC added a new source for county vaccine data including 1...
StarcoderdataPython
123560
<gh_stars>10-100 import inspect class A: def f(s, x): return x a=A() print( eval('f(1)', getmembers(a)) )
StarcoderdataPython
3425308
<reponame>daveyclk/hologram-python #!/usr/bin/env python # hologram_receive.py - Hologram Python SDK command line interface (CLI) for inbound messages. # # Author: Hologram <<EMAIL>> # # Copyright 2016 - Hologram (Konekt, Inc.) # # LICENSE: Distributed under the terms of the MIT License from Hologram.HologramCloud im...
StarcoderdataPython
4911055
<filename>LIME_explainability/tf_idf_cross_val_lime.py import time import os import pandas as pd import numpy as np from sklearn.model_selection import StratifiedKFold from sklearn.ensemble import RandomForestClassifier from classification.utils_nlp import print_running_time, load_data_and_merge, plot_conf_matrix_and_r...
StarcoderdataPython
344932
<reponame>jckw/notebin from django.contrib import admin from .models import Folder, Note admin.site.register(Folder) admin.site.register(Note)
StarcoderdataPython
307246
<filename>models/wrf_hydro/hydro_dart_py/hydrodartpy/core/setup_wrf_hydro_ens_job.py import code import datetime import os import pathlib import subprocess import sys import wrfhydropy def setup_wrf_hydro_ens_job(config, wrf_hydro_ens_sim): config_job_exe = config['run_experiment']['job_execution'] # I think...
StarcoderdataPython
8182505
<gh_stars>0 from corpus_builder.rule import Rule from corpus_builder.grammar import Grammar from corpus_builder.builder import CorpusBuilder root_rule = Rule('<S>', ('<A>', '<B>')) a_rule = Rule('<A>', ['a', '<B>']) b_rule = Rule('<B>', ('<A>', 'b', '<C>')) c_rule = Rule('<C>', 'c') rule_set = [root_rule, a_rule, b_r...
StarcoderdataPython
8132898
"""Error definitions""" class DomainException(Exception): """Business Logic Error""" class FactoryError(DomainException): """Factory Error""" class RepositoryErorr(DomainException): """Repository Error"""
StarcoderdataPython
329865
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt import atexit import sys import argparse import os import types import time import builtins import platform import signal import shutil from . import VizTrac...
StarcoderdataPython
3537278
import os from flask_unchained import AppFactory, PROD app = AppFactory.create_app(os.getenv('FLASK_ENV', PROD))
StarcoderdataPython
6404085
"""App related urls.""" from django.urls import path from . import views app_name = "dnstools" urlpatterns = [ path('dnsrecords/<int:pk>/', views.DNSRecordDetailView.as_view(), name="dns_record_detail"), path('dnsrecords/autoconfig/<int:pk>/', views.AutoConfigRecordsStatusView.as_view(), ...
StarcoderdataPython
191359
from django.http.response import Http404 def http_404(request): raise Http404("Not found.")
StarcoderdataPython
12849857
import random import math import time import copy allstudents = [] class Student: def __init__(self,name,friends,robot=False): self.name = name self.__name__ = name self.robot = robot #self.friends = friends self.friends = friends self.currenttable = 0 allstudents.append(self) #########################...
StarcoderdataPython
9703603
<reponame>adobe-research/spark-gpu ########################################################################### # # Copyright (c) 2015 Adobe Systems Incorporated. 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. # ...
StarcoderdataPython
5082087
<reponame>earaujoassis/deployment # Version: 1.2 # -*- coding: utf-8 -*- import sys import os import json from deployment.utils import call, assert_step def receiver(project, oldrev, newrev, options={}): if not oldrev or not newrev: sys.stdout.write('> Missing revision code; skipping\n') sys.std...
StarcoderdataPython
11346254
from core.framework.module import StaticModule from core.utils.constants import Constants from core.utils.utils import Utils from core.utils.printer import Colors class Module(StaticModule): meta = { 'name': 'Code Checks', 'author': '@LanciniMarco (@MWRLabs)', 'description': "Sta...
StarcoderdataPython
9712944
<reponame>zmdismai/tcf #! /usr/bin/python2 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # """ Press and release buttons in the target --------------------------------------- """ import json import tc from . import msgid_c class extension(tc.target_extension_c): """ Extensi...
StarcoderdataPython
6645607
import pytest import leapp.messaging.answerstore from leapp.messaging.answerstore import AnswerStore, multiprocessing, _comment_out class MockManager(object): def __call__(self): return self @staticmethod def dict(*args): return dict(*args) class MockComponentKey1(object): value_ty...
StarcoderdataPython
5038274
from flask_melodramatiq import RabbitmqBroker broker = RabbitmqBroker(confirm_delivery=True) @broker.actor def process_job(user_id): print('*******************************') print('* Performing the process job. *') print('*******************************') @broker.actor def test_job(): print('******...
StarcoderdataPython
217430
<gh_stars>0 import markdown from django.db import models from material.models import MaterialCategory, MaterialTag, PostBaseInfo from base.utils import MARKDOWN_EXTENSIONS, MARKDOWN_EXTENSION_CONFIGS class MovieInfo(PostBaseInfo): """ 电影基本信息 """ directors = models.CharField(max_length=255, null=True,...
StarcoderdataPython
9750151
# Course related settings COURSE_PHOTO_THUMB_SIZE = (80, 80) COURSE_PHOTO_THUMB_QUALITY = 85 COURSE_PHOTO_THUMB_FORMAT = "JPEG" COURSE_RATING_WEIGHT = 10 COURSE_RATING_RANGE = 5 AVERAGE_COURSE_RATING = 3
StarcoderdataPython
3240296
import tkinter class EditPurchase(tkinter.Frame): def __init__(self, parent, App): self.application = App self.config = App.config super().__init__(parent) self.configure(bg="cyan") self.grid(row=0, column=0, sticky="nsew") parent.grid_rowconfigure(0, we...
StarcoderdataPython
11293506
<filename>tools/git-beautify.py # Copyright 2013 Google 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 # # Unless...
StarcoderdataPython
3522211
from sha3 import keccak_256 from .ecdsa import SigningKey from .ecdsa import SECP256k1 from .ecdsa.ellipticcurve import Point secp256k1n = 115792089237316195423570985008687907852837564279074904382605163141518161494337 def _tonelli_shanks(n, p): ''' A generic algorithm for computng modular square roots. ''' ...
StarcoderdataPython
3491288
<reponame>vitorfs/gitd from django.urls import path from gitd.core import views urlpatterns = [ path("__gitd__/github/", views.github, name="github"), ]
StarcoderdataPython
6627040
<filename>backend/alembic/versions/20200930112537_cf4962b43209_add_pipeline_table.py<gh_stars>1-10 """Add pipeline table Revision ID: cf4962b43209 Revises: <PASSWORD> Create Date: 2020-09-30 11:25:37.650804 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSONB # revisio...
StarcoderdataPython
118751
<filename>gameGap/urls.py from django.conf.urls import url from .api.views.entry_view import PostView from .api.views.entry_view import CommentView urlpatterns = [ url(r'^entries/$', PostView.as_view(), name="PostViewer"), url(r'^comments/$', CommentView.as_view(), name="CommentViewer") ]
StarcoderdataPython
162243
def print_formatted(number): binlen = len(str(bin(number))) - 2 for i in range(1, number+1): print("{0} {1} {2} {3}".format(str(i).rjust(binlen), str(oct(i))[1:].rjust(binlen), format(i, 'x').upper().rjust(binlen), bin(i)[2:].rjust(binlen)))
StarcoderdataPython
1882779
import copy layout = [] row_count = 0 column_count = 0 def run(): global layout global row_count global column_count ''' File input is a plain text file of lines where each line a row of characters representing foor (.) or seat L. ''' with open('input') as f: lines = f....
StarcoderdataPython