text
string
size
int64
token_count
int64
import sys from PySide2.QtWidgets import QApplication from PySide2.QtGui import QColor from pivy import quarter, coin, graphics, utils class ConnectionMarker(graphics.Marker): def __init__(self, points): super(ConnectionMarker, self).__init__(points, True) class ConnectionPolygon(graphics.Polygon): s...
3,113
1,180
""" Functions used in pre-processing of data for the machine learning pipelines. """ import pandas as pd from pandas.api.types import is_scalar from pathlib import Path from sklearn.model_selection import GroupShuffleSplit def concat_annotated(datadir): """ Concatenate all "annotated_df_*_parsed*.pkl" files...
4,673
1,548
import numpy as np np.deprecate(1) # E: No overload variant np.deprecate_with_doc(1) # E: incompatible type np.byte_bounds(1) # E: incompatible type np.who(1) # E: incompatible type np.lookfor(None) # E: incompatible type np.safe_eval(None) # E: incompatible type
276
110
import time from colorama import Fore, Back, Style import speech_recognition as sr import os import pyttsx3 import datetime from rich.progress import Progress python = pyttsx3.init("sapi5") # name of the engine is set as Python voices = python.getProperty("voices") #print(voices) python.setProperty("voice...
6,115
1,882
# Generated by Django 3.1.7 on 2021-05-06 23:57 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('mentorships', '0001_initial'), ('activities', '0007_activity_enrollment'), ] operations = [ migrati...
702
229
import numpy as np import pandas as pd from scipy import signal,stats from flask import Flask,request,jsonify import json import re import os import data_utils as utils import sklearn.preprocessing as pre configpath=os.path.join(os.path.dirname(__file__),'config.txt') try: config = utils.py_configs...
2,330
822
import torch import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib.legend_handler import HandlerTuple from matplotlib.ticker import FormatStrFormatter #from tqdm import tqdm matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 plt.rc('xtick', labelsize=...
13,708
4,978
""" lambdata - a collection of Data Science helper functions """ import pandas as pd import sklearn
100
27
""" pyJsConsole wrapper. © Anime no Sekai - 2020 """ from .internal.javascript import classes as JSClass console = JSClass._Console() document = JSClass._Document() history = JSClass._History() Math = JSClass._Math() navigator = JSClass._Navigator() screen = JSClass._Screen() window = JSClass._Window() browser = JSC...
1,554
444
#!/usr/bin/env python """Tests the client file finder action.""" import collections import glob import hashlib import os import platform import shutil import subprocess import unittest import mock import psutil import unittest from grr.client import comms from grr.client.client_actions import file_finder as client_f...
45,528
16,153
from django.db import models # Create your models here. from django.db import models from users.models import UserProfile class Deploy(models.Model): STATUS = ( (0, '申请'), (1, '审核'), (2, '上线'), (3, '已取消'), (4, '已上线'), (5,'失败') ) name = models.CharField(m...
1,624
587
Client_ID = "<Your Client ID>" Authorization = "Bearer <Insert Bearer token Here>"
83
25
import socket host = 'localhost' # we need to define encode function for converting string to bytes string # this will be use for sending/receiving data via socket encode = lambda text: text.encode() # we need to define deocde function for converting bytes string to string # this will convert bytes string sent/reci...
1,900
523
from typing import Optional from my_collection.paxos.common import NodeId, Router, ProposalId, Value, PrepareRequest, is_majority, PrepareResponse, \ Proposal, ProposeRequest, ProposeResponse, CODE_OK class Proposer: node_id: NodeId acceptor_id_list: list[NodeId] router: Router current_proposal_i...
2,247
695
# @lc app=leetcode id=749 lang=python3 # # [749] Contain Virus # # https://leetcode.com/problems/contain-virus/description/ # # algorithms # Hard (49.14%) # Likes: 190 # Dislikes: 349 # Total Accepted: 7.5K # Total Submissions: 15.2K # Testcase Example: '[[0,1,0,0,0,0,0,1],[0,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,1],[0,...
6,551
2,387
import json import os.path import socket import subprocess from pydub import AudioSegment from typing import Dict, List class RCClient(object): """ RobotControllerを操作するためのクラス """ def __init__(self, host:str, speech_port=22222, pose_port=22223, read_port=22224): self.host = host self.sp...
4,309
1,667
import math class Point (object): # constructor def __init__ (self, x = 0, y = 0): self.x = x self.y = y # get the distance to another Point object def dist (self, other): return math.hypot (self.x - other.x, self.y - other.y) # string representation of a Point def __str__ (self): return ...
1,375
473
import pandas as pd exa = pd.read_csv('en_dup.csv') exa.loc[exa['label'] =='F', 'label']= 0 exa.loc[exa['label'] =='T', 'label']= 1 exa.loc[exa['label'] =='U', 'label']= 2 #不读取label2, 只读取0,1标签 exa0 = exa.loc[exa["label"] == 0] exa1 = exa.loc[exa["label"] == 1] exa = [exa0, exa1] exa = pd.concat(exa) exa.to_csv('...
341
193
""" Reader objects and main class for continuous data (time series) Depending on the storage format, the fitting reader is loaded and takes care of reading the files. .. todo:: unify with analyzer collection! eeg source and analyzer sink node should work together this connection should be documented w...
60,009
23,150
from restapi.connectors import Connector from restapi.env import Env from restapi.services.authentication import BaseAuthentication, Role from restapi.tests import API_URI, BaseTests, FlaskClient from restapi.utilities.logs import log class TestApp(BaseTests): def test_no_auth(self, client: FlaskClient) -> None: ...
10,463
3,037
############################################################################### # SKA South Africa (http://ska.ac.za/) # # Author: cam@ska.ac.za # # Copyright @ 2013 SKA SA. All rights reserved. # ...
70,860
19,539
# -*- coding:utf-8 -*- from django.contrib import admin from .models import UserProfile # Register your models here. class UserProfileModelAdmin(admin.ModelAdmin): """ 用户管理Model """ list_display = ('id', 'username', 'nike_name', 'mobile', 'email', 'is_active') list_filter = ('...
499
158
''' axicli.py - Command line interface (CLI) for AxiDraw. For quick help: python axicli.py --help Full user guide: https://axidraw.com/doc/cli_api/ This script is a stand-alone version of AxiDraw Control, accepting various options and providing a facility for setting default values. ''' from axicli.a...
396
134
# code jam: Qualification Round 2017: Problem C. Bathroom Stalls def read_int(): return int(raw_input()) def read_int_n(): return map(int, raw_input().split()) def get_y_z(n, k): if k == 1: if n & 1 == 0: # Even Number return n >> 1, (n >> 1) - 1 else: ...
852
324
""" Integration Tests for vmc_vm_stats execution module """ import pytest @pytest.fixture def vm_id(salt_call_cli, vmc_vcenter_connect): ret = salt_call_cli.run("vmc_sddc.get_vms", **vmc_vcenter_connect) vm_obj = ret.json[0] return vm_obj["vm"] def test_get_cpu_stats_for_vm_smoke_test(salt_call_cli,...
1,143
450
# MENTOL # At:Sun Nov 24 15:04:31 2019 if len(bytecode) == 0: print('\x1b[1;93mbyte code kosong\nharap masukkan bytecodenya\x1b[0m') exit() import marshal, sys, os, random, string, time try: from uncompyle6.main import decompile except: os.system('pip install uncompyle6') from uncompyle6.main imp...
2,134
969
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 from typing import Any, Mapping import unittest from .abstract_gremlin_proxy_tests import abstract_gremlin_proxy_test_class from .roundtrip_janusgraph_proxy import RoundtripJanusGraphProxy class JanusGraphGremlinProxyTest( ...
650
216
from builtins import str from builtins import range from builtins import object import os import fixtures import testtools from vn_test import VNFixture from vm_test import VMFixture from common.connections import ContrailConnections from policy_test import PolicyFixture from policy.config import AttachPolicyFixture f...
3,829
1,226
import hydra import torch from tqdm import tqdm from deepspeech_pytorch.configs.inference_config import EvalConfig from deepspeech_pytorch.decoder import GreedyDecoder from deepspeech_pytorch.loader.data_loader import SpectrogramDataset, AudioDataLoader from deepspeech_pytorch.utils import load_model, load_decoder @...
4,048
1,174
# pylint: disable=missing-module-docstring from fastapi import FastAPI from .routers import task, user tags_metadata = [ { 'name': 'task', 'description': 'Operations related to tasks.', }, ] app = FastAPI( title='Task list', description='Task-list project for the **Megadados** course'...
483
156
''' >List of functions 1. contain(value,limit) - contains a value between 0 to limit ''' def contain(value,limit): if value<0: return value+limit elif value>=limit: return value-limit else: return value
214
77
from data import NumericalField, CategoricalField, Iterator from data import Dataset from synthesizer import MaskGenerator_MLP, ObservedGenerator_MLP, Discriminator, Handler, ObservedGenerator_LSTM from random import choice import multiprocessing import pandas as pd import numpy as np import torch import argparse impor...
6,388
2,653
# Test the Unicode versions of normal file functions # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir import sys, os, unittest from test import support if not os.path.supports_unicode_filenames: raise unittest.SkipTest("test works only on NT+") filenames = [ 'abc', '...
4,054
1,447
import unittest import dbt.utils class TestDeepMerge(unittest.TestCase): def test__simple_cases(self): cases = [ {'args': [{}, {'a': 1}], 'expected': {'a': 1}, 'description': 'one key into empty'}, {'args': [{}, {'b': 1}, {'a': 1}], 'expecte...
1,336
384
import argparse from pathlib import Path import numpy as np import yaml # this script takes in a folder path and then recursively collects all # results.yaml files in that directory. It averages them and prints # summary statistics parser = argparse.ArgumentParser(description="Analyze the results") parser.add_argume...
1,006
321
# -*- coding: utf-8 -*- """ @author: lsl E-mail: cug_lsl@cug.edu.cn """ import sys import argparse sys.path.append("/home/aistudio/code") import torch import torch.nn as nn import torch.optim as optim import torch.utils.data as data import time from Pgnet_structure import Pg_net from Pgnet_dataset imp...
4,541
1,609
# # Copyright (c) 2014-2017 Qualcomm Atheros, Inc. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR...
14,716
6,339
from __future__ import annotations from typing import TYPE_CHECKING, Optional from ._base import TelegramObject if TYPE_CHECKING: # pragma: no cover from .location import Location class Venue(TelegramObject): """ This object represents a venue. Source: https://core.telegram.org/bots/api#venue ...
731
238
import random import argparse # TODO: Parse word lists from files words = { "codenames_adjective": [ "quantum", "loud", "red", "blue", "green", "yellow", "irate", "angry", "peeved", "happy", "slimy", "sleepy", "junior", "slicker", "united", ...
2,457
1,051
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # Andre Anjos <andre.anjos@idiap.ch> # Mon 18 Nov 21:38:19 2013 """Extension building for using this package """ import numpy from pkg_resources import resource_filename from bob.extension import Extension as BobExtension # forward the build_ext command from bob.e...
2,886
940
from robot.api.deco import keyword from robot.libraries.BuiltIn import BuiltIn class Gazebo(object): """Robot Framework test library for the Gazebo simulator See also http://gazebosim.org/tutorials/?tut=ros_comm == Table of contents == %TOC% """ ROBOT_LIBRARY_SCOPE = 'SUITE' def __init...
4,248
1,445
from ward import test, each, raises from homeassistant.core import HomeAssistant from hautomate.settings import HautoConfig from hautomate import Hautomate import pydantic from tests.fixtures import cfg_data_hauto @test('HomeAssistantConfig validates for {feed}', tags=['unit']) async def _( cfg_data=cfg_data_ha...
1,143
374
import unittest import zserio from testutils import getZserioApi class Bit4RangeCheckTest(unittest.TestCase): @classmethod def setUpClass(cls): cls.api = getZserioApi(__file__, "with_range_check_code.zs", extraArgs=["-withRangeCheckCode"]).bit4_range_check def testB...
1,186
401
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-12-11 11:46 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('MainAPP', '0029_auto_20181211_1237'), ] operations = [ migrat...
1,931
605
import numpy as np import math import time class PulsedProgramming: """ This class contains all the parameters for the Pulsed programming on a memristor model. After initializing the parameters values, start the simulation with self.simulate() Parameters ---------- max_voltage : float ...
18,954
5,809
#!/usr/bin/env python # -*- coding: utf-8 -*- # from unittest import mock # from datakit_dworld.push import Push def test_push(capsys): """Sample pytest test function with a built-in pytest fixture as an argument. """ # cmd = Greeting(None, None, cmd_name='dworld push') # parsed_args = mock.Mock() ...
462
162
import cv2 import numpy as np from scipy.interpolate import UnivariateSpline class Cool(object): """cool_filter --- This class will apply cool filter to an image by giving a sky blue effect to the input image. """ def __init__(self): # create look-up tables for increasing and decreasing red and blue resp. ...
1,742
801
import torch from metrics.swd import sliced_wasserstein_distance from evaluators.sample_evaluators.base_sample_evaluator import BaseSampleEvaluator from noise_creator import NoiseCreator class SWDSampleEvaluator(BaseSampleEvaluator): def __init__(self, noise_creator: NoiseCreator): self.__noise_...
623
210
""" Language enumeration. Part of the StoryTechnologies project. June 12, 2016 Brett Alistair Kromkamp (brett.kromkamp@gmail.com) """ from enum import Enum class Language(Enum): # https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes # https://en.wikipedia.org/wiki/ISO_639-2 ENG = 1 # English SPA...
473
194
# Generated by Django 4.0.3 on 2022-04-02 17:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('utils', '0001_initial'), ] operations = [ migrations.AlterField( model_name='electricitybilling', name='unit_price',...
899
290
""" .. module: lemur.roles.views :platform: Unix :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson <kglisson@netflix.com> """ from flask import Blueprint from flask import make_response, jsonify, abort, g from flask.e...
13,017
3,572
""" The roseguarden project Copyright (C) 2018-2020 Marcus Drobisch, This program 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 Foundation, either version 3 of the License, or (at your option) any later version. This pr...
16,454
4,233
# Copyright (c) OpenMMLab. All rights reserved. import argparse import cv2 import mmcv import numpy as np import torch from torchvision.transforms import functional as F from mmdet.apis import init_detector from mmdet.datasets.pipelines import Compose try: import ffmpegcv except ImportError: raise ImportErro...
3,892
1,292
#! /usr/bin/env python """ Benchmark the rdomset (catlas level 1) algorithm, without I/O considerations. """ import sys, os # add spacegraphcats package to import path: sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import spacegraphcats from spacegraphcats.catlas import catlas import argparse impor...
1,234
407
# ┌───────────────────────────────────────────────────────────────────────────────────── # │ PYOB SET LABEL MIXIN # └───────────────────────────────────────────────────────────────────────────────────── class PyObSetLabelMixin: """A mixin class for PyOb set label methods""" # ┌───────────────────────────────...
2,107
661
import time from hashlib import sha1 class InfArray(): def __init__(self): self.left = [0]*16 self.right = [0]*16 def getarr(self, ind): arr = self.right if ind < 0: arr, ind = self.left, -ind-1 if ind >= len(arr): arr.extend([0]* (key - len(arr) + 10)) return a...
1,547
608
import pandas as pd import os from configparser import ConfigParser, NoSectionError, NoOptionError from datetime import datetime import numpy as np import glob from simba.rw_dfs import * def analyze_process_data_log(configini,chosenlist): dateTime = datetime.now().strftime('%Y%m%d%H%M%S') config = ...
5,915
1,863
import os import re import warnings import matplotlib import matplotlib.pyplot as plt import matplotlib.image as image from matplotlib import _pylab_helpers from matplotlib.cbook import exception_to_str import seaborn from SphinxReport.Component import * from SphinxReport import Config, Utils class MatplotlibPlugin(...
3,812
965
import cv2 import imageio import numpy as np import matplotlib.pyplot as plt from itertools import product, zip_longest import seaborn as sns def grouper(n, iterable, fillvalue=None): args = [iter(iterable)] * n return zip_longest(fillvalue=fillvalue, *args) def rename(rel, prefix='new_', exclude=[]): at...
4,358
1,618
"""Various sample data""" from binascii import unhexlify magic = 0xE9BEB4D9 # These keys are from addresses test script sample_pubsigningkey = unhexlify( '044a367f049ec16cb6b6118eb734a9962d10b8db59c890cd08f210c43ff08bdf09d' '16f502ca26cd0713f38988a1237f1fc8fa07b15653c996dc4013af6d15505ce') sample_pubencrypt...
2,115
1,414
from urllib.parse import parse_qs from anticaptchaofficial.hcaptchaproxyless import hCaptchaProxyless from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from court_scraper.base.selenium_helpers import Sel...
9,123
2,881
from bitmovin_api_sdk.encoding.encodings.muxings.mp3.mp3_api import Mp3Api from bitmovin_api_sdk.encoding.encodings.muxings.mp3.customdata.customdata_api import CustomdataApi from bitmovin_api_sdk.encoding.encodings.muxings.mp3.information.information_api import InformationApi from bitmovin_api_sdk.encoding.encodings.m...
392
143
# 2022 eCTF # Bootloader Interface Emulator # Ben Janis # # (c) 2022 The MITRE Corporation # # This source file is part of an example system for MITRE's 2022 Embedded System # CTF (eCTF). This code is being provided only for educational purposes for the # 2022 MITRE eCTF competition, and may not meet MITRE standards fo...
6,107
1,876
# -*- coding: utf-8 -*- """ This is a script to demo how to open up a macro enabled excel file, write a pandas dataframe to it and save it as a new file name. Created on Mon Mar 1 17:47:41 2021 @author: Shane Gore """ import os import xlwings as xw import pandas as pd os.chdir(r"C:\Users\Shane Gore\De...
968
404
from __future__ import division import numpy as np from scipy import linalg from matplotlib import pyplot as plt from fatiando.gravmag import sphere from fatiando import mesher, gridder, utils from fatiando.vis import mpl import scipy.special import scipy.interpolate class GeometricElement(object): """ Base...
31,709
14,969
from do import DigitalOcean import argparse import json def do_play(token): do = DigitalOcean(token) # ---- # for i in range(3): # do.create_droplet(f'node-{i}', 'fra1', 'do-python') # do.wait_droplet_creation_process('do-python') # ---- # do.destroy_droplets('do-python') # ---- ...
852
310
import cPickle as pickle import pandas as pd if __name__ == '__main__': fnames = set(['clinton_tweets.json', 'trump_tweets.json']) for fname in fnames: df = pd.read_json('data/' + fname) df = df.transpose() df = df['text'] pickle.dump([(i, v) for i, v in zip(df.index, df.values...
343
133
import os import logging from flask import Flask app = Flask(__name__) @app.route('/status') def health_check(): app.logger.info('Status request successfull') app.logger.debug('DEBUG message') return 'OK - healthy' @app.route('/metrics') def metrics(): app.logger.info('Metrics request successfull')...
799
268
import FWCore.ParameterSet.Config as cms from L1Trigger.Configuration.L1TReco_cff import *
93
34
import torch.utils.data as data from PIL import Image import numpy as np import math import csv class ClassOriginaldataset(data.Dataset): def __init__(self, data_list, transform, phase, index_dict_path, dim_fc_out): self.data_list = data_list self.transform = transform self.phase = phase ...
2,347
799
import numpy as np import torch import matplotlib.pyplot as plt from icecream import ic def visualize_vector_field(policy, device, min_max = [[-1,-1],[1,1]], fig_number=1): min_x = min_max[0][0] max_x = min_max[1][0] min_y = min_max[0][1] max_y = min_max[1][1] n_sample = 100 x = np.linspace(m...
1,846
893
# Copyright (C) 2020 FireEye, 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: [package root]/LICENSE.txt # Unless required by applicable law or agreed to in writing,...
3,793
1,171
import matplotlib.pyplot as plt plt.plot() plt.show()
55
22
# -*- coding: utf-8 -*- from __future__ import annotations from tarfile import TarInfo from typing import BinaryIO, Tuple from ..base import FlexExtension class JsonDataExtension(FlexExtension): """An extension to store simple json data""" def __init__(self, header=None, data=None, cls=None): super...
1,373
434
from django import forms from .models import Project class ProjectForm(forms.ModelForm): class Meta: model = Project exclude = ['profile', 'posted_time', 'user']
185
51
# Generated from tale/syntax/grammar/Tale.g4 by ANTLR 4.8 # encoding: utf-8 from antlr4 import * from io import StringIO import sys if sys.version_info[1] > 5: from typing import TextIO else: from typing.io import TextIO def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\...
72,341
24,356
print('Olá, Mundo!') print(7+4) print('7'+'4') print('Olá', 5) # Toda variável é um objeto # Um objeto é mais do que uma variável nome = 'Gabriel' idade = 30 peso = 79 print(nome,idade,peso) nome = input('>>> Nome ') idade = input('>>> Idade ') peso = input('>>> Peso ') print(nome,idade,peso) print(f'Nome:{nom...
353
161
#Python code block to configure MAC address table entry import cps_utils #Register the attribute type cps_utils.add_attr_type('base-mac/table/mac-address', 'mac') #Define the MAC address, interface index and VLAN attributes d = {'mac-address': '00:0a:0b:cc:0d:0e', 'ifindex': 18, 'vlan': '100'} #Create a CPS object ...
680
231
# -*- coding: UTF-8 -*- ''' Created on May 14, 2014 @author: Furqan Wasi <furqan@avpreserve.com> ''' import os, datetime, sys, platform, base64 class Configuration(object): def __init__(self): # Constructor if os.name == 'posix': self.OsType = 'linux' elif os.name == 'nt': ...
4,397
1,305
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import os from pathlib import Path from datetime import datetime from PyQt5 import QtCore as qtc from PyQt5 import QtWidgets as qtw from PyQt5 import uic import numpy as np from Models import AssaysModel, SamplesModel from DB.AssaysDB import MyZODB import matpl...
17,306
5,084
# defaults.py: contains the built-in variables, events and methods # used for scripting the C program import event events = {} _event_names = ["on_start", "on_exit"] for evt in _event_names: events[evt] = event.Event()
225
73
from itertools import combinations import numpy as np import spacy import sys from spacy.tokenizer import Tokenizer import re from subprocess import PIPE, Popen import os import logging import networkx as nx import en_core_web_sm import string from neg_gv import neg_gv_list SSTDIR = "sst-light-0.4/" TEMP_DIR = "temp/...
15,526
4,849
# Imports for urn construction utility methods import logging from datahub.emitter.mce_builder import make_dataset_urn, make_tag_urn from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.emitter.rest_emitter import DatahubRestEmitter # Imports for metadata model classes from datahub.metadata.sche...
1,049
341
from __future__ import print_function from sympy import symbols, Matrix from galgebra.printer import xpdf, Format def main(): Format() a = Matrix ( 2, 2, ( 1, 2, 3, 4 ) ) b = Matrix ( 2, 1, ( 5, 6 ) ) c = a * b print(a,b,'=',c) x, y = symbols ( 'x, y' ) d = Matrix ( 1, 2, ( x ** 3, y ** 3...
517
241
"""Implements a basic flask app that provides hashes of text.""" from flask import Flask from flask_sqlalchemy import SQLAlchemy import flask_login #pylint: disable=invalid-name app = Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://yjjuylsytqewni:d0d63322c6abd33e2dadeafd...
780
337
import numpy as np; import cv2; n = 428671 img_RS_color = np.load('/home/p4bhattachan/gripper/3DCameraServer/testImages/npyFiles/{}_RS_color.npy'.format(n)) cv2.imshow('RS Color Image {}'.format(n), img_RS_color) # # # img_RS_depth = np.load('/home/p4bhattachan/gripper/3DCameraServer/testImages/npyFiles/{}_RS_depth.np...
800
353
# 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...
11,217
3,319
# Copyright 2021 Gary Stidston-Broadbent # # 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 ...
8,404
2,772
"""Resolwe SDK for Python.""" from .collection_tables import CollectionTables # noqa from .resdk_logger import log_to_stdout, start_logging # noqa from .resolwe import Resolwe, ResolweQuery # noqa
200
60
#!/tools/python/python3.8.3/bin/python import os import shutil import subprocess import numpy as np batch_list=[i*1024 for i in range(2,7)] seq_list=[10] hidden_list=[i*1024 for i in range(2,7)] vocab_list=[2048] #[int(i) for i in (2**np.linspace(10,13,20)//2*2)] layer_list=[1] bpe_list=[10] epoch_list=[3] def run_...
4,842
1,970
from .geo_utils import boundingBox import time import PIL.Image import urllib.request import mercantile import numpy as np class PlanetBoxExtractor: """ Extract bounding boxes from satellite images using Planet Tiles API @radius: distance from the center of the image to the edge in kilometers @...
8,171
2,362
from __future__ import (division, print_function) import os import ROOT #import numpy as np #import itertools #from collections import OrderedDict ROOT.PyConfig.IgnoreCommandLineOptions = True from PhysicsTools.NanoAODTools.postprocessing.framework.datamodel import Collection, Object from PhysicsTools.NanoAODTools.pos...
21,365
7,389
# -*- coding: utf-8 -*- """ .. module:: pytfa :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
1,214
445
class URLShortener: def __init__(self): self.id_counter = 0 self.links = {} def getURL(self, short_id): return self.links.get(short_id) def shorten(self, url): short_id = self.getNextId() self.links.update({short_id: url}) return short_id def getNextId...
517
162
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <kiall@hp.com> # # 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/L...
2,897
895
# Generated by Django 2.0.2 on 2018-05-04 07:33 from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ('stein', '0059_mineraltype_new_mohs_scale'), ] operations = [ migrations.AlterField( model_name='mineraltype...
680
231
from collections import defaultdict from celery.task import task from pandas import concat, DataFrame from bamboo.core.aggregator import Aggregator from bamboo.core.frame import add_parent_column, join_dataset from bamboo.core.parser import Parser from bamboo.lib.datetools import recognize_dates from bamboo.lib.jsont...
14,420
4,247
import inviwopy from inviwopy.glm import * v1 = vec3(1,2,3) v2 = size2_t(4,5) m1 = mat4(1) m2 = mat3(0,1,0,-1,0,0,0,0,2) v3 = m2 * v1 v4 = vec4(1,2,3,4) w = v4.w a = v4.a q = v4.q z = v4.z b = v4.b p = v4.p y = v4.y g = v4.g t = v4.t x = v4.x r = v4.r s = v4.s
265
190
from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from django.conf import settings from models import ThumbTest from sorethumb.filters.defaultfilters import * from sorethumb.filters.drawfilters import * from sorethumb.djangothumbnail import...
7,538
2,389
print ('hello world') print ('hey i did something') print ('what happens if i do a ;'); print ('apparently nothing')
117
35