text stringlengths 2 999k |
|---|
from cyder.base.views import cy_render, cy_view, search_obj, table_update
def core_view(request, pk=None):
return cy_view(request, 'core/core_view.html', pk)
def core_search_obj(request):
return search_obj(request)
def core_table_update(request, pk, obj_type=None):
return table_update(request, pk, obj... |
import cv2
import argparse
import matplotlib.pyplot as plt
import numpy as np
import time
# all function for detecting line segment and angle
from angleDetector import angleDetector
def main(img_path ):
start_time = time.time()
try:
img = cv2.imread(img_path, 0 )
h,w = img.shape # needed to p... |
import re
import unittest
# This has to occur post ClickTestCase
import click
from metamodel.generators.contextgen import cli
from tests.test_scripts.clicktestcase import ClickTestCase
update_test_files = False
def json_metadata_filter(s: str) -> str:
...
return re.sub(r'Auto generated from .*? by', 'Auto ... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_2
from i... |
from __future__ import unicode_literals, division, absolute_import
import os
import pytest
import stat
from flexget.entry import EntryUnicodeError, Entry
class TestDisableBuiltins(object):
"""
Quick a hack, test disable functionality by checking if seen filtering (builtin) is working
"""
config ... |
# Copyright (c) 2021 - present / Neuralmagic, 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 b... |
"""
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com>
# Fabian Pedregosa <fabian@fseoane.net>
# Michael Eickenberg <michael.eickenberg@nsup.org>
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
impor... |
"""
This file contains animation classes that just write text to the screen, like
in definitions or theorem statements.
:Authors:
- William Boyles
"""
from manim import *
class DrawZoneTheoremStatement(Scene):
"""
This animation states the zone theorem.
"""
def construct(self):
""":meta... |
import os, dotenv
dotenv.load_dotenv()
DATABASE_URL = os.getenv('DATABASE_URL')
GA_TRACKING_ID = os.getenv('GA_TRACKING_ID')
APP_NAME = 'Whatsapp Chat Analyzer'
LOGO = '/assets/logo.png'
FONT_AWESOME = 'https://use.fontawesome.com/releases/v5.10.2/css/all.css'
SOURCE_CODE_URL = 'https://github.com/irfanchahyadi/Whatsa... |
import re
from types import FunctionType
from rest_framework import serializers
class ValidationsRegex:
POSITIVE_INTEGER_REGEX = r'^[0-9]\d*$'
DATETIME_REGEX = r'^(\d{4}\-\d{1,2}\-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2})$'
DATE_REGEX = r'^(\d{4}\-\d{1,2}\-\d{1,2})$'
JWT_REGEX = r'^[A-Za-z0-9-_=]+\.[A-Za-z0-9... |
with open("day2_input.txt") as f:
instructions = f.readlines()
horizontal_pos = 0
depth_pos = 0
for instruction in instructions:
match instruction.split():
case ["forward", units]:
horizontal_pos += int(units)
case ["down", units]:
depth_po... |
def solution(A):
h = set(A)
l = len(h)
for i in range(1, l+1):
if i not in h:
return i
return -1
# final check
print(solution([1, 2, 3, 4, 6]))
|
# Generated by Django 2.0.2 on 2018-03-11 12:49
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('images', '0001_initial')... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 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
#
# Unl... |
import tensorflow as tf
import numpy as np
import pandas as pd
import pickle
import random
import os
class Simulator(object):
def __init__(self):
# Model Load
self.cur_path = os.path.abspath(os.path.curdir)
self.kpi_model = tf.keras.models.load_model(self.cur_path + '/Models/KPI_model_best.... |
# Copyright (c) 2016 The UUV Simulator 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 b... |
"""create_price_table
Revision ID: 1e8d27922f56
Revises: 9254559dcac2
Create Date: 2018-05-28 13:30:54.227839
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "1e8d27922f56"
down_revision = "9254559dcac2"
branch_labels = None
depends_on = None
def upgrade():
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, PT DAS and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestSmelter(unittest.TestCase):
pass
|
#!/usr/servers/env python
# -*- coding: utf8 -*-
#
# $Id$
#
# Copyright (c) 2012-2014 "dark[-at-]gotohack.org"
#
# This file is part of pymobiledevice
#
# pymobiledevice is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fou... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'codenamesbot'
DESCRIPTION = 'Cod... |
from rest_framework import serializers
from core.models import Tag, Ingredient, Recipe
#The main function of serializers is to render the available information into formats that
# can be easily accessible and utilised by the frontend.
class TagSerializer(serializers.ModelSerializer):
"""Serializer for tag object"... |
# -*- coding: utf-8 -*-
"""
Reading and writing from KlustaKwik-format files.
Ref: http://klusters.sourceforge.net/UserManual/data-files.html
Supported : Read, Write
Author : Chris Rodgers
TODO:
* When reading, put the Unit into the RCG, RC hierarchy
* When writing, figure out how to get group and cluster if those a... |
from unittest.mock import MagicMock, patch
import pytest
from mlagents.tf_utils import tf
from mlagents.trainers.trainer_controller import TrainerController
from mlagents.trainers.ghost.controller import GhostController
from mlagents.trainers.sampler_class import SamplerManager
@pytest.fixture
def basic_trainer_cont... |
import os
filename = "tmp.txt"
# copy ADB path to a file
os.system( "which adb > " + filename )
# form 2-pair of the result
lines = tuple( open(filename, 'r') )
adb_path = lines[0]
if adb_path is None:
print "ADB path not found"
else:
adb_path = adb_path.strip()
print "\nADB path ", adb_path
kill_command = "su... |
# -*- coding: utf-8 -*-
#
# This file is part of s4d.
#
# s4d is a python package for speaker diarization.
# Home page: http://www-lium.univ-lemans.fr/s4d/
#
# s4d is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Fo... |
import copy
import numpy as np
from scipy.spatial.transform import Rotation
from .serialization import to_dict, from_dict
from .vector import *
class MatrixTransform(object):
def __init__(self, transform_matrix=None, parent=None, grid_size=None, static=False):
if transform_matrix is not None:
self._ma... |
from enum import Enum
class Fuckult(Enum):
FAIS = 1
GEF = 2
EF = 3
MTF = 4
MSF = 5
|
import lit.formats
import lit.TestRunner
# Custom format class for static analyzer tests
class AnalyzerTest(lit.formats.ShTest):
def __init__(self, execute_external, use_z3_solver=False):
super(AnalyzerTest, self).__init__(execute_external)
self.use_z3_solver = use_z3_solver
def execute(self,... |
#
# Duplicates songs plugin.
#
# Copyright (C) 2012, 2011 Nick Boultbee
#
# Finds "duplicates" of songs selected by searching the library for
# others with the same user-configurable "key", presenting a browser-like
# dialog for further interaction with these.
#
# This program is free software; you ca... |
from pydub import AudioSegment
#open audio track file
audio_track=AudioSegment.from_file("sample_track.mp3")
song_length,song_name=[],[]
#store details of song (could be done in a single list)
for i in range(int(input("Enter number of songs, and then duration(in seconds) and name of each song \n"))):
... |
import tensorflow as tf
#from tensorflow.contrib.hccl.python.ops import hccl_ops
from npu_bridge.hccl import hccl_ops
class Layers:
def get_accuracy(self, labels, predicted_classes, logits, config):
accuracy = tf.metrics.accuracy(
labels=labels, predictions=predicted_classes)
top5acc... |
""" Activity.
Do not edit this file by hand.
This is generated by parsing api.html service doc.
"""
from ambra_sdk.exceptions.service import FilterNotFound
from ambra_sdk.exceptions.service import InvalidCondition
from ambra_sdk.exceptions.service import InvalidField
from ambra_sdk.exceptions.service import InvalidSor... |
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register('hello-viewset', views.HelloViewSet, base_name = 'hello-viewset')
# because of model don't need base_name
router.register('profile', views.UserProfileViewSet)
router.regi... |
# Copyright (c) 2016, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... |
# Copyright (c) 2016 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 datetime import datetime
import docker
import mock
import unittest
from infra.services.android_docker import containers
class FakeDevice(object):... |
# Copyright 2017 Tufin Technologies Security Suite. 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... |
from maneuverRecomadEngine.escore.core import ESCore
from maneuverRecomadEngine.escore.pyQueryConstructor import QueryConstructor
import math
import sys
import json
def test():
#testConnection = ESCore('85.120.206.38')
testConnection = ESCore('85.120.206.38', index="maneuver2")
# print(testConnection.clu... |
"""
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import unittest
import time... |
#!/usr/bin/env python
"""
This action will force a whole file sync on the given volumes
"""
from libsf.apputil import PythonApp
from libsf.argutil import SFArgumentParser, GetFirstLine, SFArgFormatter
from libsf.logutil import GetLogger, logargs
from libsf.sfcluster import SFCluster
from libsf.util import ValidateAndD... |
import streamlit as st
import pandas as pd
import numpy as np
from patsy import dmatrices
import statsmodels.api as sm
from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error
from statsmodels.sandbox.regression.predstd import wls_prediction_std
import matplotlib as mpl
import matplotlib.pyplot a... |
# -*- coding: utf-8 -*-
from .session_event import SessionEvent
class SessionObserverProtocol:
async def update(self, event: SessionEvent): # pragma: nocover
...
|
import re
import html
import pandas as pd
re1 = re.compile(r' +')
def imdb(fold_id: int, split_size: int):
df = pd.read_pickle('df_train.pkl')
df = df.reindex(columns=['sentiment', 'text'])
df['text'] = df['text'].apply(fixup)
# Split the data into k-folds.
df_val = df[split_size * fold_id:split... |
from animation import Animation
from core.utilities import logging_handler_setup
from panel_utils import fmap
from scipy import signal
import numpy as np
import time
import colorsys
import random
class FaceSection():
def __init__(self, length=10,section='left'):
self.length = length
self.sectio... |
# aux.py
# auxiliary functions
# Copyright 2019 Ji Hyun Bak
import numpy as np
import pandas as pd
# for stat
from scipy.sparse import coo_matrix
from scipy import stats
# for io
import csv
# for plot
import matplotlib as mpl
import matplotlib.pyplot as plt
# === ds: custom data structure
class Tray:
''' em... |
import sys
if __name__ == '__main__':
file = sys.argv[1]
sents = {}
with open(file, 'r') as fd:
for _ in range(5):
fd.readline()
for line in fd:
if line.startswith('|'):
break
elif line.startswith('S-'):
id = line.split('\t')[0].split('-')[1]
elif line.star... |
# -*- coding: utf-8 -*-
"""
pagarmeapisdk
This file was automatically generated by APIMATIC v3.0 (
https://www.apimatic.io ).
"""
from pagarmeapisdk.api_helper import APIHelper
from pagarmeapisdk.models.get_subscription_item_response import GetSubscriptionItemResponse
from pagarmeapisdk.models.get_subscrip... |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.core.goals.package import OutputPathField
from pants.engine.target import (
COMMON_TARGET_FIELDS,
DictStringToStringField,
Sources,
SpecialCasedDependencies,
... |
import weakref
from datetime import datetime, timedelta
from itertools import chain
import pytz
from flask import request
from flask_login import current_user
from flask_wtf import FlaskForm as Form
from flask_wtf.file import FileAllowed
from flask_wtf.file import FileField as FileField_wtf
from notifications_utils.co... |
#-------------------------------------------------------------------------------
# Import Libraries
#-------------------------------------------------------------------------------
from rosalindLibrary.loaders.rosalindLoader import rosalindLoader
#------------------------------------------------------------------------... |
import sys
import pandas as pd
def main():
file1 = sys.argv[1]
file2 = sys.argv[2]
join_on = sys.argv[3]
df1 = pd.read_csv(file1)
df2 = pd.read_csv(file2)
join_fieds = join_on.split(',')
df = df1.merge(df2, on=join_fieds, how='outer')
df.to_csv("output.csv")
if __name__ == "__main__":
main()
|
"""Defines functions for getting basic job errors"""
from __future__ import unicode_literals
from __future__ import absolute_import
from error.models import get_builtin_error
def get_invalid_manifest_error():
"""Returns the error for invalid results manifest
:returns: The invalid results error
:rtype: :... |
import _plotly_utils.basevalidators
class TitlefontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name='titlefont',
parent_name='layout.polar.radialaxis',
**kwargs
):
super(TitlefontValidator, self).__init__(
plotly_na... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/dev-05-price-moe.ipynb (unless otherwise specified).
__all__ = ['construct_dispatchable_lims_df', 'construct_pred_mask_df', 'AxTransformer', 'set_ticks', 'set_date_ticks',
'construct_df_pred', 'construct_pred_ts', 'calc_error_metrics', 'get_model_pred_ts', 'we... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-20 04:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('manager', '0003_auto_20160424_1803'),
]
operations = [
migrations.AddField(
... |
numbers = list(range(1, 1000001))
print(min(numbers))
print(max(numbers))
print(sum(numbers))
|
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
import argparse
import os
import tensorflow as tf
from Model_lib import pix2pix_generator
from train import pix2pix
from glob import glob
from utils import *
from logger import setup_logger
from PIL import Image
parser = argparse.ArgumentParser(description='')
parser.add_argument('--dataset_name', dest='dataset_name', ... |
import numpy as np
import cv2
import pyopengv
import logging
from timeit import default_timer as timer
from collections import defaultdict
from opensfm import csfm
from opensfm import context
from opensfm import log
from opensfm import multiview
from opensfm import pairs_selection
from opensfm import feature_loader
... |
# Copyright 2021 Juan L Gamella
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2.... |
import numpy as np
def sigmoid(x):
"""
Calculate sigmoid
"""
return 1/(1+np.exp(-x))
def sigmoid_prime(x):
"""
# Derivative of the sigmoid function
"""
return sigmoid(x) * (1 - sigmoid(x))
learnrate = 0.5
x = np.array([1, 2, 3, 4])
y = np.array(0.5)
# Initial weights
w = np.array([0.... |
# Copyright (C) 2017-2020 Trent Houliston <trent@houliston.me>
#
# 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, mod... |
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... |
# -*- coding: utf-8 -*-
import json
import requests
import urllib
import logging
try: # Python 2.x
import urlparse
except ImportError as e: # Python 3
import urllib.parse as urlparse
from auth import FHIRAuth
FHIRJSONMimeType = 'application/fhir+json'
logger = loggi... |
#!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
##
# 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 ... |
# -*- coding: utf-8 -*-
import datetime, time
import concurrent.futures
import unittest
from freezegun import freeze_time
from src.statistics import WarmUpStatistics, ResponseStatistics, Statistics
HTTP_OK = 200
AVERAGE_TIME_MILLISECONDS = 254
def test_should_add_counter_increase():
rst = ResponseStatistics(HT... |
#!/usr/bin/env python
# Copyright 2018 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
import os, sys
import threading
import pipes
import subprocess
import inspect
import time
imp... |
import datetime
from dateutil.relativedelta import relativedelta
import urllib
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse, reverse_lazy
from django.db import ... |
import io
import sys
from setuptools import setup, find_packages
version_info_major = sys.version_info[0]
if version_info_major == 3:
long_description = open('README.rst', encoding="utf8").read()
else:
io_open = io.open('README.rst', encoding="utf8")
long_description = io_open.read()
setup(
name="jso... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Dashboards',
'version': '1.0',
'category': 'Extra Tools',
'summary': 'Create your custom dashboard',
'description': """
Lets the user create a custom dashboard.
============================... |
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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... |
import time
import requests
from bs4 import BeautifulSoup
from crawlers.generic import BaseCrawler
from settings import BEGIN_CRAWL_SINCE
class ThugLifeMemeCrawler(BaseCrawler):
def __init__(self, *args, **kwargs):
super(ThugLifeMemeCrawler, self).__init__(source='thug_life_meme', *args, **kwargs)
... |
import dash
import numpy as np
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
from app import app
import plotly.graph_objs as go
import json
import codecs
from scipy.integrate import simps
import csv
impor... |
from typing import List
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.engine import Engine
from sqlalchemy.orm import Session
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String
from schemas.zarubaEntityName import ZarubaEntityName, ZarubaEntityNameData
from repos.zar... |
import asyncio
import dataclasses
import logging
import random
import time
import traceback
from datetime import datetime
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
import aiosqlite
from blspy import AugSchemeMPL
import staidelta.server.ws_connection as ws # lg... |
# encoding: utf-8
"""
@author: liaoxingyu
@contact: sherlockliao01@gmail.com
"""
import torch
import numpy as np
from PIL import Image, ImageOps
import threading
import queue
from torch.utils.data import DataLoader
from fastreid.utils.file_io import PathManager
def read_image(file_name, format=None):
"""
R... |
"""Base class for models."""
import abc
import tensorflow as tf
from opennmt import optimizers, schedules
from opennmt.utils import compat, exporters, losses, misc
class Model(tf.keras.layers.Layer):
"""Base class for models."""
def __init__(self, examples_inputter):
super().__init__()
sel... |
import click
from tabulate import tabulate
from dockertop.__version__ import __version__
def truncate(text, width=15, placeholder="..."):
w = width - len(placeholder)
return (text[:w] + placeholder) if len(text) > width else text
def modify_info(data):
ret = []
for r in data:
del r[6:12]
... |
#!/usr/bin/python3
"""
Primary module
"""
# pylint: disable=wildcard-import
import logging
import signal
from time import time, sleep
from threading import Thread, Event
from yaml import load, FullLoader
import typing as tp
import humanfriendly
import argparse
from pymeterreader.device_lib import BaseReader, Sample, st... |
## @file
# generate flash image
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license m... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 18 14:32:41 2019
@author: firo
"""
import numpy as np
import skimage.morphology
from scipy import ndimage as ndi
import os
from skimage import measure
import matplotlib.pyplot as plt
plt.ioff()
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
def low_pass_rule(x,f... |
from veracode.SDK.core import Base
class GetMinigationInfo(Base):
""" class: veracode.SDK.mitigation.GetMinigationInfo
params:
flaw_id_list: required
build_id: required
returns: A python object that represents the returned API data.
"""
def __init__(self,
flaw_id_list,
... |
#!/usr/bin/env python
from __future__ import absolute_import, unicode_literals
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.proj.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
"""
Copyright 2019, the CVXPY developers.
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, ... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appli... |
#!/usr/bin/env python
def igs_test(dry_run, target_dir, exp_name, group='', param_l=[]):
from scripts.conf.conf import machine_info
from scripts.pluto.pluto_utils import run_pluto_test
import itertools, os, pickle
from os.path import join as jpath
target_dir = jpath(os.path.abspath("."),target_dir)
# ma... |
from django.db import models
# Create your models here.
class Book(models.Model):
isbn = models.CharField(primary_key=True, max_length=64)
title = models.CharField(max_length=64)
author = models.CharField(max_length=64)
year = models.IntegerField()
def __str__(self):
return f"{self.isb... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
import torch
from reagent.evaluation.cpe import (
CpeEstimate,
CpeEstimateSet,
bootstrapped_std_error_of_mean,
)
from reagent.evaluation.evaluation_data_page import EvaluationDataPage
from reagent... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Oracle and/or its affiliates.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
DOCUMENTATION = """
... |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import OrderedDict
from functools import singledispatch
from .array import is_numeric_array
from .op import trace_ops
from .program import OpProgram
def _debug(x):
return f"{type(x).__module__.split('.')[0]}.{ty... |
# -*- coding: utf-8 -*-
import string
from boltons.cacheutils import LRU, LRI, cached, cachedmethod, cachedproperty
class CountingCallable(object):
def __init__(self):
self.call_count = 0
def __call__(self, *a, **kw):
self.call_count += 1
return self.call_count
def test_lru_add():... |
"""
Prime Developer Trial
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.B... |
"""Command line logging daemon"""
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import logging
import os.path
import sys
from pkg_resources import get_distribution
from multilog.receivers import DEFAULT_HOST, DEFAULT_PORT, LogReceiver
__version__ = get_distribution('multil... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Install script for sktime."""
# adapted from https://github.com/scikit-learn/scikit-learn/blob/master
# /setup.py
####################
# Helpers for OpenMP support during the build.
# adapted fom https://github.com/scikit-learn/scikit-learn/blob/master
# /sklearn/_b... |
from datetime import date, timedelta
import os
from scipy import optimize
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
import matplotlib.ticker as ticker
def download_data(data_path):
"""
This function download data from MZCR, form single dataframe, store it and return it.
:para... |
#!/usr/bin/env python
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
# pylint: disable=bad-indentation,docstring-section-in... |
from os import path
from funpackager.loader.notFoundConfigException import NotFoundConfigException
class AbstractLoader(object):
def __init__(self, config_file=''):
if config_file != '':
self.set_config_file(config_file)
self._config_file = config_file
def set_config_file(self, c... |
#GMM Cluster Parsing for Count Transitions
import matplotlib.pyplot as plt
def reverse(coord_pair):
store_1 = coord_pair[1]
store_2 = coord_pair[4]
rev_coords = '(' + store_1 + ', ' + store_2 + ')'
return rev_coords
def count_unique_trans(pred):
transition_dict = {}
for i in range(len(pr... |
from scipy.spatial.distance import euclidean
from scipy.spatial import Delaunay
import numpy as np
#Calculating accessibility and neighbourhood of residues based on the idea presented in:
#Detection of Functionally Important Regions in “Hypothetical Proteins” of Known Structure
rad_siz = {'ALAN':1.65, 'ALACA':1.87, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.