text
string
size
int64
token_count
int64
import os.path as osp # Root directory of project ROOT_DIR = osp.abspath(osp.join(osp.dirname(__file__), '..', '..')) # Path to data dir _DATA_DIR = osp.abspath(osp.join(ROOT_DIR, 'data')) # Required dataset entry keys _IM_DIR = 'image_directory' _ANN_FN = 'annotation_file' # Available datasets COMMON_DATASETS = { ...
4,541
1,872
# Prepare my dataset for Digital Pathology import os import math import cv2 import pdb rootFolder = "F:\DataBase\LymphnodePathology" trainFolder = rootFolder + "\\trainDataSet" testFolder = rootFolder + "\\testDataSet" srcTrainFilePath = trainFolder + "\\20X\\" dstTrainFilePath = trainFolder + "\\5X\\" srcTestFileP...
1,713
579
from rest_framework import serializers from solid_backend.photograph.serializers import PhotographSerializer from solid_backend.media_object.serializers import MediaObjectSerializer from .models import SampleProfile class SampleProfileSerializer(serializers.ModelSerializer): media_objects = MediaObjectSerializer...
424
104
# -*- coding: utf8 -*- import os from utensor_cgen.utils import save_consts, save_graph, save_idx import numpy as np import tensorflow as tf def generate(): test_dir = os.path.dirname(__file__) graph = tf.Graph() with graph.as_default(): x = tf.constant(np.random.randn(10), dtype=tf.floa...
782
291
"""Logging helpers.""" import logging import sys import colorlog import tqdm class TqdmLoggingHandler(logging.StreamHandler): """TqdmLoggingHandler, outputs log messages to the console compatible with tqdm.""" def emit(self, record): # noqa: D102 message = self.format(record) tqdm.tqdm.writ...
2,619
872
#Basic Ultrasonic sensor (HC-SR04) code import RPi.GPIO as GPIO #GPIO RPI library import time # makes sure Pi waits between steps GPIO.setmode(GPIO.BCM) #sets GPIO pin numbering #GPIO.setmode(GPIO.BOARD) #Remove warnings GPIO.setwarnings(False) #Create loop variable #loop = 1 #BCM TRIG = 23 #output pin - triggers t...
2,284
846
class Retangulo: # Atributos def __init__(self, comprimento, altura): self.setcomprimento(comprimento) self.setAltura(altura) # Métodos def setcomprimento(self, comprimento): self.comprimento = comprimento def getcomprimento(self): return self.comprimento def se...
868
297
""" Fetch all files from Kortforsyningen FTP server folder. Copyright (c) 2021 Peter Fogh See also command line alternative in `download_dk_dem.sh` """ from ftplib import FTP, error_perm import os from pathlib import Path import time import operator import functools import shutil # TODO: use logging to std instead of...
4,053
1,360
# -*- coding: utf-8 -*- """ Created on Sun Mar 24 15:02:37 2019 @author: Matt Macarty """ from tkinter import * import numpy as np class LoanCalculator: def __init__(self): window = Tk() window.title("Loan Calculator") Label(window, text="Loan Amount").grid(row=1...
3,481
1,262
#!/usr/bin/python3 # # PMTOOL NDCTL Python Module # Copyright (C) David P Larsen # Released under MIT License import os import json from common import message, get_linenumber, pretty_print from common import V0, V1, V2, V3, V4, V5, D0, D1, D2, D3, D4, D5 import common as c import time DEFAULT_FSTAB_FILE = "/etc/fsta...
19,224
7,513
from .admin import ReviewListAdmin, SoAdminReviewIsOut, SoReviewForAdmin from .admin_commands import ( AdminCommands, AdminFilteredCommands, ReviewListByCommands, SoIgnoreReview, SoSubmitReview ) from .gerrit import ReviewOnServer, SoNewReview, SoOutReview, SoUpdateReview from .reaction import ( ReactionAlways, ...
653
239
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
60,615
14,924
"""Python proxy to run Swift action. /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Ve...
3,935
1,202
from typing import Dict, List, TypeVar, Union JsonTypeVar = TypeVar("JsonTypeVar") JsonPrimitive = Union[str, float, int, bool, None] JsonDict = Dict[str, JsonTypeVar] JsonArray = List[JsonTypeVar] Json = Union[JsonPrimitive, JsonDict, JsonArray]
251
85
import typing as t from yandex_market_language import models from yandex_market_language.models.abstract import XMLElement, XMLSubElement class Promo(models.AbstractModel): """ Docs: https://yandex.ru/support/partnermarket/elements/promo-gift.html """ MAPPING = { "start-date": "start_date", ...
6,006
2,009
import shell from dataclasses import dataclass from utils import * from ownLogging import * from typing import * from ansi import * import re import os import testHaskell import testPython import testJava @dataclass class TestArgs: dirs: List[str] assignments: List[str] # take all if empty interactive: boo...
3,834
1,186
from collections import Counter from datetime import datetime import os import requests from subprocess import Popen, PIPE from pathlib import Path import json from typing import Dict, Union, TYPE_CHECKING from kipoi_utils.external.torchvision.dataset_utils import download_url if TYPE_CHECKING: import zenodoclien...
14,098
4,333
# -*- coding: utf-8 -*- """ policy._cache ~~~~~~~~~~~~~~~ Cache for policy file. """ import os import logging LOG = logging.getLogger(__name__) # Global file cache CACHE = {} def read_file(filename: str, force_reload=False): """Read a file if it has been modified. :param filename: File name ...
1,152
369
# Copyright 2017, OpenCensus Authors # # 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 w...
10,858
3,337
from typing import Reversible from django.test import TestCase, Client from challenge.models import Challenge from codingPage.models import Command, Log from django.core.exceptions import ValidationError from django.urls import reverse class CodingPageTest(TestCase): def setUp(self) -> None: self.client = ...
1,322
388
import os import datetime from app import app, db class Hint(db.Model): __tablename__ = 'hints' id = db.Column(db.Integer, primary_key=True) description = db.Column(db.Text) is_open = db.Column(db.Boolean) problem_id = db.Column(db.Integer, db.ForeignKey('problems.id')) def __repr__(self): ...
537
176
from django.urls import path from . import views app_name = "base" urlpatterns = [ path('', views.IndexView.as_view(), name="home"), path('contact/', views.ContactView.as_view(), name="contact"),]
204
68
from datetime import datetime, timedelta from string import ascii_uppercase from dateutil.parser import parse from flask import abort, flash, jsonify, redirect, render_template, request, url_for from flask_babel import _ from flask_babel import lazy_gettext as _l from flask_login import current_user from markupsafe im...
33,899
9,854
import numpy as np from load_auto import load_auto import matplotlib.pyplot as plt import math def initialize_parameters(observation_dimension): # observation_dimension: number of features taken into consideration of the input # returns weights as a vector and offset as a scalar weights = np.zeros((observa...
7,999
2,510
import pytest from functions.hr_calculations import * @pytest.mark.parametrize("candidate, database, expected", [ ('jack', [{'patient_id': 'jump'}, {'patient_id': 'jack'}], 1), ('jungle', [{'patient_id': 'jungle'}, {'patient_id': 'jack'}], 0), ('bo', [{'patient_id': 'james'}, {'patient_id': 'boo'}, ...
3,426
1,715
import random import numpy as np import selfdrive.boardd.tests.boardd_old as boardd_old import selfdrive.boardd.boardd as boardd from common.realtime import sec_since_boot from cereal import log import unittest def generate_random_can_data_list(): can_list = [] cnt = random.randint(1, 64) for j in range(cnt):...
2,492
961
import ast import inspect import sys import argparse from ..runtime.asserts import typecheck @typecheck def pretty_print_defs(defs: list) -> None: for d in defs: print("Function definition for {}".format(d["name"])) print("Arguments:") for arg in d["args"]: arg_type = "untyped...
2,037
567
from django.conf.urls import include, url from django.contrib import admin from demo.apis import api urlpatterns = [ url(r'^api/', include(api.urls)), url(r'^api/doc/', include(('tastypie_swagger.urls', 'tastypie_swagger'), namespace='demo_api_swagger'), kwargs={ "...
475
161
from scrapy_framework.html.request import Request from scrapy_framework.html.response import Response import random def get_ua(): first_num=random.randint(55,69) third_num=random.randint(0,3200) forth_num=random.randint(0, 140) os_type = [ '(Windows NT 6.1; WOW64)', '(Windows NT 10.0; WOW64)...
948
354
from pydantic import BaseModel from tracardi.domain.entity import Entity from tracardi.domain.scheduler_config import SchedulerConfig from tracardi.domain.resource import ResourceCredentials from tracardi.service.storage.driver import storage from tracardi.service.plugin.runner import ActionRunner from tracardi.servic...
2,294
591
# Copyright 2020 Alvaro Bartolome, alvarobartt @ GitHub # See LICENSE for details. import pytest import covid_daily def test_overview(): params = [ { 'as_json': True }, { 'as_json': False } ] for param in params: covid_daily.overview(as_js...
568
206
#!@PYTHON@ -tt import sys import atexit import socket import struct import logging sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * from fencing import fail, fail_usage, run_delay, EC_LOGIN_DENIED, EC_TIMED_OUT #BEGIN_VERSION_GENERATION RELEASE_VERSION="" REDHAT_COPYRIGHT="" BUILD_DATE="" #END_VERSION_GEN...
6,132
2,326
# -*- coding: utf-8 -*- import scrapy from scrapy_splash import SplashRequest # 使用scrapy_splash包提供的request对象 class WithSplashSpider(scrapy.Spider): name = 'with_splash' allowed_domains = ['baidu.com'] start_urls = ['https://www.baidu.com/s?wd=13161933309'] def start_requests(self): yield Splas...
668
255
from main import app import os import uvicorn if __name__ == '__main__': port = int(os.getenv("PORT")) uvicorn.run(app, host="0.0.0.0", port=port, workers=1, reload=True)
180
71
# Copyright 2019 The FastEstimator Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
5,889
2,037
import pathlib import os from generallibrary import VerInfo, TreeDiagram, Recycle, classproperty, deco_cache from generalfile.errors import InvalidCharacterError from generalfile.path_lock import Path_ContextManager from generalfile.path_operations import Path_Operations from generalfile.path_strings import Path_St...
5,660
1,762
import os from django.db import models import uuid # Create your models here. from djcelery_model.models import TaskMixin from polymorphic.models import PolymorphicModel from genui.utils.models import NON_POLYMORPHIC_CASCADE, OverwriteStorage from genui.utils.extensions.tasks.models import TaskShortcutsMixIn, Polymo...
11,128
3,238
"""REST API view tests for the projectroles app""" import base64 import json import pytz from django.conf import settings from django.core import mail from django.forms.models import model_to_dict from django.test import override_settings from django.urls import reverse from django.utils import timezone from knox.mod...
106,765
32,655
"""Contains the classification model I am going to use in my problem and some utility functions. Functions build_mmdisambiguator - build the core application object with the collaborators info Classes MMDisambiguator - core class of the application """ import pickle import os import numpy as np from sklearn....
7,569
1,949
# Copyright (c) 2018, deepakn94. 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 ...
2,848
902
from rpython.jit.backend.llsupport.descr import get_size_descr,\ get_field_descr, get_array_descr, ArrayDescr, FieldDescr,\ SizeDescr, get_interiorfield_descr from rpython.jit.backend.llsupport.gc import GcLLDescr_boehm,\ GcLLDescr_framework from rpython.jit.backend.llsupport import jitframe from rpython...
38,947
14,368
from decimal import Decimal import pandas as pd from typing import ( Any, Dict, Set, Tuple, TYPE_CHECKING) from hummingbot.client.performance_analysis import PerformanceAnalysis from hummingbot.core.utils.exchange_rate_conversion import ExchangeRateConversion from hummingbot.market.market_base impo...
10,390
2,835
import re import os import click import r2pipe import hashlib from pathlib import Path import _pickle as cPickle def sha3(data): return hashlib.sha3_256(data.encode()).hexdigest() def validEXE(filename): magics = [bytes.fromhex('7f454c46')] with open(filename, 'rb') as f: header = f.read(4) ...
3,271
1,170
import re def remove_not_alpha_num(string): return re.sub('[^0-9a-zA-Z]+', '', string) if __name__ == '__main__': print(remove_not_alpha_num('a000 aa-b') == 'a000aab')
180
81
import os from sys import argv from mod_pbxproj import XcodeProject #import appcontroller path = argv[1] frameworks = argv[2].split(' ') libraries = argv[3].split(' ') cflags = argv[4].split(' ') ldflags = argv[5].split(' ') folders = argv[6].split(' ') print('Step 1: add system frameworks ') #if...
1,763
657
# Generated by Django 3.0.8 on 2020-07-05 02:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('judge', '0023_auto_20200704_2318'), ] operations = [ migrations.AlterField( model_name='submission', name='language'...
996
369
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import os import re import shlex import subprocess import signal import csv import logging import json import time from datetime import datetime as dt from requests.exceptions import RequestException import glob import traceback i...
26,771
8,189
import compileall compileall.compile_dir(".",force=1)
53
17
# Generated by Django 3.1.5 on 2021-02-17 11:04 from django.db import migrations import saleor.core.db.fields import saleor.core.utils.editorjs def update_empty_description_field(apps, schema_editor): Category = apps.get_model("product", "Category") CategoryTranslation = apps.get_model("product", "CategoryT...
3,010
846
#!/usr/bin/env python3 import sys import random def read_file(file_name): """File reader and parser the num of variables, num of clauses and put the clauses in a list""" clauses =[] with open(file_name) as all_file: for line in all_file: if line.startswith('c'): continue #ignore comment...
5,215
1,565
""" This makes the functions in torch._C._VariableFunctions available as torch._VF.<funcname> without mypy being able to find them. A subset of those functions are mapped to ATen functions in torch/jit/_builtins.py See https://github.com/pytorch/pytorch/issues/21478 for the reason for introducing torch._VF """ i...
656
220
import gin import torch import logging from sparse_causal_model_learner_rl.metrics import find_value, find_key @gin.configurable def ProjectionThreshold(config, config_object, epoch_info, temp, adjust_every=100, metric_threshold=0.5, delta=0.5, source_metric_key=None, min_hyper=0, max_hyper=100...
1,426
503
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 from collections import OrderedDict from functools import partial from jax import lax, random, tree_flatten, tree_map, tree_multimap, tree_unflatten import jax.numpy as jnp from jax.tree_util import register_pytree_node_class from nu...
15,684
4,819
# Generated by Django 2.2.12 on 2020-06-10 01:11 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('catalog', '0002_auto_20200610_0019'), ] operations = [ migrations.RemoveField( model_name='productattributevalue', name='na...
342
126
import json from nbformat.notebooknode import NotebookNode from nbconvert.exporters.exporter import ResourcesDict from typing import Tuple from nbgrader.api import MissingEntry from nbgrader.preprocessors import OverwriteCells as NbgraderOverwriteCells from ..utils.extra_cells import is_singlechoice, is_multiplechoi...
1,245
356
#!/usr/bin/env python3 """A command line tool for extracting text and images from PDF and output it to plain text, html, xml or tags.""" import argparse import logging import sys from typing import Any, Container, Iterable, List, Optional import pdfminer.high_level from pdfminer.layout import LAParams from pdfminer.ut...
9,261
2,657
"""Compile Nim libraries as Python Extension Modules. If you want your namespace to coexist with your pthon code, name this ponim.nim and then your import will look like `from ponim.nim import adder` and `from ponim import subtractor`. There must be a way to smooth that out in the __init__.py file somehow. Note that ...
2,757
772
from collections import OrderedDict import pytest import torch import pyro.distributions as dist from pyro.contrib.util import ( get_indices, tensor_to_dict, rmv, rvv, lexpand, rexpand, rdiag, rtril, hessian ) from tests.common import assert_equal def test_get_indices_sizes(): sizes = OrderedDict([("a", 2), ...
3,591
1,658
from django.apps import AppConfig class EmodulConfig(AppConfig): name = 'emodul'
87
30
from __future__ import division from collections import defaultdict import numpy as np from time import time import random import tensorflow.compat.v1 as tf tf.disable_v2_behavior() # import tensorflow as tf class DataModule(): def __init__(self, conf, filename): self.conf = conf self.data_dict = ...
20,473
7,065
from xmlrpc.server import MultiPathXMLRPCServer import torch.nn as nn import torch.nn.functional as F import copy from src.layers.layers import Encoder, EncoderLayer, Decoder, DecoderLayer, PositionwiseFeedForward from src.layers.preprocessing import Embeddings, PositionalEncoding from src.layers.attention import Mult...
2,656
914
import os import timeit from typing import List import numpy as np from numpy.random import RandomState from numpy.testing import assert_allclose, assert_almost_equal import pytest from scipy.special import gamma import arch.univariate.recursions_python as recpy CYTHON_COVERAGE = os.environ.get("ARCH_CYTHON_COVERAGE...
34,716
12,035
from .levenshtein import Levenshtein class DamerauLevenshtein(Levenshtein): def __init__(self, name='Damerau-Levenshtein'): super().__init__(name=name) def distance(self, source, target, cost=(1, 1, 1, 1)): """Damerau-Levenshtein distance with costs for deletion, insertion, substitution a...
3,215
976
import typing from copy import deepcopy from typing import TYPE_CHECKING from typing import List import numba import numpy as np import pandas as pd if TYPE_CHECKING: from etna.datasets import TSDataset @numba.jit(nopython=True) def optimal_sse(left: int, right: int, p: np.ndarray, pp: np.ndarray) -> float: ...
13,130
4,334
def createKafkaSecurityGroup(ec2, vpc): sec_group_kafka = ec2.create_security_group( GroupName='kafka', Description='kafka sec group', VpcId=vpc.id) sec_group_kafka.authorize_ingress( IpPermissions=[{'IpProtocol': 'icmp', 'FromPort': -1, 'ToPort': -1, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, ...
2,094
918
from django.conf import settings def pusher(request): return { "PUSHER_KEY": getattr(settings, "PUSHER_KEY", ""), }
134
47
"""character/update/parse.py - Defines an interface for updating character traits.""" # pylint: disable=too-many-arguments import re import discord from discord_ui.components import LinkButton from . import paramupdate from ..display import display from ... import common, constants from ...log import Log from ...vch...
7,537
2,399
''' Uses flattened features in feature directory and run a SVM on it ''' from keras.layers import Dense from keras.models import Sequential import keras.regularizers as Reg from keras.optimizers import SGD, RMSprop from keras.callbacks import EarlyStopping import cPickle as pickle import numpy as np from sklearn.model...
7,980
3,015
import sys import os sys.path.append( os.path.dirname(__file__) ) import numpy as np import typing as tp import angles from model import Node, Link, Label from spec import ArrowDraw, NodeSpec class FormationManager: def __init__(self): self._nodes = {} self._links = [] self._labels = [] ...
11,009
3,749
############################################## # The MIT License (MIT) # Copyright (c) 2014 Kevin Walchko # see LICENSE for full details ############################################## # -*- coding: utf-8 -* from math import atan, pi def fov(w,f): """ Returns the FOV as in degrees, given: w...
454
146
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g...
3,571
1,413
import json class Config(object): def __init__(self, file_location): with open(file_location, 'r') as f: config = json.load(f) self.SCREEN_WIDTH = int(config["SCREEN_WIDTH"]) self.SCREEN_HEIGHT = int(config["SCREEN_HEIGHT"]) self.MAP_WIDTH = int(config["MAP_...
989
351
import pandas as pd import numpy as np def create_calr_example_df(n_rows, start_date): ''' ''' np.random.seed(20) array = np.random.rand(n_rows) cumulative = np.cumsum(array) d = { 'feature1_subject_1': array, 'feature1_subject_2': array, 'feature2_subject_1': cumulati...
524
187
import os import numpy as np import scipy.io as sio import tifffile from sklearn.decomposition import PCA from sklearn.model_selection import train_test_split #Load dataset def loadData(name,data_path): if name == 'IP': data = sio.loadmat(os.path.join(data_path, 'Indian_pines_corrected.mat'))['indian_pin...
4,663
1,839
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayOpenIotmbsDooropenresultSyncModel(object): def __init__(self): self._dev_id = None self._door_state = None self._project_id = None @property def dev_id(self...
1,873
621
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="marlin_binary_protocol", version="0.0.7", author="Charles Willis", author_email="charleswillis3@users.noreply.github.com", description="Transfer files with Marlin 2.0 firmware using Marlin...
958
336
# # taut_euler_class.py # from file_io import parse_data_file, write_data_file from taut import liberal, isosig_to_tri_angle from transverse_taut import is_transverse_taut from sage.matrix.constructor import Matrix from sage.modules.free_module_element import vector from sage.arith.misc import gcd from sage.arith.fu...
18,028
6,024
from django.urls import path from .views import ( student_list, student_add, student_profile,student_delete )
110
30
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
5,253
1,922
# forked from https://github.com/single-cell-genetics/cellSNP ## A python wrap of UCSC liftOver function for vcf file ## UCSC liftOver binary and hg19 to hg38 chain file: ## https://genome.ucsc.edu/cgi-bin/hgLiftOver ## http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/liftOver ## http://hgdownload.soe.ucsc.edu/gol...
5,153
1,870
import json import pytest from channels.db import database_sync_to_async from channels.testing import WebsocketCommunicator from pytest_lazyfixture import lazy_fixture from pomodorr.frames import statuses from pomodorr.frames.models import DateFrame from pomodorr.frames.routing import frames_application from pomodorr...
8,842
2,835
import logging import os import redis import moltin_aps _database = None db_logger = logging.getLogger('db_logger') async def get_database_connection(): global _database if _database is None: database_password = os.getenv('DB_PASSWORD') database_host = os.getenv('DB_HOST') databas...
1,362
434
from .lime_bike_feed import LimeBikeFeed from .lime_bike_trips import LimeBikeTrips from .lime_bike_trips_analyze import LimeBikeTripsAnalyze
142
56
# Python modules import json import logging from datetime import datetime, timedelta, timezone from time import time from typing import Any, Callable import re import requests from requests import Session from threading import Lock # SOAP Client modules from zeep import Client from zeep import helpers from zeep.transp...
75,692
19,131
version = "1.0.10.dev0"
24
15
from pathlib import Path import plecos import json print(plecos.__version__) #%% path_to_json_local = Path("~/ocn/plecos/plecos/samples/sample_metadata_local.json").expanduser() path_to_json_remote = Path("~/ocn/plecos/plecos/samples/sample_metadata_remote.json").expanduser() path_to_broken_json = Path("~/ocn/plecos/pl...
3,294
1,229
import re import panflute as pf from functools import partial from pangloss.util import smallcapify, break_plain # regular expression for label formats label_re = re.compile(r'\{#ex:(\w+)\}') gb4e_fmt_labelled = """ \\ex\\label{{ex:{label}}} \\gll {} \\\\ {} \\\\ \\trans {} """ gb4e_fmt = """ \\ex \\gll {} \\\\ {}...
2,180
741
from __future__ import absolute_import, unicode_literals import itertools import os import sys from copy import copy import pytest from virtualenv.discovery.py_spec import PythonSpec def test_bad_py_spec(): text = "python2.3.4.5" spec = PythonSpec.from_string_spec(text) assert text in repr(spec) as...
3,702
1,321
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json module_definition = json.loads( """{ "family": "software_image_management_swim", "name": "trigger_image_activation", "operations": { "post": [ "trigger_software_image_activation" ...
2,251
527
from .helper import download_file, get_user_agent from .install import install_minecraft_version from typing import List, Dict, Union from xml.dom import minidom import subprocess import requests import tempfile import random import os def get_all_minecraft_versions() -> List[Dict[str,Union[str,bool]]]: """ Re...
3,966
1,209
# STRAND SORT # It is a recursive comparison based sorting technique which sorts in increasing order. # It works by repeatedly pulling sorted sub-lists out of the list to be sorted and merging them # with a result array. # Algorithm: # Create a empty strand (list) and append the first element to it popping it from th...
2,354
694
"""CoinGecko model""" __docformat__ = "numpy" # pylint: disable=C0301, E1101 import logging import re from typing import Any, List import numpy as np import pandas as pd from pycoingecko import CoinGeckoAPI from gamestonk_terminal.cryptocurrency.dataframe_helpers import ( create_df_index, long_number_format...
10,915
3,899
#!/usr/bin/env python3 from configparser import ConfigParser from datetime import datetime import urllib.parse import hashlib import io import json import logging import os import re import time from xml.dom import minidom import feedparser import requests import schedule import PIL.Image import PIL.ImageDraw import P...
20,399
7,205
#!/usr/bin/env python # # widgetlist.py - A widget which displays a list of groupable widgets. # # Author: Paul McCarthy <pauldmccarthy@gmail.com> # """This module provides the :class:`WidgetList` class, which displays a list of widgets. """ import wx import wx.lib.newevent as wxevent import wx.lib.scrolledpanel...
19,687
5,631
#!/usr/bin/env python import setuptools MAINTAINER_NAME = 'Transact Pro' MAINTAINER_EMAIL = 'support@transactpro.lv' URL_GIT = 'https://github.com/TransactPRO/gw3-python-client' try: import pypandoc LONG_DESCRIPTION = pypandoc.convert('README.md', 'rst') except (IOError, ImportError, OSError, RuntimeError):...
1,441
480
"""Tests for our backend""" from urllib.parse import urljoin import pytest from social_auth_mitxpro.backends import MITxProOAuth2 # pylint: disable=redefined-outer-name @pytest.fixture def strategy(mocker): """Mock strategy""" return mocker.Mock() @pytest.fixture def backend(strategy): """MITxProOAu...
2,359
771
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\careers\detective\detective_crime_scene.py # Compiled at: 2015-02-08 03:00:54 # Size of source mod 2...
1,183
468
""" Code adapted from https://github.com/ohlerlab/DeepRiPe with changes Extract information and graphs from the Integrated gradients output """ import argparse import os import sys import matplotlib.pyplot as plt import numpy as np import seaborn as sns from classifier.plotseqlogo import seqlogo_fig from commons imp...
11,640
4,157
#!/usr/bin/python3 from collections import OrderedDict from functools import partial from ordered_set import OrderedSet import inspect import itertools import types from .utils import walk_getattr __all__ = ['autoinit', 'autorepr', 'TotalCompareByKey'] def autoinit(obj=None, *args, params=None, **kwargs): """T...
3,921
1,266
from direct.directnotify import DirectNotifyGlobal from toontown.estate import GardenGlobals from toontown.estate.DistributedLawnDecorAI import DistributedLawnDecorAI FLOWER_X_OFFSETS = ( None, (0, ), (-1.5, 1.5), (-3.4, 0, 3.5)) class DistributedGardenPlotAI(DistributedLawnDecorAI): notify = DirectNotifyGlobal.d...
10,051
3,191