text
string
size
int64
token_count
int64
from .pro_project import ProProject
35
9
# -*- coding: utf-8 -*- """Custom operator for filtering out a percentage of input log files.""" import os import glob from airflow.exceptions import AirflowException, AirflowSkipException from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults from o3.utils import filter_to_perce...
3,474
1,058
#! /usr/bin/env python3 """ alibExp ======================= Qt4 interface for alib explorer To browse alib in a more user-friendly way than simple text Item.data(1,-1) stores its data, i.e. a str or another alib """ # NOTE: the actual command documentation is collected from docstrings of the # commands and is appen...
17,541
5,577
""" Integration test for the Luigi wrapper of AWS Batch Requires: - boto3 package - Amazon AWS credentials discoverable by boto3 (e.g., by using ``aws configure`` from awscli_) - An enabled AWS Batch job queue configured to run on a compute environment. Written and maintained by Jake Feala (@jfeala) for Outlier Bio ...
2,445
795
import pytest from markov.tests import test_constant @pytest.fixture def aws_region(): return test_constant.AWS_REGION @pytest.fixture def model_metadata_s3_key(): return test_constant.MODEL_METADATA_S3_KEY @pytest.fixture def reward_function_s3_source(): return test_constant.REWARD_FUNCTION_S3_SOURCE @...
456
172
#!/usr/bin/env python import rospy from geometry_msgs.msg import Twist import math import os from turtlesim.msg import Pose import time os.system("rosrun") def callback(msg): global current_angle current_angle = msg.theta # print(msg) def move(): # Starts a new node rospy.init_node('robot_cleaner'...
2,716
1,002
#!/usr/bin/env python2 ############################################################################### # # Assignment 4, Question 3 solution for MPI ping-pong timings to calcualate # alpha and beta, implemented in Python using MPI. # # Copyright (C) 2015, Jonathan Gillett (100437638) # All rights reserved. # ##########...
2,144
714
import os import uuid import logging import json from json import JSONEncoder from pythonjsonlogger import jsonlogger from datetime import datetime from logging.config import dictConfig # Custom JSON encoder which enforce standard ISO 8601 format, UUID format class ModelJsonEncoder(JSONEncoder): def default(self,...
2,286
622
import time, sys import numpy as np def time_for_file(): ISOTIMEFORMAT='%d-%h-at-%H-%M-%S' return '{}'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(time.time()) )) def time_string(): ISOTIMEFORMAT='%Y-%m-%d %X' string = '[{}]'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(time.time()) )) return strin...
1,459
596
from __future__ import print_function from __future__ import division from hoomd import * from hoomd import hpmc import math import unittest context.initialize() class test_ghost_layer(unittest.TestCase): def test_implicit(self): # setup the MC integration system = init.read_snapshot(data.make_sna...
1,888
778
""" load_plugin.py -------------- Responsible for taking plugin strings and returning plugin callables. """ # For the linter import __builtin__ import performanceplatform.collector.ga.plugins def load_plugins(plugin_names): return [load_plugin(plugin_name) for plugin_name in plugin_names] def load_plugin(pl...
525
156
#!/usr/bin/env python import collections from pathlib import Path # noinspection PyUnresolvedReferences import vtkmodules.vtkInteractionStyle # noinspection PyUnresolvedReferences import vtkmodules.vtkRenderingOpenGL2 from vtkmodules.vtkCommonColor import vtkNamedColors from vtkmodules.vtkCommonCore import vtkLookupT...
26,243
10,344
import re import csv from mfr.extensions.tabular.exceptions import EmptyTableError, TabularRendererError from mfr.extensions.tabular import utilities def csv_stdlib(fp): """Read and convert a csv file to JSON format using the python standard library :param fp: File pointer object :return: tuple of table ...
3,202
918
# # # This is Support for Drawing Bullet Charts # # # # # # # ''' This is the return json value to the javascript front end { "canvasName":"canvas1","featuredColor":"Green", "featuredMeasure":14.5, "qualScale1":14.5, "qualScale1Color":"Black","titleText":"Step 1" }, ...
4,191
1,167
class InvalidGraderConfigError(Exception): pass
52
14
# Author ProGramMoS, Scoria Dev # Version 0.2b import sys from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance from com.l2jfrozen.util.database import L2DatabaseFactory from com.l2jfrozen.gameserver.model.quest import State from com.l2jfrozen.gameserver.model.quest import QuestState from com.l2jfrozen...
1,108
479
import json import base64 import pickle from hypergol.repr import Repr class NoIdException(Exception): pass class BaseData(Repr): """ Base class for all domain objects. Extends the Repr convenience base class that provides printing facilities. Provides to_data and from_data serialisation inte...
3,740
1,095
# Pyspark example called by mlrun_spark_k8s.ipynb from pyspark.sql import SparkSession from mlrun import get_or_create_ctx # Acquire MLRun context mlctx = get_or_create_ctx("spark-function") # Get MLRun parameters mlctx.logger.info("!@!@!@!@!@ Getting env variables") READ_OPTIONS = mlctx.get_param("data_sources") ...
829
294
#!/usr/bin/python3 import os, glob import datetime import xmltodict as xd import numpy as np import pandas as pd import h5py import matplotlib import matplotlib.pyplot as plt from sklearn import preprocessing # lets make a little data set for fun... mh_dir = os.path.abspath('./db/mh_data/') mh_cases = glob.glob(os...
3,654
1,360
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
636
142
import tensorflow as tf from tensorflow import keras import matplotlib.pyplot as plt import numpy as np import h5py import copy import time import os from whacc import utils def isnotebook(): try: c = str(get_ipython().__class__) shell = get_ipython().__class__.__name__ if 'colab' in c: ...
38,534
12,834
declerations_test_text_001 = ''' list1 = [ 1, ] ''' declerations_test_text_002 = ''' list1 = [ 1, 2, ] ''' declerations_test_text_003 = ''' tuple1 = ( 1, ) ''' declerations_test_text_004 = ''' tuple1 = ( 1, 2, ) ''' declerations_test_text_005 = ''' set1 = { 1, } ''' declerations_test_text_00...
10,007
4,204
import pandas as pd import os import random train_df = pd.read_csv("./data/Train_DataSet.csv") train_label_df = pd.read_csv("./data/Train_DataSet_Label.csv") test_df = pd.read_csv("./data/Test_DataSet.csv") train_df = train_df.merge(train_label_df, on='id', how='left') train_df['label'] = train_df['label'].fillna(-1) ...
1,437
565
import torch def save_checkpoint(save_dir, model, optimizer): torch.save({'model_state_dict': model.state_dict(), 'optimizer_state_dict': optimizer.state_dict()}, save_dir) return True def load_checkpoint(load_dir): checkpoint = torch.load(load_dir) return checkpoint
304
101
from xlrd import open_workbook from scheduler.smsclient import SMSClient filename = "/Users/twer/Downloads/SchoolsSMSGhana.xlsx" workbook = open_workbook(filename) organization_number = "1902" area_code = "233" sheets_ = workbook.sheets()[0] sms_client = SMSClient() print 'Start' for row_num in range(1, sheets_.nrow...
706
251
# -*- coding: utf-8 -*- """Functions to estimate the different sources of retrieval error. """ from typhon.oem import common __all__ = [ 'smoothing_error', 'retrieval_noise', ] def smoothing_error(x, x_a, A): """Return the smoothing error through the averaging kernel. Parameters: x (ndarra...
960
331
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...
16,155
4,445
import numpy as np import apm_id as arx ###################################################### # Configuration ###################################################### # number of terms ny = 2 # output coefficients nu = 1 # input coefficients # number of inputs ni = 1 # number of outputs no = 1 # load data ...
514
150
#!/usr/bin/env python ''' setup ===== This is a relatively complicated setup script, since it does a few things to simplify version control and configuration files. There's a simple script that overrides the `build_py` command to ensure there's proper version control set for the librar...
75,635
23,915
#!/usr/bin/env python """ Copyright 2016 The Trustees of University of Arizona 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...
27,082
7,928
__all__ = [ 'keys', ] from pathlib import Path import logging from garage import apps from garage import scripts LOG = logging.getLogger(__name__) HOST_KEYS = [ ('dsa', 1024), ('ecdsa', 521), ('ed25519', None), ('rsa', 4096), ] # ECDSA requires less bits than RSA at same level of strength an...
2,338
810
from typing import Any from unittest import TestCase from unittest.mock import patch, MagicMock import yaml from github import GithubException from reconcile.utils.openshift_resource import ResourceInventory from reconcile.utils.saasherder import SaasHerder from reconcile.utils.jjb_client import JJB from reconcile.ut...
28,882
8,435
# Copyright (c) 2016 Georgia Institute of Technology # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditi...
8,235
2,693
import unittest import time import copy from unittest.mock import patch, MagicMock, call from ignition.service.messaging import PostalService, KafkaDeliveryService, KafkaInboxService, Envelope, Message, MessagingProperties from kafka import KafkaProducer class TestPostalService(unittest.TestCase): def setUp(self...
9,329
2,765
import time from django.db import connections from django.db.utils import OperationalError from django.core.management.base import BaseCommand # This is bullshit! Problem was not solved! # The first connection is successful, but after that postgres closes the connection and # reconnects. At the moment, this script h...
1,011
254
import csv from django.core.exceptions import PermissionDenied from django.http import HttpResponse def export_as_csv(modeladmin, request, queryset): """ Generic csv export admin action. """ if not request.user.is_staff: raise PermissionDenied opts = modeladmin.model._meta response = Ht...
835
237
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: task_transaction.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection ...
37,605
14,303
#!/usr/bin/env python # Copyright 2017 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 # # Unle...
14,560
4,499
# pylint: disable=no-self-use,invalid-name from typing import List import pytest from allennlp.common.testing import AllenNlpTestCase from allennlp.data.tokenizers import Token from allennlp.semparse import ParsingError from allennlp.semparse.contexts import TableQuestionKnowledgeGraph from allennlp.semparse.worlds i...
22,394
7,658
#!/usr/bin/evn python3 # coding:utf-8 from math import sqrt def is_prime_num(num): for i in range(2, int(sqrt(num))+1): if num % i == 0: return False # 非素数,返回 False return True # 是素数,返回 True count = 0 for i in range(100, 201): if is_prime_num(i): print(i, end=' ') c...
395
162
# %% Imports from numpy.lib import select import pandas as pd import sys import numpy as np import random from functools import partial from sklearn.pipeline import Pipeline from sklearn.impute import SimpleImputer from sktools import IsEmptyExtractor from lightgbm import LGBMRegressor from category_encoders import T...
4,324
1,535
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Open and modify Microsoft Word 2007 docx files (called 'OpenXML' and 'Office OpenXML' by Microsoft) Part of Python's docx module - http://github.com/mikemaccana/python-docx See LICENSE for licensing information. ''' from copy import deepcopy import logging from lxml i...
40,274
11,410
from pkgutil import extend_path # Allow out-of-tree submodules. __path__ = extend_path(__path__, __name__)
108
38
# Generated by Django 2.0.8 on 2018-08-01 19:07 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('project', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='knowledgearea',...
885
274
# Copyright 2008-2018 Univa 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 applicable law or agreed to in...
8,925
2,597
import sys from azureml.core import Workspace from azureml.core.authentication import ServicePrincipalAuthentication def get_workspace( workspace_name: str, resource_group: str, subscription_id: str): try: aml_workspace = Workspace.get( name=workspace_name, ...
579
156
# -*- coding: utf-8 -*- # @Time : 2020/9/28 下午9:49 # @Author : zxq # @File : test_tmp.py # @Software: PyCharm import mmcv import torch from mmdet.datasets import build_dataset from mmdet.models import build_detector from mmdet.apis import train_detector, inference_detector, show_result_pyplot from tools.train_t...
822
308
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin from django.db import models from django.utils import timezone from django.db.models import BooleanField class UserManager(BaseUserManager): def _create_user(self, email, password, usertype, is_staff, is_superuser, **ext...
2,439
767
#!/usr/bin/env python # encoding: utf-8 from os.path import abspath, expanduser, join as pjoin import os from sys import stderr import cv2 import rospy from cv_bridge import CvBridge import message_filters from sensor_msgs.msg import Image as ROSImage # Distinguish between STRANDS and SPENCER. try: from rwth_per...
2,656
966
import os,platform,os.path # Usual case: find where package is; add to env include path # If 'subdir' argument, instead set construction env variable # to point to it def generate(env, **kw): pkgName = kw.get('package', '') if pkgName == '': print 'findPkgPath called with no arg' return No...
2,046
672
import subprocess, os win_binary_path = 'UE4Binaries/{project_name}/WindowsNoEditor/{project_name}.exe' linux_binary_path = './UE4Binaries/{project_name}/LinuxNoEditor/{project_name}/Binaries/Linux/{project_name}' mac_binary_path = './UE4Binaries/{project_name}/MacNoEditor/{project_name}.app' project_names = [ 'R...
1,380
450
""" * This file is part of PYSLAM * * Copyright (C) 2016-present Luigi Freda <luigi dot freda at gmail dot com> * * PYSLAM 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 ...
4,629
1,296
import iota_client client = iota_client.Client() print( client.get_output("a22cba0667c922cbb1f8bdcaf970b2a881ccd6e88e2fcce50374de2aac7c37720000") )
152
90
# -*- coding:utf-8 -*- """ ================================== Simple Machine Learning 一个简单的机器学习算法实现 ================================== """ from simple_ml.bayes import * from simple_ml.classify_data import * from simple_ml.auto import * from simple_ml.classify_data import * from simple_ml.ensemble import * from simp...
920
318
import sys sys.path.insert(0, "Modelos/Mapa") from Map import * from Item import Item """ Define a classe que manipula a logica do jogo. """ class Game: """ Define um jogador do jogo. """ class Player: """ Cria uma nova instancia de jogador """ def __init__(self, name, addr, map): self.Name = name ...
5,470
2,305
from datetime import datetime { datetime(2019, 12, 30, 0, 0): 35, datetime(2020, 1, 6, 0, 0): 27, datetime(2020, 1, 13, 0, 0): 39, datetime(2020, 1, 20, 0, 0): 120, datetime(2020, 1, 27, 0, 0): 73, datetime(2020, 2, 3, 0, 0): 48, datetime(2020, 2, 10, 0, 0): 35, datetime(2020, 2, 17, 0,...
2,062
1,455
"""1D FWI implemented using TensorFlow """ __version__ = '0.0.1'
65
27
import numpy as np from numpy import genfromtxt import matplotlib.pyplot as plt import os time_steps = 8760 file_name = "../input_data/Ecofys_ECN_heating_profiles.csv" data = zip(*genfromtxt(file_name, delimiter=',')) names = ["tussenwoning_laag", "tussenwoning_midden", "tussenwoning_hoog", "hoekwoning_laa...
1,586
607
from .lyrics import Lyrics class LyricsAZ(Lyrics): def __init__(self, **kwargs): super().__init__("azlyrics", **kwargs) def parse_single_song(self, href): soup = self.parse_html(href) parsed_lyrics = ( soup.find("div", class_="col-xs-12 col-lg-8 text-center") ....
1,362
439
import os d = '/Volumes/Seagate Expansion Drive/SeNorge' vars = ['bn', 'eva', 'frd', 'gwt', 'is', 'os', 'q', 'rr', 'sd', 'smd', 'swe', 'tm'] # Massebalanse isbre (mm/døgn) gwb_bn_2014_06_15.asc # Fordampning (mm/døgn) gwb_eva_2014_06_15.asc # Frostdyp (mm/døgn) gwb_frd_2014_06_15.asc # Grunnvannsmagasin (mm) ...
1,414
750
# 지수부 표현 a = 1e9 print(a) # 1000000000.0 a = 7.525e2 print(a) # 752.5 a = 3954e-3 print(a) # 3.954
104
89
# -*- coding: future_fstrings -*- from __future__ import division if 1: # Set path import sys, os ROOT = os.path.dirname(os.path.abspath(__file__))+"/../" # root of the project sys.path.append(ROOT) import sys from src.PyTorch_YOLOv3.models import Darknet from src.PyTorch_YOLOv3.utils.utils import non_max...
11,289
4,059
import json import re print("Hello world")
43
13
from tests.framework import AbstractFilePair from tests.framework import in_test_function from tests.framework import standard_test_spec from tests.framework import SavingFixesSUT from tests.framework import fixing_test variable_names = ('x', 'y') def missing_variable_in_source(variable_name): test_code = in_te...
733
227
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
3,186
888
from sklearn.metrics import confusion_matrix import torch import seaborn as sns import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from tensorflow.keras.utils import to_categorical def confusion_matrix_pyplot(y_true,y_pred,num_classes,name=""): if isinstance(y_true,to...
1,108
395
from haystack import indexes from .models import {{ cookiecutter.model_name }} class {{ cookiecutter.model_name }}Index(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) name = indexes.CharField(model_attr='name') def get_model(self): return {{ c...
346
102
import requests from bs4 import BeautifulSoup as bs import re import pandas as pd #collect & process data based on GAME ID def processor(game_id): url = "https://www.espn.com/mens-college-basketball/matchup?gameId=" + str(game_id) r = requests.get(url) webpage = bs(r.content, features="html.parser") #...
6,018
2,193
import csv import re import string import html class Cleaner: def __init__(self): self.remove_punctuations = str.maketrans('', '', string.punctuation) def read_csv(self,csv_name): cleaned_text = [] with open('../data/twitter_data/raw_data/'+csv_name+'.csv', newline='', encoding='utf-8'...
3,787
1,283
""" 用户身份验证 Version: 0.1 Author: cjp """ username = input('请输入用户名: ') password = input('请输入口令: ') # 用户名是admin且密码是123456则身份验证成功否则身份验证失败 if username == 'admin' and password == '123456': print('身份验证成功!') else: print('身份验证失败!') """ Python中没有用花括号来构造代码块而是使用了缩进的方式来设置代码的层次结构, 如果if条件成立的情况下需要执行多条语句,只要保持多条语句具有相同的缩进就可以了,...
1,161
896
"""Build rules to create C++ code from an Antlr4 grammar.""" def antlr4_cc_lexer(name, src, namespaces = None, imports = None, deps = None, lib_import = None): """Generates the C++ source corresponding to an antlr4 lexer definition. Args: name: The name of the package to use for the cc_library. sr...
7,210
2,274
# stub to allow changing the map without having to alter gta_model.sc import os mapPath = 'map.npz' def setLocalMap(module, relpath): global mapPath base = os.path.dirname(module) mapPath = os.path.join(base, relpath)
234
81
# -*- coding: utf-8 -*- message_dict = { 'welcome': "Hi! TPO Baba is here to give you updates about TPO portal, set willingness reminders, ppt "\ "reminders, exam date reminders and lot more...:D \n\n"\ "To personalise your experience, I gotta register you. It's simple two step proc...
6,982
2,224
"""Module exposing the `Matrices` and `MatricesMetric` class.""" from functools import reduce import geomstats.backend as gs from geomstats.geometry.euclidean import Euclidean from geomstats.geometry.riemannian_metric import RiemannianMetric TOLERANCE = 1e-5 class Matrices(Euclidean): """Class for the space o...
5,208
1,820
import gpsd import json import logging import socket import httpx import paho.mqtt.client as mqtt class MQTTReporter: def __init__(self, name, mqtt_server=None, gps_server=None, compass=False): self.name = name self.mqtt_server = mqtt_server self.compass = compass self.gps_server...
2,338
741
import os, sys, time, shutil, argparse from functools import partial import pickle sys.path.append('../') import torch import torch.nn as nn from torch.autograd import Variable from torchvision import datasets, transforms #import torchvision.models as models import torch.optim as optim import torch.nn.parallel import t...
7,377
2,720
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-06-27 14:12 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Creat...
8,888
2,605
from release_libraries import LibraryParameters from bam_finder import getBamPath, library_default_dir, MT_default_dir, ShopVersion import argparse import re from has_read_groups import read_group_checks if __name__ == "__main__": parser = argparse.ArgumentParser(description="Augment the bam list for a release with a...
1,870
656
import numpy as np import matplotlib.pyplot as plt import scipy.signal as signal plt.ion() bands = [2,3] single_channel_readout = 2 nsamp = 2**25 new_chans = False def etaPhaseModDegree(etaPhase): return (etaPhase+180)%360-180 #For resonator I/Q high sampled data use eta_mag + eta_phase found in eta scans for Q...
3,818
1,527
"""Internal persistent settings store with cPickle.""" # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- import cPickle import os from kwiklib.utils.globalpaths import ensure_folder_exists # -----...
2,667
675
import sys import pygame from utils import signed class CPU: STACK_PAGE = 0x100 RESET_VECTOR = 0xFFFC def __init__(self, options, memory): self.options = options self.memory = memory self.accumulator = 0x00 self.x_index = 0x00 self.y_index = 0x00 self.car...
24,098
9,059
from .tasks import Processor
29
8
import uuid from nameko.rpc import RpcProxy, rpc from nameko_redis import Redis class DogsService: name = "dogs" users_rpc = RpcProxy('users') redis = Redis('development') @rpc def get(self, dog_id): dog = self.redis.hgetall(dog_id) return dog @rpc def create(self...
1,392
469
# -*- coding: utf-8 -*- """ Demo for 2D Optimal transport between empirical distributions @author: rflamary """ import numpy as np import matplotlib.pylab as pl import ot #%% parameters and data generation n=20 # nb samples mu_s=np.array([0,0]) cov_s=np.array([[1,0],[0,1]]) mu_t=np.array([4,4]) cov_t=np.array([[1...
1,531
707
from typing import List, Tuple import numpy as np import pymeshfix import trimesh.voxel.creation from skimage.measure import marching_cubes from trimesh import Trimesh from trimesh.smoothing import filter_taubin from ..types import BinaryImage, LabelImage def _round_to_pitch(coordinate: np.ndarray, pitch: float) ->...
7,594
2,457
#!/usr/bin/env python # encoding: utf-8 ######################################################################## # # Copyright (c) 2016 Baidu, 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...
1,402
452
import importlib from django.conf import settings from auction.utils.loader import load_class AUCTION_BIDBASKET_MODEL = getattr(settings, 'AUCTION_BIDBASKET_MODEL', 'auction.models.defaults.BidBasket') BidBasket = load_class(AUCTION_BIDBASKET_MODEL, 'AUCTION_BIDBASKET_MODEL')
282
111
from pathlib import Path import pytest from sunpy.timeseries import TimeSeries from stixpy.data import test from stixpy.timeseries.quicklook import * def test_ql_lightcurve(): ql_lc = TimeSeries(test.STIX_QL_LIGHTCURVE_TIMESERIES) assert isinstance(ql_lc, QLLightCurve) def test_qlbackground(): ql_lc =...
551
213
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @file : sst_dataset.py @author: zijun @contact : zijun_sun@shannonai.com @date : 2020/11/17 11:45 @version: 1.0 @desc : sst5 and imdb task use the same dataset """ import os from functools import partial import torch from transformers import RobertaTokenizer from to...
2,284
796
# Copyright (c) 2021 The University of Texas at Austin # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of condi...
8,068
2,734
# -*- coding: utf-8 -*- import os import timeit import xarray import rioxarray import pandas as pd wd = os.getcwd() catalog = os.path.join('data', 'LC08_L1TP_190024_20200418_20200822_02_T1') rasters = os.listdir(catalog) rasters = [r for r in rasters if r.endswith(('.TIF'))] rasters = [os.path.join(wd, ca...
1,203
549
# encoding: utf-8 '''manifold An SMF service manifest creation tool. ''' __author__ = 'Chris Miles' __copyright__ = '(c) Chris Miles 2008. All rights reserved.' __license__ = 'GPL http://www.gnu.org/licenses/gpl.txt' __id__ = '$Id: manifold.py 7 2009-03-24 09:10:48Z miles.chris $' __url__ = '$URL: https://manifold.g...
14,534
4,094
from script import * from script.menu import Menu from script import image,sound,resolve_route from script.player import Player from script.enemy import Apple from script.elementos import Trap,Door,Trampoline,Key,Lemon from script.camera import Camera from script.tilemap import TileMap pg.display.init() pg.joystick.i...
7,183
3,401
''' Miscellaneous internal utilities. ''' import collections import os from abc import ABCMeta, abstractmethod, abstractproperty from types import GeneratorType from itertools import islice from tqdm import tqdm import pandas as pd from pliers import config from pliers.support.exceptions import MissingDependencyErro...
4,915
1,464
# -*- coding: utf-8 -*- # Copyright 2018 The Blueoil 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 # # Unles...
2,431
709
import inspect import functools from gridengine import job, dispatch, schedulers # ---------------------------------------------------------------------------- # Partial # ---------------------------------------------------------------------------- def isexception(x): """Test whether the value is an Exception instan...
3,149
875
# Copyright 1999 by Jeffrey Chang. All rights reserved. # Copyright 2000 by Jeffrey Chang. All rights reserved. # Revisions Copyright 2007 by Peter Cock. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included #...
31,441
9,248
#!/usr/bin/env python # # Video pupilometry functions # - takes calibration and gaze video filenames as input # - controls calibration and gaze estimation workflow # # USAGE : mrgaze.py <Calibration Video> <Gaze Video> # # AUTHOR : Mike Tyszka # PLACE : Caltech # DATES : 2014-05-07 JMT From scratch # 2016-02...
21,120
6,466
from lib_combination.aws_client.aws_client import get_session_for_profile, run_job, get_job, create_job from lib_combination.aws_client.aws_client import upload_file_to_s3_bucket from lib_combination.conf_utils.conf_utils import get_job_name, get_profile_name, get_bucket_name, get_database_name from lib_combination.fil...
1,927
647
from typing import List class Solution: def rectangleArea(self, rectangles: List[List[int]]) -> int: xs = sorted(set([x for x1, y1, x2, y2 in rectangles for x in [x1, x2]])) x_i = {v: i for i, v in enumerate(xs)} count = [0] * len(x_i) L = [] for x1, y1, x2, y2 in rectangle...
1,062
445