id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
1716385
<reponame>zhongtianxie/fm-orchestrator # -*- coding: utf-8 -*- # SPDX-License-Identifier: MIT from __future__ import absolute_import from datetime import datetime import pytest from module_build_service.common.config import conf from module_build_service.common.models import ModuleBuild from module_build_service.comm...
StarcoderdataPython
1638799
# here entry point import http.server
StarcoderdataPython
1756597
<reponame>rlowrance/mlpack '''module for squared loss, with adjustments for min and max label values''' import unittest import pdb def squared_vw(): '''return squared error squashed for label values, as a scalar''' def output(prediction, label, min_label, max_label): '''ARGS all scalars numbers''' ...
StarcoderdataPython
38169
# Copyright 2013 Google Inc. All Rights Reserved. """Provide commands for managing SSL certificates of Cloud SQL instances.""" from googlecloudsdk.calliope import base class SslCerts(base.Group): """Provide commands for managing SSL certificates of Cloud SQL instances. Provide commands for managing SSL certif...
StarcoderdataPython
165961
# This file is a part of Arjuna # Copyright 2015-2021 <NAME> # Website: www.RahulVerma.net # 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 # U...
StarcoderdataPython
3228313
<filename>EnrollmentStation/Binaries/YubikeyManager/pymodules/fido2/nfc.py<gh_stars>1-10 # Copyright (c) 2019 Yubico AB # Copyright (c) 2019 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions a...
StarcoderdataPython
3300322
<filename>sim/faas/scaling.py import logging import math import numpy as np from sim.core import Environment from sim.faas import FaasSystem, FunctionState, FunctionDeployment logger = logging.getLogger(__name__) def faas_idler(env: Environment, inactivity_duration=300, reconcile_interval=30): """ https://...
StarcoderdataPython
3276676
<filename>lantz/lantz/drivers/dli/webpowerswitch7.py from lantz import Driver, Action, Feat, DictFeat, ureg import requests import re class WebPowerSwitch7(Driver): timeout = 1 def __init__(self, host='192.168.1.20:80', user='admin', pwd='<PASSWORD>', *args, **kwargs): self.host, self.user, self.pwd = host, user,...
StarcoderdataPython
1784145
load("@wix_oss_infra//dependencies/test_network_sandboxing:download_network_sandboxing.bzl", "download_network_sandboxing_according_to_os") def test_network_sandboxing(): if native.existing_rule("test_network_sandboxing") == None: download_network_sandboxing_according_to_os(name = "test_network_sandboxing")
StarcoderdataPython
3317187
{ 'name': 'Tests', 'category': 'Hidden', 'description': """ OpenERP Web test suite. ======================= """, 'version': '2.0', 'depends': [], 'js': ['static/src/js/*.js'], 'css': ['static/src/css/*.css'], 'auto_install': True, }
StarcoderdataPython
185500
import json import tweepy from tweepy import OAuthHandler from collections import Counter from prettytable import PrettyTable from operator import itemgetter # Replace these values with our own twitter app settings CONSUMER_KEY = '1234xyz' CONSUMER_SECRET = '1234xyz' OAUTH_TOKEN = '<KEY>' OAUTH_TOKEN_SECRET = '1234xy...
StarcoderdataPython
1729363
<reponame>matan1008/armulator<filename>armulator/armv6/opcodes/abstract_opcodes/sel.py from armulator.armv6.opcodes.abstract_opcode import AbstractOpcode class Sel(AbstractOpcode): def __init__(self, m, d, n): super(Sel, self).__init__() self.m = m self.d = d self.n = n def ex...
StarcoderdataPython
1765843
from pymongo import MongoClient import psycopg2 from pprint import pprint import os class MongoDbConnection: def __init__(self): self.mongo() def mongo(self): try: if os.environ['OUTSIDE_NETWORK'] == '1': self.host = 'localhost' self.port = 5550 ...
StarcoderdataPython
3363868
<filename>tests/test_registry.py # coding: utf-8 from __future__ import absolute_import, unicode_literals def test_should_register_a_state_machine(): from statemachine import StateMachine, State, registry class CampaignMachine(StateMachine): "A workflow machine" draft = State('Draft', initial...
StarcoderdataPython
1786507
<gh_stars>10-100 """Replacement for Django's syncdb command.""" from __future__ import unicode_literals from django.conf import settings from django.core.management import call_command from django.core.management.base import CommandError from django.utils.translation import ugettext as _ try: from django.core.ma...
StarcoderdataPython
1655493
from collections import defaultdict class Region(object): """ Represents a region inside a Corpus. """ def __init__(self, corpus, start, length): self._corpus = corpus self._start = start self._text = corpus._text[start:start + length] def __repr__(self): return "R...
StarcoderdataPython
3285491
"""Model definitions.""" from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class User(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(80), unique=True) # username = db.Column(db.String(80), unique=True, nullable=False) # email = db.Column(db.String(120), un...
StarcoderdataPython
1670927
from output.models.nist_data.atomic.unsigned_byte.schema_instance.nistschema_sv_iv_atomic_unsigned_byte_enumeration_5_xsd.nistschema_sv_iv_atomic_unsigned_byte_enumeration_5 import ( NistschemaSvIvAtomicUnsignedByteEnumeration5, NistschemaSvIvAtomicUnsignedByteEnumeration5Type, ) __all__ = [ "NistschemaSvI...
StarcoderdataPython
160455
<gh_stars>0 # Copyright (c) 2016, 2017 <NAME> # MIT License # 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, modif...
StarcoderdataPython
3216117
class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None ''' The binary tree in this example is shown as follow 1 / \ 2 3 / \ / 4 5 6 / 7 in-order traversal: 4 2 7 5 1 6 3 ''' def inorder_traversal_by_recursion(root)...
StarcoderdataPython
3228987
#------------------------------------------------------------------------------- # SiloFileIO #------------------------------------------------------------------------------- from PYB11Generator import * from FileIO import * from FileIOAbstractMethods import * from FileIOTemplateMethods import * from spheralDimensions ...
StarcoderdataPython
3234657
import json try: from urllib.parse import urlencode # noqa: F401 except ImportError: from urllib import urlencode # noqa: F401 from keycloakclient.mixins import WellKnownMixin PATH_WELL_KNOWN = "auth/realms/{}/.well-known/uma-configuration" class KeycloakUMA1(WellKnownMixin, object): DEFAULT_HEADERS ...
StarcoderdataPython
1740081
#!/usr/bin/env python3 '''__main__.py''' # Internal Libraries import os import sys import tempfile from shutil import rmtree version = '21w11a dev' def file_type(file: str) -> str: if(not os.path.isfile(file)): print('Auto-Editor could not find the file: ' + file, file=sys.stderr) sys.exit(1) ...
StarcoderdataPython
3300117
# Copyright The PyTorch Lightning team. # # 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 i...
StarcoderdataPython
82828
# Copyright 2016 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 applicable law or ag...
StarcoderdataPython
3329374
import torch from torch import nn, optim import json from .data_loader import SentenceRELoader, BagRELoader from .utils import AverageMeter from tqdm import tqdm import sys sys.path.append("..") import HiCLRE.hiclre.framework.data_loader as data_load_py from transformers import BertModel, BertTokenizer from scipy.spati...
StarcoderdataPython
159065
<gh_stars>0 """文字列基礎 文字関連の判定メソッド 英字であるかを判定する isalpha [説明ページ] https://tech.nkhn37.net/python-isxxxxx/#_isalpha """ print('=== isalpha ===') print('abcdefgh'.isalpha()) print('abc12345'.isalpha())
StarcoderdataPython
94343
<gh_stars>0 import pprint as pp import airflow.utils.dates from airflow import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.dummy_operator import DummyOperator from datetime import datetime, timedelta default_args = { "owner": "airflow", "start_date": airflow.uti...
StarcoderdataPython
1675534
from tkinter import * import time # from PIL import Image window = Tk() window.title("Veginner") def next_level_pollo(): btn_pollo.destroy() btn_pesco.destroy() btn_lacto_ovo.destroy() btn_ovo.destroy() btn_vegan.destroy() new_menu() def press_next(): btn_open_menu.destroy() ...
StarcoderdataPython
1632468
<gh_stars>0 from functools import total_ordering from typing import Optional @total_ordering class HierarchyLevel: paragraph = "paragraph" raw_text = "raw_text" list_item = "list_item" root = "root" def __init__(self, level_1: Optional[int], level_2: Optional[int...
StarcoderdataPython
19723
import math a = float(input('insira um valor')) print('a porção inteira do valor {} é {}'.format(a,math.trunc(a)))
StarcoderdataPython
3304808
<reponame>jonomango/advent-of-code-2021 import math import copy from functools import reduce arr = [] with open("input.txt", "r") as file: # iterate over every line in a file for line in file.read().strip().split("\n"): arr.append(line) def freq(arr): f = [0 for _ in range(len(arr[0]))] for line in arr: ...
StarcoderdataPython
3275557
#!/usr/bin/python import os, sys, getopt from shutil import copyfile def main(game_directory): colors = [] with open(game_directory + 'assets/color_palette.csv') as f: lines = f.readlines() for line in lines[1:]: parts = line.rstrip().split(',') for color in parts[1:]: ...
StarcoderdataPython
48586
import argparse import configparser import json import logging.config import time import urllib.parse import urllib.request import yaml ###################################################################################################### # Parse command line. ##########################################################...
StarcoderdataPython
4807105
from __future__ import unicode_literals import os import json from flask import Blueprint, render_template, url_for, redirect, current_app, jsonify, flash, request from flask_login import current_user, login_required from app import db from app.models import EditableHTML, OralHistory, WikipediaSuggest, Entity, EntityM...
StarcoderdataPython
182896
# CAR_2016_03_002: Create Remote Process via WMIC # Adversaries may use Windows Management Instrumentation (WMI) to move laterally, # by launching executables remotely. The analytic CAR-2014-12-001: Remotely # Launched Executables via WMI describes how to detect these processes with # network traffic monitoring and pr...
StarcoderdataPython
3344799
<reponame>mcarun123/airworkflowtest-action import os import sys from pathlib import Path from typing import Dict from ruamel.yaml import YAML import src.util.file as file def load_yaml(path: Path) -> Dict: yaml = YAML(typ="safe").load(path) assert isinstance(yaml, dict) return yaml # working_path = en...
StarcoderdataPython
3264841
<filename>influxdb_sync/cli.py # -*- coding: utf-8 -*- """Console script for influxdb_sync.""" import sys import click import functools import asyncio from aioinflux import InfluxDBClient from . import sync def async_cli(f): def wrapper(*args, **kwargs): loop = asyncio.get_event_loop() return l...
StarcoderdataPython
3336124
<gh_stars>10-100 import numpy as np import torch L = 4 idx = np.arange(L ** 2).reshape((L, L)) checker_idx = idx.copy() checker_idx[1::2] = np.roll(idx[1::2], -1, axis=-1) print('original') print(idx) print('checker') print(checker_idx) # even columns # NB: ravel works as in pytorch, 'C' row-major, C-style order, la...
StarcoderdataPython
192956
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import warnings warnings.filterwarnings("ignore") import yfinance as yf yf.pdr_override() import datetime as dt symbol = 'AMD' market = 'SPY' num_of_years = 1 start = dt.date.today() - dt.timedelta(days=365*num_of_years) end...
StarcoderdataPython
1739883
from abc import ABCMeta, abstractmethod from typing import Optional from .base_device import Device from smart_home_hub.utils.config import Config class ContextDevice(Device, metaclass=ABCMeta): """ A Device class that makes use of the current context (aka state of command history) to perform and show av...
StarcoderdataPython
10220
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from .acquisition import AcquisitionFunction from .analytic import ( AnalyticAcquisitionFunction, ConstrainedExpectedImprovement, ExpectedImprovement, NoisyExpectedImprovement, PosteriorMean, Probabil...
StarcoderdataPython
3397044
<gh_stars>1-10 import requests import pandas as pd from datetime import date, timedelta # This script is to be run after get_csv.py # Setting global variables for today and yesterday yesterday = date.today() - timedelta(days=1) today = date.today() # Makes a request to get the url of the most recent data def get_da...
StarcoderdataPython
26714
from datetime import datetime, date from marqeta.response_models.address_response_model import AddressResponseModel from marqeta.response_models.identification_response_model import IdentificationResponseModel from marqeta.response_models import datetime_object import json import re class BusinessProprietorResponseMod...
StarcoderdataPython
34402
# -*- coding: utf-8 -*- # SPDX-License-Identifier: MIT from __future__ import absolute_import, print_function, unicode_literals import os import shutil try: from unittest.mock import MagicMock except ImportError: from mock import MagicMock import uuid from ddt import ddt as DataDrivenTestCase, data as ddt_da...
StarcoderdataPython
49392
<reponame>siddharthtelang/Face-and-Pose-Classification from sklearn.decomposition import PCA import matplotlib.pyplot as plt import numpy as np def get_min_dimensions(flattened): pca = PCA().fit(flattened) # plt.figure() # plt.title('PCA') # plt.xlabel('Dimensions') # plt.ylabel('Variance Retention...
StarcoderdataPython
4800169
import time from .sensor import Sensor from board import SCL, SDA import busio from adafruit_seesaw.seesaw import Seesaw class SoilSensor(Sensor): def __init__(self, pin, name = 'SoilSensor', key = None): super().__init__(pin, name = name, key = key) return def init_sensor...
StarcoderdataPython
2954
""" Day 1 Main Module """ from day01 import parse_input, part1, part2 if __name__ == "__main__": # trying out the new walrus[:=] oprtr in python if (part := int(input("Enter Part: "))) == 1: print(part1(parse_input("input.txt"))) elif part == 2: print(part2(parse_input("input.txt"))) e...
StarcoderdataPython
3370205
<reponame>insarwxw/PySAR #! /usr/bin/env python2 ############################################################ # Program is part of PySAR v1.0 # # Copyright(c) 2016, <NAME> # # Author: <NAME> # #######################################...
StarcoderdataPython
3284712
<filename>sdn_controller/TE/te_controller.py<gh_stars>1-10 # Copyright (C) 2017 <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/LICENS...
StarcoderdataPython
4839163
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, print_function, unicode_literals, absolute_import """ This module implements classes for reading and generating Lammps inputset. For the ease of management we divide LAMMPS in...
StarcoderdataPython
1722067
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-11-09 18:42 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import tinymce.models import versatileimagefield.fields class Migration(migrations.Migration): ...
StarcoderdataPython
3231275
<reponame>TareqNewazShahriar/raspberry-pi-pico-codes from machine import Pin, PWM from libraries.nec import NEC_16 from time import sleep remote_control_buttons = { 0x45: 'POWER', 0x15: '-', 0x09: '+' } opto_4n35 = ADC(2) # read AC current optocoupler_moc3052 = PWM(Pin(16)) # OUT optocoupler_moc3052.freq(...
StarcoderdataPython
4808147
<filename>bugbuster/cmd/__init__.py import sys from oslo.config import cfg from bugbuster.utils import gerrit CONF = cfg.CONF opts = [ cfg.StrOpt('exceptions', default='./exceptions.txt', help='Exceptions file'), ] CONF.register_opts(opts) EXCEPTIONS = ["128497"] def main(): ...
StarcoderdataPython
3320742
<filename>lib/oeqa/runtime/cases/rubygems_rubygems_aws_sdk_elasticloadbalancing.py from rubygems_utils import RubyGemsTestUtils class RubyGemsTestrubygems_aws_sdk_elasticloadbalancing(RubyGemsTestUtils): def test_gem_list_rubygems_aws_sdk_elasticloadbalancing(self): self.gem_is_installed("aws-sdk-elasticl...
StarcoderdataPython
164065
<filename>tests/multirun/test_basic_serial.py import os import shutil import glob import pytest from ipsframework import Framework def copy_config_and_replace(infile, srcdir, tmpdir): with open(os.path.join(srcdir, infile), "r") as fin: with open(os.path.join(tmpdir, infile), "w") as fout: for...
StarcoderdataPython
103349
from typing import Dict from django.http import HttpRequest from klanad.models import KlanadTranslations def footer_processor(request: HttpRequest) -> Dict[str, str]: """Add the footer email me message to the context of all templates since the footer is included everywhere.""" try: message = KlanadT...
StarcoderdataPython
1797204
<reponame>TGoldR/internationalize<filename>easymode/utils/__init__.py """ Contains utils for: Matching first item in a list that matches some predicate. Mutex XML parser/generator that handles unknown entities. Controlling recursion depth """ import errno import os import threading import time import urlparse import u...
StarcoderdataPython
3216599
import os, sys from wptserve.utils import isomorphic_decode import importlib subresource = importlib.import_module("common.security-features.subresource.subresource") def generate_payload(request, server_data): file = os.path.join(request.doc_root, u"media", u"movie_5.ogv") return open(file, "rb").read() def...
StarcoderdataPython
125830
import model import time def izpis_igre(igra): konec_igre = model.konec_igre print('---Dobrodosli v igri potapljanje ladjic---') print('Imate 40 strelov, da zadanete 4 ladje velikosti 2, 3, 4, 5. Naj se bitka zacne!') while not konec_igre: for vrstica in igra.izpisi_plosco(): print...
StarcoderdataPython
1749655
import heapq class ARAPriorityQueue: def __init__(self): # self.arr[i] is (prority, point_position) # self.arr[i][1] is point_position self.arr = [] def empty(self): # empty list is False return not self.arr def add(self, priority, point_position): ...
StarcoderdataPython
4815296
<filename>blog/migrations/0001_initial.py<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-28 19:18 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
StarcoderdataPython
3228605
<gh_stars>10-100 """ Internal implementation of the planner backend interface for MoveIt! """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from compas_fab.backends.interfaces.client import forward_docstring from compas_fab.backends.interfaces.client impor...
StarcoderdataPython
3247045
import json import os class Vec4: def __init__(self, x, y, z, w): self.x = x self.y = y self.z = z self.w = w class Emotion: def __init__(self, name, arousal, valance, stance, time): self.name = name # arousal - the "energy level" of an emotion; eg: high ener...
StarcoderdataPython
1796
############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
StarcoderdataPython
172153
<gh_stars>0 __all__ = ['ulfdserver']
StarcoderdataPython
71546
import pytest from dagster import ( DagsterInvalidDefinitionError, ModeDefinition, ResourceDefinition, execute_pipeline, pipeline, system_storage, ) from dagster.core.definitions.system_storage import create_mem_system_storage_data def test_resource_requirements_pass(): called = {} @...
StarcoderdataPython
3232680
class SSHTool: def getSSHClient(self,password, host="localhost", username="root", port=22,timeout=10): '''Create a new SSHClient instance. @param host: Hostname to connect to @type host: string @param username: Username to connect as @type username: string @param...
StarcoderdataPython
4831868
<filename>twitter-tools/custom-recipes/sonra_twitter_plugin_compute_following_info/recipe.py # -*- coding: utf-8 -*- # !!! # Get all of the attributes of Twitter followings and store in DSS dataset. import dataiku from dataiku.customrecipe import * import pandas as pd, numpy as np from dataiku import pandasutils as pd...
StarcoderdataPython
4802053
<reponame>pjh/vm-analyze<filename>analyze/CheckpointEvent.py # Virtual memory analysis scripts. # Developed 2012-2014 by <NAME>, <EMAIL> # Copyright (c) 2012-2014 <NAME> and University of Washington ''' Class used for tracking checkpoint events in kernel trace. ''' class CheckpointEvent: tag = "CheckpointEvent" tim...
StarcoderdataPython
1740398
''' Copyright (c) 2018 <NAME> This file is part of mac_apt (macOS Artifact Parsing Tool). Usage or distribution of this software/code is subject to the terms of the MIT License. applist.py --------------- Reads the appList.dat plist file for each user. ''' import logging from biplist import * f...
StarcoderdataPython
1719428
from __future__ import annotations import hashlib import json import logging import pickle from typing import Any, Dict, Generator, Optional import pydantic from pydantic import validator import yaml from turnips.model import ModelEnum from turnips.meta import MetaModel from turnips.multi import MultiModel, BumpMode...
StarcoderdataPython
70798
<gh_stars>0 # -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
StarcoderdataPython
1717222
# -*- coding: utf-8 -*- import unittest class stackoverflow_question_58827592_test_case(unittest.TestCase): def test_stackoverflow_question_58827592(self): """ https://stackoverflow.com/questions/58827592/is-there-a-way-to-convert-csv-columns-into-hierarchical-relationships """ f...
StarcoderdataPython
3208304
# -*- coding: utf-8 -*- from django.conf import settings from django.conf.urls import url, include urlpatterns = [ url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) ]
StarcoderdataPython
122481
from typing import Any, List, NamedTuple, Set, Union import warnings from .util import UUID def citation_key_constructor(loader, node) -> str: """ A constructor for !cite yaml tags, returning a bibtex key as a str. All we need for now is a key string we can match in citations.bib, so _we're not parsi...
StarcoderdataPython
1634364
import json from dataclasses import asdict from uuid import uuid4 import pytest from srsran_controller.configurations_manager import ConfigurationsManager from srsran_controller.exceptions import MissionIdNotFoundError from srsran_controller.mission.mission_configuration import MissionConfiguration, GsmNeighbor, EnbC...
StarcoderdataPython
98663
<filename>Python/statistics_with_Python/08_LogisticRegression/Script_Files/01_LogisticRegression.py #!/usr/bin/env python # coding: utf-8 # In[76]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import statsmodels.api as sm import scipy.stats as st import pingouin as pg ...
StarcoderdataPython
3258876
<reponame>GiftLee/devops from django import forms class ChangeUserForm(forms.Form): userid = forms.IntegerField(label="用户ID") username = forms.CharField(label="用户名", max_length=128) password = forms.CharField(label="密码", max_length=32) domain = forms.CharField(label="AD域", max_length=256, required=Fal...
StarcoderdataPython
4841598
<filename>src/pysmile_license.py # License issued by BayesFusion Licensing Server # The code below must be executed before any PySMILE object is created. # You can use "import pysmile_license" or copy the pysmile.License # call into your Python source code. import pysmile pysmile.License(( b"SMILE LICENSE 4e60fa6c 137...
StarcoderdataPython
3205858
# Copyright (c) 2021 Hashz Software. import os import sys sys.path.insert(1, ".") sys.path.insert(1, "..") from Core import shell_helpers from Types.argument_error import ArgumentError from Types.arg_not_found import ArgNotFound from Types.item_not_found import ItemNotFound from YamlCore import builder manual_set_...
StarcoderdataPython
1620402
#!/usr/bin/env python3 import os, sys from Bio.Seq import Seq from csv import DictReader, DictWriter import pysam import pdb def clip_out(bam_filename, output_prefix, umi_len=5, extra_len=25, min_insert_len=300): """ :param bam_filename: BAM of post-LIMA (primer-trimmed) CCS sequences M13-UMI-arm-insert...
StarcoderdataPython
3382777
<filename>macarico/lts/aggrevate.py from __future__ import division, generators, print_function import torch import random import sys import numpy as np import macarico from macarico import CostSensitivePolicy from macarico.annealing import NoAnnealing, stochastic from macarico.util import break_ties_by_policy class A...
StarcoderdataPython
3349101
from semver import Version from semver import VersionRange from semver import parse_constraint from mixology.constraint import Constraint from mixology.package_source import PackageSource as BasePackageSource from mixology.range import Range from mixology.union import Union from mixology.version_solver import VersionS...
StarcoderdataPython
1753442
<filename>audio_loader.py from torch.utils import data import torch import glob import os import random import librosa import numpy as np # a repo with fast generation algorithm: https://github.com/vincentherrmann/pytorch-wavenet class VCTK(data.Dataset): def __init__(self, root, ...
StarcoderdataPython
3290463
from typing import Sequence from libcst import Arg, Call, Integer from django_codemod.constants import DJANGO_3_1, DJANGO_4_0 from django_codemod.utils.calls import find_keyword_arg from django_codemod.visitors.base import BaseFuncRenameTransformer class GetRandomStringTransformer(BaseFuncRenameTransformer): ""...
StarcoderdataPython
178615
<gh_stars>1-10 import inspect import time from typing import Any import matplotlib.pyplot as plt import mundi from pydemic.models import SEAIR from pydemic.utils import fmt from pydemic_ui import st from pydemic_ui.i18n import _, __ REGION_MESSAGE = __( """ Region UI components can be accessed from the region.ui...
StarcoderdataPython
3234793
<gh_stars>0 # Copyright 2016 Red Hat, 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 applica...
StarcoderdataPython
1673612
<filename>02_DQN/TensorFlow101/101.py """ TensorFlow101 之前使用过Darknet和Caffe,TF还是第一次碰,尤其是最近TF官方支持了Raspbian,我先来学习这个框架的基本操作。 """ import tensorflow as tf import numpy as np # 创建一组数据集 x_data = np.random.rand(100).astype(np.float32) y_data = x_data*0.1 + 0.3 ### 创建结构 ### # W是个矩阵形式 Weights = tf.Variable(tf.random_uniform([1...
StarcoderdataPython
3389843
from django.urls import path, re_path from pyhatebin import settings from . import views urlpatterns = [ path('raw/<slug:paste_id>', views.raw_paste_view), path('delete/<slug:paste_id>/<slug:deletion_key>', views.delete_paste_view), path('documents', views.create_paste_view), path('documents/', views....
StarcoderdataPython
1624509
<filename>setup.py #!/usr/bin/env python from distutils.core import setup, Extension setup(name='NowTrade', version='0.1', description='NowTrade - Python library for backtesting technical/mechanical strategies in the stock and currency markets.', author='<NAME>', author_email='<EMAIL>', ...
StarcoderdataPython
177421
import os import re import pickle import numpy as np import logging import spacy import scipy import sklearn from sklearn.feature_extraction.text import ( HashingVectorizer, CountVectorizer, TfidfVectorizer, ) import alsim.paths AMP_MAP = { # used to clean up a few HTML entities still hanging around in t...
StarcoderdataPython
1777277
<gh_stars>0 import os import time from core.worker import worker, box from ppadb.client import Client from cv2 import cv2 import json import sys from tqdm import tqdm import argparse __author__ = "Paver(Zhen_Bo)" os.system('cls') def app_path(): """Returns the base application path.""" if hasattr(sys, 'froze...
StarcoderdataPython
3233116
<gh_stars>1-10 #: From qrainbowstyle
StarcoderdataPython
1772706
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 <NAME> # Copyright 2014 <NAME> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in com...
StarcoderdataPython
3269093
SECRET_KEY = 'p9Bv<3Eid9%$i01'
StarcoderdataPython
1796797
import os import re from fbs.proc.common_util.util import FileFormatError from fbs.proc.file_handlers import generic_file from fbs.proc.file_handlers import netcdf_file from fbs.proc.file_handlers import nasaames_file from fbs.proc.file_handlers import pp_file from fbs.proc.file_handlers import grib_file from fbs.proc...
StarcoderdataPython
1762408
<reponame>DavidWhittingham/agsconfig<filename>tests/custom_get_capabilities_mixin.py # coding=utf-8 """Tests for ogc metadata attributes. """ # Python 2/3 compatibility # pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-order,wrong-import-position from __future__ import (absolute_import, division, p...
StarcoderdataPython
1658751
""" http://pythontutor.ru/lessons/lists/problems/kegelbahn/ N кеглей выставили в один ряд, занумеровав их слева направо числами от 1 до N. Затем по этому ряду бросили K шаров, при этом i-й шар сбил все кегли с номерами от li до ri включительно. Определите, какие кегли остались стоять на месте. Программа получает на вхо...
StarcoderdataPython
4822870
<filename>src/outpost/django/salt/migrations/0003_auto_20200730_1627.py<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-07-30 14:27 from __future__ import unicode_literals from django.db import migrations, models import outpost.django.base.validators class Migration(migrations.Migration): ...
StarcoderdataPython