text stringlengths 2 999k |
|---|
from PDFSentenceReader import PDFSentenceReader
from WordAnalyzer import WordAnalyzer
from CSVWriter import CSVWriter
import matplotlib.pyplot as plt
import json
import math
import re
def read_keywords(file_path):
file = open(file_path, 'r')
keywords = json.loads(file.read())
return keywords
def analys... |
#!/usr/bin/env python3
from termcolor import colored
env = dict()
"""
Set software environmental configuration, not used for now
"""
def set_env(key="", val=""):
global env
env[key] = val
def disas(pos=0, cnt=-1):
ins_list = list()
limit = len(env['data'])
while 1:
byte = hex(env['data'][pos])[2:].rjust(2,... |
# Copyright 2014 OpenStack Foundation
#
# 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 ... |
import pandas as pd
from flask import Flask, request, jsonify
import json
import numpy as np
from src.main.python.feature_extractor.feature_extractor import FeatureExtractor
from src.main.python.model.logistic_regression import LogisticRegressionModel
from src.main.python.utils.aws import build_s3
def main():
"""... |
# coding: utf-8
"""
jatdb
JSON API to DB: Fetch JSON from APIs and send to a TinyDB database. # noqa: E501
OpenAPI spec version: 0.0.2
Contact: Nathan@Genetzky.us
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
impor... |
from django.core.management.base import BaseCommand
from django.utils import timezone
from mooring.models import lotusnotesextract, RegisteredVessels
import json
from datetime import timedelta
class Command(BaseCommand):
help = 'Take extract from lotus notes and merge from 7 vessels per line into 1 single record ... |
# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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 requir... |
"""
Project Euler Problem 207: https://projecteuler.net/problem=207
Problem Statement:
For some positive integers k, there exists an integer partition of the form
4**t = 2**t + k, where 4**t, 2**t, and k are all positive integers and t is a real
number. The first two such partitions are 4**1 = 2**1 + 2 and
4*... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def removeNthFromEnd(self, head: 'ListNode', n: 'int') -> 'ListNode':
first = second = head
for i in range(n):
first = first.next
... |
from .. import _UIList
from nanome.util.color import Color
def parse_json(content_json):
list = _UIList._create()
list._display_columns = content_json.read("display_columns", list._display_columns)
list._display_rows = content_json.read("display_rows", list._display_rows)
list._total_columns = content... |
from .pyqtgraph_vini.Qt import QtCore, QtGui
from .pyqtgraph_vini import *
import numpy as np
import math
import os
import time
import copy
import sys, os.path
from .testInputs import testFloat, testInteger
class ImageDialog(QtGui.QDialog):
"""
Image properties dialog
"""
sigPreferencesSave = QtCore... |
import torch
from pyscipopt import Model
from torch.utils.data import Dataset
class InstanceDataset(Dataset):
def __init__(self, mip_files, sol_files):
self.mip_files = mip_files
self.sol_files = sol_files
def __len__(self):
return len(self.mip_files)
def __getitem__(self, index):... |
#!/usr/bin/env python
# coding=utf-8
from sacred import Ingredient, Experiment
# ================== Dataset Ingredient =======================================
# could be in a separate file
data_ingredient = Ingredient('dataset')
@data_ingredient.config
def cfg1():
filename = 'my_dataset.npy' # dataset filenam... |
import os
import shutil
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import yaml
from cryptodoge import __version__
from cryptodoge.consensus.coinbase import create_puzzlehash_for_pk
from cryptodoge.ssl.create_ssl import generate_ca_signed_cert, get_cryptodoge_ca_crt_key, make_ca_cert
... |
"""
EVM Instruction Encoding (Opcodes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. contents:: Table of Contents
:backlinks: none
:local:
Introduction
------------
Machine readable representations of EVM instructions, and a mapping to their
implementations.
"""
import enum
from typing import Callable, Dict
from .... |
# encoding: utf-8
"""Unit-test suite for `pptx.slide` module."""
import pytest
from pptx.dml.fill import FillFormat
from pptx.enum.shapes import PP_PLACEHOLDER
from pptx.package import Package
from pptx.parts.presentation import PresentationPart
from pptx.parts.slide import SlideLayoutPart, SlideMasterPart, SlidePar... |
"""
This file offers the methods to automatically retrieve the graph Wolinella succinogenes.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021... |
# Natural Language Toolkit: Minimal Sets
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://www.nltk.org>
# For license information, see LICENSE.TXT
class MinimalSet(object):
"""
Find contexts where more than one possible target value can
appear. E.g. i... |
# Generated by Django 3.1.5 on 2021-07-29 08:53
from django.db import migrations, models
def data_fix(apps, schema_editor):
apps.get_model("notifications", "Event").objects.update_or_create(name='dkron_failed_job')
class Migration(migrations.Migration):
initial = True
replaces = [
('dkron', '... |
"""Add date to newsletter
Revision ID: e6fde44bb7d3
Revises: 0e4285fb2929
Create Date: 2020-11-03 14:45:23.252191
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'e6fde44bb7d3'
down_revision = '0e4285fb2929'
branch_labe... |
class Solution(object):
def spiralOrder(self, n):
"""
:type matrix: List[List[int]]
:rtype: List[int]
"""
min_r = 0
max_r = n-1
min_c = 0
max_c = n-1
res = [[0 for i in range(n)] for j in range(n)]
k = 0
while min_r<= max_r and... |
class Solution:
def intersection(self, nums1: list, nums2: list) -> list:
return list(set(nums1) & set(nums2))
if __name__ == '__main__':
nums1 = [1, 2, 2, 1]
nums2 = [2, 2]
print(f"Input: nums1 = {nums1}, nums2 = {nums2}")
print(f"Output: {Solution().intersection(nums1, nums2)}")
|
from django.contrib.auth.base_user import BaseUserManager
from django.db import models
from django.core.validators import MinLengthValidator
from django.core.validators import MaxLengthValidator
from django.core.validators import RegexValidator
from django.contrib.auth.models import AbstractUser
from wagtail.core.model... |
import os
import time
import inspect #The built-in lib of Python, inspecting the live objects
import numpy as np
import tensorflow as tf
import struct
import pandas as pd
import model_maker
import time_recorder
class BackPropCnnNetwork(object):
def __init__(self, features, labels, model_fn, batch_size,
... |
GUARD1 = 2159340
GUARD2 = 2159341
J_AGENT = 2159342
sm.lockInGameUI(True)
sm.completeQuestNoRewards(23207)
sm.deleteQuest(23207)
sm.spawnNpc(GUARD1, 175, 0)
sm.showNpcSpecialActionByTemplateId(GUARD1, "summon", 0)
sm.spawnNpc(GUARD2, 300, 0)
sm.showNpcSpecialActionByTemplateId(GUARD2, "summon", 0)
sm.spawnNpc(J_AGENT... |
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
# Create your models here.
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
retur... |
#!/usr/bin/env python3
#
# Copyright (C) 2019 Intel Corporation
#
# 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 applicabl... |
from built.evaluation_scheduler import EvaluationScheduler
import os
import math
import time
import logging
import torch
import tqdm
import numpy as np
import wandb
import pandas as pd
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import DataLoader
from collections import defaultdict
from b... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Flowroute LLC
# Written by Matthew Williams <matthew@flowroute.com>
# Based on yum module written by Seth Vidal <skvidal at fedoraproject.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ ... |
"""
Testing of callbacks in non-Python Modal snippets.
"""
from pathlib import Path
import dash.testing.wait as wait
from .helpers import load_jl_app, load_r_app
HERE = Path(__file__).parent
def test_r_modal_simple(dashr):
r_app = load_r_app((HERE.parent / "modal" / "simple.R"), "modal")
dashr.start_server... |
#!/usr/bin/env python
"""
Strip output from Jupyter and IPython notebooks
===============================================
Opens a notebook, strips its output, and writes the outputless version to the
original file.
Useful mainly as a git filter or pre-commit hook for users who don't want to
track output in VCS.
This... |
"""Implementation of sodar-cli landingzone subcommand."""
import argparse
from sodar_cli.common import run_nocmd
from sodar_cli.landingzone.config import LandingZoneConfig
from sodar_cli.landingzone.list import setup_argparse as setup_argparse_list
from sodar_cli.landingzone.retrieve import setup_argparse as setup_ar... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import logging
from userservice.user import UserService
from endorsement.dao.user import (
get_endorser_model, get_endorsee_model, get_endorsee_email_model)
from endorsement.services import endorsement_services, is_valid_endorser... |
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import MinMaxScaler
from sklearn.base import BaseEstimator, TransformerMixin
import pandas as pd
#Replicando a classe Transformer para realizar pré-processamento das infos do cliente
class Transformer(BaseEstimator, TransformerMixin):
def __i... |
from typing import Any
from typing import List
from typing import Union
from typing import Callable
from typing import Optional
from typing import TYPE_CHECKING
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_hub as hub
import bentoml
from tests.utils.helpers import assert_have_file_extensi... |
from __future__ import print_function
import os
import h5py
import numpy as np
from programs.program_table_1 import generate_batch as table_gen1
from programs.program_table_2 import generate_batch as table_gen2
from programs.program_table_3 import generate_batch as table_gen3
from programs.program_table_4 import gene... |
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from helpers import *
import bforms
import logging
from django.utils import simplejson
from django.template.loader import get... |
import pandas as pd
import pdb
import matplotlib.pyplot as plt
import cv2
class ReproPlots:
def __init__(self, reprojection_filename):
load_reprojections(reprojection_filename)
return
def load_reprojections(self, reprojection_filename):
self.reprojections = pd.read_hdf(reprojection_filename)... |
import sys
import logging
# def get_logger():
# logger = logging.getLogger()
# logger.setLevel(logging.DEBUG)
#
# handler = logging.StreamHandler(sys.stdout)
# handler.setLevel(logging.DEBUG)
# formatter = logging.Formatter('stakater-network-logger %(asctime)s - %(message)s')
# handler.setFor... |
"""
This is the custom function interface.
You should not implement it, or speculate about its implementation
class CustomFunction:
# Returns f(x, y) for any given positive integers x and y.
# Note that f(x, y) is increasing with respect to both x and y.
# i.e. f(x, y) < f(x + 1, y), f(x, ... |
from .fpga_state import FPGA_state
import numpy as np
import asyncio
from time import time
from numba import jit
class Device(object):
def __init__(self, config, fpga, debug=False, dashboard=None):
self.maxitemsize = 8
#self.chunk_array = [np.empty(shape=(config.config['mem_depth'],), dtype=f'uint{... |
import attr
from airflow.version import version as AIRFLOW_VERSION
from marquez_airflow import __version__ as MARQUEZ_AIRFLOW_VERSION
from openlineage.facet import BaseFacet
from typing import Optional, Dict
@attr.s
class AirflowVersionRunFacet(BaseFacet):
operator: str = attr.ib()
taskInfo: str = attr.ib()
... |
from suds.client import Client as SudsClient
from suds.sax.element import Element
"""
default "UsernameToken" in suds produces "Password" element without a "Type" field
https://fedorahosted.org/suds/ticket/402
so need to build it manually, specifying namespaces
"""
wsse = ('wsse', 'http://docs.oasis-open.... |
import random
import numpy as np
import skimage.color as sc
import torch
def get_patch(*args, patch_size=96, scale=1, multi=False, input_large=False):
ih, iw = args[0].shape[:2]
print('heelo')
print(args[0].shape)
if not input_large:
p = 1 if multi else 1
tp = p * patch_size
... |
"""OAuth support for provider."""
from datetime import datetime, timedelta
from flask import jsonify, render_template, request
from flask_login import current_user, login_required
from . import app, oauth
from .models import Client, Grant, Token
@oauth.clientgetter
def load_client(client_id): # noqa: D103
try... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
import asyncio
from collections import defaultdict
from discord.ext import commands
from tle.util import cses_scraper as cses
from tle.util import table
from tle.util import tasks
def score(placings):
points = {1: 8, 2: 5, 3: 3, 4: 2, 5: 1}
# points = {1:5, 2:4, 3:3, 4:2, 5:1}
return sum(points[rank] for... |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
Tested with CircuitPython 6.3.0
Hardware:
- Maker Pi RP2040 https://my.cytron.io/p-maker-pi-pico
- M5Stack ToF VL53L0X Sensor Unit https://my.cytron.io/p-m5stack-tof-vl53l0x-sensor-unit
- RC Servo Motor (Metal Gear) http... |
from functools import reduce
from itertools import permutations
from typing import Dict
from typing import Optional
from typing import Tuple
import logging
import torch
from torch_complex.tensor import ComplexTensor
from typeguard import check_argument_types
from espnet2.enh.abs_enh import AbsEnhancement
from espnet2.... |
import os
import torch
import torchvision
import numpy as np
from PIL import Image, ImageOps
from torch.utils.data import Dataset, DataLoader
class OCRDataset(Dataset):
def __init__(self, root_dir, transform=None):
self.root_dir = root_dir
files = os.listdir(self.root_dir)
self.items = lis... |
"""Collection of algebraic objects extending :mod:`~qalgebra.core`"""
__known_refs__ = {}
|
import torch
def save_model(model, optimizers, training_history, meta_data, condition_encoding, model_creation_args, filename):
optimizers_states = {}
for name, opt in optimizers.items():
if opt is None :
optimizers_states[name] = None
else :
optimizers_states[name] = {... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from metrics import power
from telemetry.page import page_test
class Power(page_test.PageTest):
def __init__(self):
super(Power, self).__init__('RunPo... |
# 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, software
# d... |
from __future__ import annotations
import logging
from random import Random
from typing import TYPE_CHECKING
import itertools as it
from cached_property import (
cached_property,
)
from .abc import (
InsertionIterator,
)
if TYPE_CHECKING:
from typing import (
Iterator,
)
from .....models... |
import collections
import itertools
import json
import os
import attr
import nltk.corpus
import torch
import torchtext
import numpy as np
from tensor2struct.models import abstract_preproc
from tensor2struct.utils import serialization, vocab, registry
from tensor2struct.modules import rat, lstm, embedders, bert_tokeni... |
## Time Series Filters
from __future__ import print_function
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
dta = sm.datasets.macrodata.load_pandas().data
index = pd.Index(sm.tsa.datetools.dates_from_range('1959Q1', '2009Q3'))
print(index)
dta.index = index
del dta['year']
del... |
"""
This file offers the methods to automatically retrieve the graph Saccharomonospora viridis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--prot... |
Name = 'LatLonToCartesian'
Label = 'Lat Lon To Cartesian'
FilterCategory = 'CSM Geophysics Filters'
Help = 'Help for the Test Filter'
NumberOfInputs = 1
InputDataType = 'vtkTable'
OutputDataType = 'vtkTable'
ExtraXml = ''
Properties = dict(
Radius=6371.0,
lat_i=1,
lon_i=0,
)
# TODO: filter works but ass... |
# Generated by Django 3.1.4 on 2020-12-30 10:03
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('invoices_app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='invoice',
... |
from quantopian.pipeline import Pipeline, CustomFilter
from quantopian.algorithm import attach_pipeline, pipeline_output
from quantopian.pipeline.factors import Latest
from quantopian.pipeline.data.builtin import USEquityPricing
from quantopian.pipeline.data.psychsignal import aggregated_twitter_withretweets_stocktwit... |
from keras.engine.topology import Layer
from keras.layers import Lambda, Dense
from keras.engine.base_layer import InputSpec
from keras import backend as K
import tensorflow as tf
class ConstantDispersionLayer(Layer):
'''
An identity layer which allows us to inject extra parameters
such as dispers... |
#!/usr/bin/env python3
# Copyright (c) 2021 Facebook, Inc. and its affiliates.
# Copyright (c) 2020 Ross Wightman
# This file has been modified by Megvii ("Megvii Modifications").
# All Megvii Modifications are Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
"""AutoAugment and RandAugment
AutoAugment: `"AutoA... |
"""Generate Matlab interface for C code to solve a problem using the ALM"""
import os
from muaompc._ldt.codegen.solver.alm.codegen import CCodeGenerator as CCG
class MatlabCodeGenerator(CCG, object):
"""Generate Matlab code to interface with C code of the solver.
This class overrides the following methods... |
from tornado.web import HTTPError
import datetime
import threading
from astral.api.client import TicketsAPI
from astral.api.handlers.base import BaseHandler
from astral.api.handlers.tickets import TicketsHandler
from astral.models import Ticket, Node, Stream, session
import logging
log = logging.getLogger(__name__)
... |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import functools
from azure.core.credentials import AzureKeyCredential
from azure.core.exceptions import HttpResponseError, ServiceRequestError, ClientAu... |
from django.contrib.auth.decorators import user_passes_test
def logout_required(function=None, redirect_url='/'):
actual_decorator = user_passes_test(
lambda u: not u.is_authenticated,
login_url=redirect_url
)
if function:
return actual_decorator(function)
return actual_decorat... |
# TODO trim sidechains one atom at a time
from __future__ import absolute_import, division, print_function
from libtbx.str_utils import make_header
from libtbx.utils import multi_out
from libtbx import group_args
import os
import sys
from six.moves import range
model_prune_master_phil = """
resolution_factor = 1/4... |
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
class HelloWindow(BoxLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
hello = Label(text='Hello World')
self.add_widget(hello)
class HelloApp(App):
def build(self):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 fumikazu.kiyota@gmail.com
#
u"""
共通で使うモジュール類の置き場
"""
|
from typing import List, Union
import numpy as np
MIN_AUDIBLE_FREQUENCY = 20 # Hz
MAX_AUDIBLE_FREQUENCY = 20000 # Hz
NUM_CENTS_IN_OCTAVE = 1200 # cents
def hz_to_cent(hz_seq: Union[List[float], np.array],
ref_hz: Union[float, np.float],
min_hz: Union[float, np.float] = 20
... |
# Generated by Django 2.2.5 on 2019-09-15 19:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('teams', '0008_auto_20190916_0101'),
]
operations = [
migrations.AlterField(
model_name='project... |
def reverse(txt):
return txt[::-1]
def capitalize(txt):
return txt.capitalize() |
# coding: utf-8
#
# Copyright 2017 The Oppia 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 requi... |
"""Switch class."""
from onyx_client.data.device_mode import DeviceMode
from onyx_client.device.device import Device
from onyx_client.enum.device_type import DeviceType
class Switch(Device):
"""A ONYX controlled switch device."""
def __init__(self, identifier: str, name: str, device_type: DeviceType):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Zhihu Session
[Info]
Simulate Zhihu Login [Ref: https://github.com/zkqiang/Zhihu-Login]
"""
__author__ = 'qingyu-wang'
__github__ = 'https://github.com/qingyu-wang/zhihu'
import base64
import getpass
import hashlib
import hmac
import io
import json
import os
impo... |
# Copyright (c) 2013 OpenStack Foundation.
# 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... |
#!/usr/bin/env python3
""" 音声情報処理 n本ノック !! """
# MIT License
# Copyright (C) 2020 by Akira TAMAMORI
# 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... |
from configsimple import topconfig, flag
class Component1:
@staticmethod
def configsimple(config=None, component="comp1"):
myconf = config or topconfig.get_config(component=component)
myconf.add_argument("--sub1.sub2.foo", default="22", type=int, help="The FOO setting!")
myconf.add_arg... |
import os
from os.path import expanduser
from xml.etree import ElementTree
import requests
from requests_futures.sessions import FuturesSession
from bayleef import USGS_API, USGSError
from bayleef import xsi, payloads
TMPFILE = os.path.join(expanduser("~"), ".usgs")
NAMESPACES = {
"eemetadata": "http://earthexp... |
"""
REST API Documentation for TheOrgBook
TheOrgBook is a repository for Verifiable Claims made about Organizations related to a known foundational Verifiable Claim. See https://github.com/bcgov/VON
OpenAPI spec version: v1
Licensed under the Apache License, Version 2.0 (the "License");
... |
# Copyright (c) 2020 PaddlePaddle 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 applic... |
# coding: utf-8
"""
Account Management API
API for managing accounts, users, creating API keys, uploading trusted certificates
OpenAPI spec version: v3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class Ac... |
# Copyright 2012 by Wibowo Arindrarto. All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Bio.SearchIO pars... |
import sys
import functools
import inspect
import re
import oauth2 as oauth
import urllib.error
import urllib.parse
import urllib.request
import evernote.edam.userstore.UserStore as UserStore
import evernote.edam.notestore.NoteStore as NoteStore
import evernote.edam.userstore.constants as UserStoreConstants
import t... |
# Copyright 2017 reinforce.io. 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... |
# coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... |
"""Formatting numbers."""
import copy
from typing import Dict
from babel.core import Locale # type: ignore
from babel.core import UnknownLocaleError
from beancount.core.display_context import Precision
from beancount.core.number import Decimal
from fava.core.fava_options import OptionError
from fava.core.module_base... |
import os
import sys
print("HELLO")
sys.path.insert(0, os.path.join(os.getcwd(), os.pardir))
print(sys.path[0])
sys.path.insert(0, os.getcwd())
print(sys.path[0])
|
import sys
import json
import collections
def gen_lef_data(data, fp, macro_name, cell_pin, bodyswitch):
def s(x):
return "%.4f" % (x/10000.0)
fp.write("MACRO %s\n" % macro_name)
fp.write(" ORIGIN 0 0 ;\n")
fp.write(" FOREIGN %s 0 0 ;\n" % macro_name)
fp.write(" SIZE %s BY %s ;\n" % (s... |
from _pydev_runfiles import pydev_runfiles_xml_rpc
import pickle
import zlib
import base64
import os
import py
from pydevd_file_utils import _NormFile
import pytest
import sys
import time
#=========================================================================
# Load filters with tests we should skip
#=============... |
import pytest
import responses
from django.contrib.auth.models import User
from mc2.controllers.base.tests.base import ControllerBaseTestCase
@pytest.mark.django_db
class StatesTestCase(ControllerBaseTestCase):
fixtures = ['test_users.json', 'test_social_auth.json']
def setUp(self):
self.user = Use... |
# -*- coding: utf-8 -*-
'''
© Warbot v`1
'''
from important import *
from thrift.unverting import *
from thrift.TMultiplexedProcessor import *
from thrift.TSerialization import *
from thrift.TRecursive import *
from thrift import transport, protocol, server
from random import randint
from multiprocessing import Pool, P... |
import asyncio
import gzip
import json
import random
import socket
import string
import sys
import threading
from collections import OrderedDict, defaultdict
from contextlib import contextmanager
from queue import Queue
from google.protobuf import json_format
from sanic import Sanic, response
from signalfx.generated_p... |
# darkMed = darks_flat_med_axis0 - np.min(darks_flat_med_axis0)
# darksMed_scaled = darks_flat_med_axis0 / median(darks_flat_med_axis0)# pp.scale(darks_flat_med_axis0)
diff_darks_flat_med_axis0 = np.zeros(darks_flat_med_axis0.size)
diff_darks_flat_med_axis0[1:] = diff(darks_flat_med_axis0)
quirk_features = []
f... |
import requests
import os
import pandas as pd
import time
logs_folder = os.path.join(os.getcwd(), 'logs/')
extra_info_log = os.path.join(logs_folder, 'extra_info/')
channel_info_log = os.path.join(logs_folder, 'channel_info/')
class TwitchAPIBot():
def __init__(self, token, client_id, refresh_interval=60):
... |
import unittest
from app .models import Lawyers
class LawyerModelTest(unittest.TestCase):
def setUp(self):
self.new_lawyer = Lawyers(password = 'pass')
def test_password_setter(self):
self.assertTrue(self.new_lawyer.hash_pass is not None)
def test_no_access_password(self):
with self.... |
from typing import List
from pyfileconf.sectionpath.sectionpath import SectionPath
accepted_name_attrs = ['name', '__name__']
output_accepted_name_attrs = ['output_name'] + accepted_name_attrs
def _get_from_nested_obj_by_section_path(obj, section_path: SectionPath, prevent_property_access: bool = False):
"""
... |
# coding: UTF-8
if __name__ == '__main__':
for i in reversed(range(11)):
for _ in range(i+1):
print('●', end='')
print('')
print('')
for i in range(11):
for _ in range(i+1):
print('●', end='')
print('')
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
args = '<model model ...>'
help = 'Restore the primary ordering fields of a model containing a special ordering... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.