id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
4946701
<reponame>GSByeon/openhgsenti # -*- coding: utf-8 -*- # Generated by Django 1.11b1 on 2017-04-02 09:54 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('quots', '0004_auto_20170402_1...
StarcoderdataPython
8123546
<filename>team_9/cocos/cocos/actions/tiledgrid_actions.py # ---------------------------------------------------------------------------- # cocos2d # Copyright (c) 2008-2012 <NAME>, <NAME>, <NAME>, # <NAME> # Copyright (c) 2009-2019 <NAME>, <NAME> # All rights reserved. # # Redistribution and use in source and binary f...
StarcoderdataPython
5141841
<reponame>jbellogo/Hours-Log # Easy to use Google Sheets API import gspread # Required credentials for acessing private data as is Google Sheets from oauth2client.service_account import ServiceAccountCredentials # Full, permissive scope to access all of a user's files SCOPE = ['https://www.googleapis.com/auth/drive']...
StarcoderdataPython
251403
<reponame>mehrdad-shokri/retdec-regression-tests-framework """ A representation of a decompilation that has run. """ import os import re from regression_tests.parsers.fileinfo_output_parser import FileinfoOutput from regression_tests.tools.tool import Tool from regression_tests.utils import memoize from regressio...
StarcoderdataPython
5129668
""" Author: <NAME> Institute: Stony Brook University """ import torch.nn as nn from Layers.MRN_pytorch import * from Layers.DMTRL_pytorch import * from Layers.TAL_pytorch import * class SingleTaskModel(nn.Module): def __init__(self, hidden_feature, task_classes): super(SingleTaskModel, self).__i...
StarcoderdataPython
11351142
import os import json from oauth2client.service_account import ServiceAccountCredentials def get_github_credentials(): secret = os.environ.get("GH_SECRET") oauth_token = os.environ.get("GH_AUTH") return secret, oauth_token def get_telegram_credentials(): bot_token = os.environ.get("BOT_TOKEN") ch...
StarcoderdataPython
3203434
import json from os.path import join, dirname, abspath, isfile from core.devices.pixel import Pixel """ This module contains point clouds that can be used to construct PointCloud devices point cloud files should be json files in the same format as gl_server, eg [ {"point": [1,0,0]}, {"poin...
StarcoderdataPython
4931612
import numpy.core.numeric as _nx def array_split(ary, indices_or_sections, axis=0): """ Split an array into multiple sub-arrays. Please refer to the ``split`` documentation. The only difference between these functions is that ``array_split`` allows `indices_or_sections` to be an integer that does *...
StarcoderdataPython
3462642
from django.db import models from django.db.models import F from django.utils import timezone class Domain(models.Model): """ Model to represent hostnames and domains """ name = models.CharField(max_length=300, db_index=True) wildcard = models.BooleanField( default=False, help_text...
StarcoderdataPython
5187833
<filename>src/components/auth/model.py import mongoengine as me from flask_wtf import FlaskForm import wtforms as wf from wtforms.validators import DataRequired from flask_login import UserMixin class LoginForm(FlaskForm): username = wf.StringField( label="name", validators=[DataRequired("Username is requ...
StarcoderdataPython
8156747
<reponame>GlobalFishingWatch/ais-tools<filename>ais-stream/decode.py import json import base64 from config import load_config from ais_tools.aivdm import AIVDM decoder = AIVDM() def handle_event(event, context, pubsub_client): data_in = message_in = None try: config = load_config() data_in ...
StarcoderdataPython
343095
#!/usr/bin/env python import rospy import math import tf from geometry_msgs.msg import PoseStamped from styx_msgs.msg import Lane, Waypoint from std_msgs.msg import Int32 ''' This node will publish waypoints from the car's current position to some `x` distance ahead. As mentioned in the doc, you should ideally first...
StarcoderdataPython
1971695
<gh_stars>100-1000 import cea.plots.demand import cea.plots.cache import plotly.graph_objs as go from plotly.offline import plot import pandas as pd from cea.plots.variable_naming import NAMING, LOGO, COLOR __author__ = "<NAME>" __copyright__ = "Copyright 2018, Architecture and Building Systems - ETH Zurich" __cr...
StarcoderdataPython
6604217
import numpy as np import cv2 cap = cv2.VideoCapture(0) while True: _, frame = cap.read() cv2.circle(frame, (120, 150), 5, (0, 0, 255), -1) cv2.circle(frame, (530, 150), 5, (0, 0, 255), -1) cv2.circle(frame, (120, 340), 5, (0, 0, 255), -1) cv2.circle(frame, (530, 340), 5, (0, 0, 255), -1) pt...
StarcoderdataPython
11201475
#python exceptions let you deal with #unexpected results try: print(a) except: print('a is not defined!') #a is not defined, this will print #there are specific errors to help with cases try: print(a) except NameError: print('a is still not defined!') #also true, and will print except: pr...
StarcoderdataPython
353255
import time import numpy as np import tensorflow as tf from gcn.utils import * def evaluate(sess, model, features, support, labels, mask, placeholders): t_test = time.time() feed_dict_val = construct_feed_dict(features, support, labels, mask, placeholders) outs_val = sess.run([model.loss, model.accuracy]...
StarcoderdataPython
4941358
<reponame>gunnarvoet/rbrmoored """ Library for RBR data processing. """ __all__ = ["solo"] __version__ = "0.1.0" from . import solo
StarcoderdataPython
4942961
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # https://doc.scrapy.org/en/latest/topics/items.html import scrapy class SuperpowerItem(scrapy.Item): questions = scrapy.Field() votes = scrapy.Field()
StarcoderdataPython
6514412
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-08-14 15:08 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('message', '0004_auto_20170814_1754'), ...
StarcoderdataPython
6560806
<reponame>mefuller/ARC import arc.species.conformers import arc.species.converter import arc.species.species import arc.species.xyz_to_2d from arc.species.species import ARCSpecies
StarcoderdataPython
6658509
<reponame>verenich/time-prediction-benchmark case_id_col = {} activity_col = {} timestamp_col = {} label_col = {} pos_label = {} neg_label = {} dynamic_cat_cols = {} static_cat_cols = {} dynamic_num_cols = {} static_num_cols = {} filename = {} #### BPIC2011 settings #### dataset = "bpic2011" filename[dataset] = "log...
StarcoderdataPython
200220
<reponame>empymod/frequency-design import emg3d import empymod import numpy as np import ipywidgets as widgets import scipy.interpolate as si import matplotlib.pyplot as plt from IPython.display import display from scipy.signal import find_peaks # Define all errors we want to catch with the variable-checks and setting...
StarcoderdataPython
3490776
<reponame>Erotemic/hotspotter from numpy import asarray, percentile, uint8, uint16 import numpy as np from hotspotter.other.logger import logdbg, logwarn from PIL import Image, ImageOps ''' from skimage.util.dtype import dtype_range from skimage import exposure from skimage.morphology import disk from numpy import asa...
StarcoderdataPython
1674006
<gh_stars>10-100 # Basic training configuration file from torch.optim import SGD from torch.optim.lr_scheduler import MultiStepLR, ReduceLROnPlateau from torchvision.transforms import RandomVerticalFlip, RandomHorizontalFlip, RandomCrop from torchvision.transforms import ColorJitter, ToTensor from models.small_nasnet_a...
StarcoderdataPython
381333
"""Utility to train keras models. ---- Copyright 2019 Data Driven Empathy LLC 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,...
StarcoderdataPython
3478434
from django.db import models class Log(models.Model): name = models.CharField(max_length=500) country = models.CharField(max_length=500) email = models.CharField(max_length=500) requestdate = models.CharField(max_length=500) requestdeadline = models.IntegerField() apikeys = models.CharField(ma...
StarcoderdataPython
1758159
<reponame>ToucanToco/vue-query-builder from typing import Literal from pydantic import validator from weaverbird.pipeline.steps.utils.base import BaseStep class SimplifyStep(BaseStep): name: Literal['simplify'] = 'simplify' # All parts of the simplified geometry will be no more than this distance from the o...
StarcoderdataPython
397410
#!/usr/bin/env python import argparse import functools import io import logging import os import re import tarfile import tempfile from ruamel.yaml import YAML from ruamel.yaml.scalarstring import LiteralScalarString MAX_OUTPUT_SIZE = 24 * 1024 ERR_SUCCESS = 0 ERR_NOT_FOUND = 1 ERR_ALREADY_EXISTS = 2 ERR_FILE_TOO_L...
StarcoderdataPython
3335796
<filename>epab/exc.py # coding=utf-8 """ EPAB's exceptions """ class ExecutableNotFoundError(FileNotFoundError): """ Raised when an executable isn't found """
StarcoderdataPython
11384852
from time import sleep from src.utils.common.clear import clear from src.views.common.PersonDetail import printPerson from src.views.common.exitOrHome import exitOrHome from src.views.components.SearchBy import searchByEmail from src.views.components.SearchBy import searchByLastname from src.views.components.SearchBy...
StarcoderdataPython
96400
<filename>bin/state.py<gh_stars>0 #!/usr/bin/env python import re from energy import * if __name__ == "__main__": ph = 0.0 eh = 0.0 if len(sys.argv) > 1: cutoff = float(sys.argv[1]) else: cutoff = PW_PRINT_CUT lines = open("states").readlines() line = lines.pop(0) fields ...
StarcoderdataPython
3312695
<gh_stars>0 #!/usr/bin/python3 import pytest import logging import matplotlib.pyplot as plt import simtools.io_handler as io from simtools.model.telescope_model import TelescopeModel from simtools.camera_efficiency import CameraEfficiency from simtools.util.tests import ( has_db_connection, simtel_installed, ...
StarcoderdataPython
23852
#!/usr/bin/env python import argparse import os import platform import re import shutil import subprocess import sys SUPPORTED_VERSIONS = ('3.6', '3.7') IS_DEBIAN = platform.system() == 'Linux' and os.path.exists('/etc/debian_version') IS_OLD_UBUNTU = (IS_DEBIAN and os.path.exists('/etc/lsb-release') ...
StarcoderdataPython
1856676
<filename>heapSort.py ''' Heap Sort Implementation Input: [2,5,3,8,6,5,4,7] Output: [2,3,4,5,5,6,7,8] ''' def heapify(ls, n, i): largest = i l = 2 * i + 1 r = 2 * i + 2 if l < n and ls[i] < ls[l]: largest = l if r < n and ls[largest] < ls[r]: largest = r if largest != i: ls[i]...
StarcoderdataPython
4855514
from __future__ import annotations import typing as tp import configparser import os from pathlib import Path DEFAULT_LOGSTORE_DIR = f"{os.getcwd()}/.logexp" class Settings: @classmethod def _get_default_dict(cls) -> tp.Dict: default_dict = { "logexp": { "module": "", ...
StarcoderdataPython
3443174
from django.urls import path from django.conf import settings from django.conf.urls.static import static from . import views urlpatterns=[ path('',views.home,name='home'), path('project/review/<project_id>',views.project_review,name='project_review'), path('search/',views.search_project, name='search...
StarcoderdataPython
3446151
from django.conf.urls import url from django.contrib import admin from gallery.views import PhotoListView import gallery.views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', PhotoListView.as_view(), name='homepage'), url(r'^ajax/like/photo/(?P<pid>[-\d]+)/value/(?P<val>-?[-\d]+)/$', ...
StarcoderdataPython
6665844
<reponame>timgates42/dlint<filename>tests/test_bad_yaml_use.py #!/usr/bin/env python from __future__ import ( absolute_import, division, print_function, unicode_literals, ) import unittest import dlint class TestBadYAMLUse(dlint.test.base.BaseTest): def test_bad_yaml_usage(self): pytho...
StarcoderdataPython
11355102
<reponame>rjcc/bioinformatics_algorithms<filename>frequent_words_with_mismatches.py from computing_frequencies_with_mismatches import computing_frequencies_with_mismatches from number_to_pattern import number_to_pattern def frequent_words_with_mismatches(text, k, d): frequent_patterns = [] frequency_array = comput...
StarcoderdataPython
1934276
<filename>workbench/random_ge_one.py #!/usr/bin/env python3 """random_ge_one.py Add up uniformly distributed random numbers between zero and one, counting how many you need to have your sum >= 1. An interesting thing happens if you do this n times and take the average (for large values of n)... See explanation here,...
StarcoderdataPython
3365985
''' Tests for PDP Instance class. ''' from models import PDPInstance, Point # generate dummy points points = [ Point(0, 1, 1), Point(1, 1, 2), Point(2, 1, 4) ] # dummy instance instance = PDPInstance(1, points) def test_matrix(): ''' Test distances matrix generation. ''' matrix = [ ...
StarcoderdataPython
11266806
# Copyright 2013-2022 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 import * class RGraph(RPackage): """A package to handle graph data structures. A package that imp...
StarcoderdataPython
4859290
# Repository: https://gitlab.com/quantify-os/quantify-scheduler # Licensed according to the LICENCE file on the master branch # pylint: disable=missing-module-docstring # pylint: disable=missing-class-docstring # pylint: disable=missing-function-docstring # pylint: disable=redefined-outer-name # pylint: disable=unused-...
StarcoderdataPython
3562977
# Quantopian, Inc. licenses this file to you under the Apache License, Version # 2.0 (the "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
StarcoderdataPython
3463920
# https://leetcode.com/problems/remove-duplicate-letters/ class Solution: def removeDuplicateLetters(self, s: str) -> str: char_stack, covered_chars, last_idx_of_char = list(), set(), dict() for idx, char in enumerate(s): last_idx_of_char[char] = idx for idx, char in enumerate(s...
StarcoderdataPython
296493
#!/usr/bin/env python """ run as `python -O level_10.py` to disable debug garbage """ from itertools import cycle, islice input = [106, 16, 254, 226, 55, 2, 1, 166, 177, 247, 93, 0, 255, 228, 60, 36] indata = list(range(0, 256)) # Test data # input = [1, 2, 3] # indata = list(range(0, 256)) skip = 0 def rotlist(l...
StarcoderdataPython
11258699
# apis_v1/documentation_source/organization_search_doc.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- def organization_search_doc_template_values(url_root): """ Show documentation about organizationSearch """ required_query_parameter_list = [ { 'name': 'vo...
StarcoderdataPython
12860487
<gh_stars>10-100 import unittest from mock import patch from starter.starter_AdminEmail import starter_AdminEmail from tests.activity.classes_mock import FakeLogger from tests.classes_mock import FakeLayer1 import tests.settings_mock as settings_mock class TestStarterAdminEmail(unittest.TestCase): def setUp(self)...
StarcoderdataPython
3346441
from Lixadeira import Lixadeira from src.Furadeira import Furadeira estoque = [] def mostramenu(): print(''' ________________________________ | LOJA DE FERRAMENTAS | | Menu | | 0 - Sair | | 1 - Cadastrar | -----------------------------...
StarcoderdataPython
1868858
<gh_stars>0 import os from commons.config.settings import * # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] INSTALLED_APPS.remove('django_extensions') # Application definition INSTALLED_APPS += [] ROOT_URLCONF = 'commons.config.urls' REST_FRAMEWORK = { 'DEFA...
StarcoderdataPython
6449177
#!/usr/bin/env python # simple Python test program (printmess.py) from __future__ import print_function print('test message')
StarcoderdataPython
1838537
import json import copy import pyblish.api from openpype.lib import get_subset_name_with_asset_doc from openpype.pipeline import legacy_io class CollectRenderScene(pyblish.api.ContextPlugin): """Collect instance which renders whole scene in PNG. Creates instance with family 'renderScene' which will have all...
StarcoderdataPython
4945485
#! /usr/bin/env python3 import argparse, build_utils, common, os, sys, shutil, package def main() -> int: jars = package.main() os.chdir(common.basedir) for jar in jars: build_utils.deploy(jar, tempdir = "target/deploy") return build_utils.release() if __name__ == "__main__": sys.exit(main())
StarcoderdataPython
6588140
<filename>project/forms.py from django import forms from .models import Profile, Post, Rating class ProfileForm(forms.ModelForm): class Meta: model = Profile exclude=["user"] class PostForm(forms.ModelForm): class Meta: model = Post exclude = [] class RatingsForm(forms.ModelForm...
StarcoderdataPython
6445900
<gh_stars>1-10 """ Adapted from https://github.com/kuangliu/pytorch-fpn/blob/master/fpn.py """ from torch import nn from models import register_model from models.backbone.resnet import GroupnormBackbone, BottleneckGroup import torch.nn.functional as F @register_model("fpn_pareto") class FpnMultiHead(GroupnormBackbone...
StarcoderdataPython
382173
""" This module contains unit tests, for the most important functions of ruspy.estimation.estimation_cost_parameters. The values to compare the results with are saved in resources/estimation_test. The setting of the test is documented in the inputs section in test module. """ import numpy as np import pytest from numpy...
StarcoderdataPython
1731074
<reponame>discardthree/PyQPECgen<filename>qpecgen/box.py # pylint: disable=unused-variable # # qpecgen/box.py # # Copyright (c) 2016 <NAME> # # This software is released under the MIT License. # # http://opensource.org/licenses/mit-license.php # from __future__ import absolute_import from cvxopt import matrix from qp...
StarcoderdataPython
1775622
from controllers.main_controller import MainController class MainMenu: OPTION_MENU = { '1': "show_members", '2': "available_slots" } @classmethod def default_method(cls, *args, **kwargs): print('Help menu!') @classmethod def show_options(csl, current_user): ...
StarcoderdataPython
9694489
# __init__.py from .regression import Regression from .classification import Classification
StarcoderdataPython
9712663
"""Constants. """ # A constant value used to avoid division by zero, zero logarithms # and any possible mathematical error EPSILON = 1e-10
StarcoderdataPython
97124
<reponame>J-Obog/market-simulator from flask import request, jsonify from app import db, bcrypt, cache, jwt from api.accounts.model import Account, AccountSchema from flask_jwt_extended import create_access_token, create_refresh_token, jwt_required, current_user from datetime import timedelta @jwt.token_in_blocklist_l...
StarcoderdataPython
3344848
<reponame>hyu-iot/gem5 #!/usr/bin/env python # Copyright (c) 2020 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a ...
StarcoderdataPython
293045
<reponame>suwoongleekor/DRS #!/usr/bin/env python # coding: utf-8 # # Author: <NAME> # URL: https://kazuto1011.github.io # Date: 07 January 2019 from __future__ import absolute_import, division, print_function import random import os import argparse import cv2 import time import numpy as np import torch import ...
StarcoderdataPython
12827530
<filename>docsim/utils/text.py from collections import Counter import re from typing import List, Pattern, Set from nltk.corpus import stopwords from nltk.tokenize import word_tokenize pat_token_non_alphabet: Pattern = re.compile('^[^a-z]+$') stop_words: Set[str] = set(stopwords.words('english')) def tokenize(text...
StarcoderdataPython
6491674
class Solution: def nextPermutation(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ N = len(nums) if N <= 1: return index = N -2 while index >= 0 and nums[index] >= nums[index+1]: index -= ...
StarcoderdataPython
1720256
<gh_stars>0 # Copyright 2015 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 required by applicab...
StarcoderdataPython
6580221
<filename>util/filter_buscos.py #!/usr/bin/env python #script to reformat Augustus BUSCO results import sys, os, itertools if len(sys.argv) < 4: print("Usage: filter_buscos.py busco.evm.gff3 full_table_species busco.final.gff3") sys.exit(1) def group_separator(line): return line=='\n' #parse the busco t...
StarcoderdataPython
46838
<reponame>vidma/kensu-py # coding: utf-8 """ No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: beta Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iterit...
StarcoderdataPython
3201518
# Copyright 2010 New Relic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
StarcoderdataPython
347405
<filename>enum2magic.py #!/usr/bin/python # # @author: <NAME> # @version: 1.9.5 # @date: 2015-01-29 import sys class Parser(object): """ This parser converts C-Enum syntax to Magic Number syntax""" IDLE = 0 BEGIN_HEADER = 1 PARSING_HEADER = 2 BEGIN_ENUM = 3 PARSING_ENUM = 4 ...
StarcoderdataPython
5080085
#Part of Guess the Book project by <NAME>. MIT Licence 2019. # https://github.com/dmitry-dereshev/guess-the-book-public #The script takes in a top-level folder with .txt files, and transforms #them into a Pandas DataFrame of symbol frequencies. The DataFrame is #then saves as a .csv. import pandas as pd impor...
StarcoderdataPython
8035197
import os import sys import time sys.path.append('../DDSP/') from DDSP import DDSP if __name__ == '__main__': ddsp = DDSP(sys.argv[1], sys.argv[2]) time.sleep(3) ddsp.addContent(b'123456789012345678901234567890123456789012345678901234567890abcd') time.sleep(10) print ("Reached the end of Publisher....
StarcoderdataPython
1802278
<reponame>atombrella/auditwheel<gh_stars>0 from subprocess import check_call, check_output, CalledProcessError import pytest import os import os.path as op import tempfile import shutil import warnings from distutils.spawn import find_executable VERBOSE = True ENCODING = 'utf-8' MANYLINUX_IMAGE_ID = 'quay.io/pypa/many...
StarcoderdataPython
9638437
<reponame>webbjj/clustertools """ Generic recipes for making key calculations """ __author__ = "<NAME>" __all__ = [ 'nbinmaker', "binmaker", 'roaming_nbinmaker', "roaming_binmaker", "power_law_distribution_function", "dx_function", "tapered_dx_function", "x_hist", "mean_prof", "...
StarcoderdataPython
301437
<reponame>Mario-Kart-Felix/poemexe #!/usr/bin/env python3 import argparse import codecs import json import os import re import sys from glob import glob OUTPUT_FILENAME = '../model/verses.json' RE_CONTAINS_URL = re.compile('https?://') RE_WEAK_LINE = re.compile(' (and|by|from|is|of|that|the|with)\\n', ...
StarcoderdataPython
292578
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2018-03-10 12:27 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 = [ ('blog', '0002_auto_20180310...
StarcoderdataPython
1627830
<gh_stars>10-100 # coding=utf-8 import octoprint.plugin import octoprint.filemanager import octoprint.filemanager.util from octoprint.util.comm import strip_comment class CommentStripper(octoprint.filemanager.util.LineProcessorStream): def process_line(self, line): line = strip_comment(line).strip() if not len(...
StarcoderdataPython
3289787
from functools import partial from plenum.common.messages.node_messages import ViewChangeStartMessage from plenum.test.delayers import msg_rep_delay from plenum.test.helper import sdk_send_random_and_check, assertExp, waitForViewChange from plenum.test import waits from plenum.test.node_catchup.helper import waitNod...
StarcoderdataPython
6486810
<gh_stars>1-10 # -*- coding:utf-8 -*- """ @author:SiriYang @file: Result.py @time: 2019.12.25 12:43 @updateTime: 2021-02-06 20:28:06 @codeLines: 46 """ class ResultEnum(object): """ 返回结果枚举类型,积极结果使用偶数代码,消极结果使用奇数代码。 """ # 基础 UNKNOW_ERROR = (99999, "Unknow error") SUCCESS = (0, "Success") FAULT = (1, "Fault") ...
StarcoderdataPython
9612907
<reponame>kyleect/vom from selenium import webdriver from vom import ViewDriver if __name__ == '__main__': options = webdriver.ChromeOptions() options.add_argument("--headless") driver = ViewDriver(webdriver.Chrome(chrome_options=options)) driver.get("http://example.com") page = driver.find_eleme...
StarcoderdataPython
6693889
# Program based on Reverse of 4 digit numbers import math n = int(input("Enter numbers: ")) a = n%10 b = math.floor(n/10) b1 = b%10 c = math.floor(n/100) c1 = c%10 d = math.floor(n/1000) print(a*1000+b1*100+c1*10+d)
StarcoderdataPython
3458076
<filename>PyPtero/__init__.py from . import Sync
StarcoderdataPython
237006
<filename>plugins/geometry/crop.py import itk import medipy.itk def crop(input, index, shape): """ Return a sub-image from the input image, starting at index and with given shape. <gui> <item name="input" type="Image" label="Input"/> <item name="index" type="Coordi...
StarcoderdataPython
9667813
""" Author: <NAME> Email: <EMAIL> Description: Item/Product quantity functions Interfacing with Open Cart API """ from decorators import authenticated_opencart, get_only from utils import oc_requests, sync_info from datetime import datetime from frappe.utils import get_files_path, flt, cint import frappe, json, os, tra...
StarcoderdataPython
6593344
 from translator_pkg.config import Config from translator_pkg.excel_helper import ExcelHelper from translator_pkg.excel_json_helper import ExcelJsonHelper import sys def close(): sys.exit(2) #CONSTANS EVENTS_LABEL_LIST=["events"] # special process for events section in excel file OBSERVATIONS_LABEL="observatio...
StarcoderdataPython
1623193
<filename>visionpy/__init__.py from visionpy.vision import Vision from visionpy.vision import Contract from visionpy.async_vision import AsyncVision from visionpy.async_contract import AsyncContract VS = 1_000_000 vdt = 1
StarcoderdataPython
370350
<filename>preprocess_VisualGenome.py #! -*- coding: utf-8 -*- # 使用Resnet101提取区域特征 # 注:部分区域图片有问题,需要额外处理 import os import cv2 import json import numpy as np from PIL import Image from tqdm import tqdm import matplotlib.pyplot as plt from bert4keras.backend import keras, K # 图像模型 preprocessing_image = keras.preprocessi...
StarcoderdataPython
12821975
"""Utility functions for sleep/wake detection algorithms.""" from typing import Optional import numpy as np from typing_extensions import Literal EPOCH_LENGTH = Literal[30, 60] def rescore(predictions: np.ndarray, epoch_length: Optional[EPOCH_LENGTH] = 30) -> np.ndarray: """Apply Webster's rescoring rules to s...
StarcoderdataPython
6591413
<filename>adapter/debugger.py import sys import lldb import codelldb from value import Value def evaluate(expr, unwrap=False): exec_context = lldb.SBExecutionContext(lldb.frame) value = codelldb.evaluate_in_context(expr, True, exec_context) return Value.unwrap(value) if unwrap else value def wrap(obj): ...
StarcoderdataPython
1787353
<reponame>cmayes/md_utils #!/usr/bin/env python """ Given a file with columns of data (comma or space separated): return a file that has lines filtered by specified min and max values """ from __future__ import print_function import argparse import os import sys import numpy as np from md_utils.md_common import (Inva...
StarcoderdataPython
9697608
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
StarcoderdataPython
3303163
<reponame>bhrevol/afesta-tools """Tests for the vcs module."""
StarcoderdataPython
172360
<reponame>will-fawcett/trackerSW<filename>tracker-visual/geant_fullsim_field.py # WJF add: parse args import argparse parser = argparse.ArgumentParser() parser.add_argument('--geo', type=str, default=None, help='specify compact file for the geometry') args, _ = parser.parse_known_args() from Gaudi.Configuration imp...
StarcoderdataPython
193247
"""empty message Revision ID: 5ae213c6353 Revises: 3c73f5517a2 Create Date: 2015-07-01 16:08:50.298141 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '3c73f5517a2' from alembic import op import sqlalchemy as sa def upgrade(): op.drop_index('ix_pictures_path_to_image') op.d...
StarcoderdataPython
11387360
import wpilib import wpilib.drive ENCODER_ROTATION = 1023 WHEEL_DIAMETER = 7.639 SARAH_MULTIPLIER = 0.5 class Drive: drivetrain = wpilib.drive.DifferentialDrive def __init__(self): self.enabled = False def on_enable(self): self.y = 0 self.rotation = 0 # Verb functions -- t...
StarcoderdataPython
8176954
from typing import Optional import colorful as cf from kolga.utils.models import SubprocessResult class Logger: """ Class for logging of events in the DevOps pipeline """ def _create_message(self, message: str, icon: Optional[str] = None) -> str: icon_string = f"{icon} " if icon else "" ...
StarcoderdataPython
3271217
<filename>World Finals/gallery-of-pillars.py # Copyright (c) 2019 kamyu. All rights reserved. # # Google Code Jam 2016 World Finals - Problem C. Gallery of Pillars # https://code.google.com/codejam/contest/7234486/dashboard#s=p2 # # Time: O(NlogN) # Space: O(M) # from math import sqrt def count(side_len, r_square): ...
StarcoderdataPython
71914
from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * import traceback, sys import logging # Make this threadsafe class QtHandler(logging.Handler): def __init__(self, output_widget: QTextEdit): logging.Handler.__init__(self) self.widget: QTextEdit = output_widget ...
StarcoderdataPython
3245193
from SQLiteExperiment import SQLiteExperiment #class MyExperiment(SQLiteExperiment): # def __init__(self): # inputs = ['alpha','beta','gamma'] # outputs = ['a','b','c'] # super().__init__(inputs,outputs,overwrite = True) compute = lambda v: { 'a': -v['alpha']-2*v['beta']-2*v['gamma']+6, ...
StarcoderdataPython
8053807
<gh_stars>0 # Import all the necessary libraries import os import datetime import glob import random import sys import matplotlib.pyplot as plt import skimage.io #Used for imshow function import skimage.transform #Used for resize function from skimage.mo...
StarcoderdataPython