text
string
size
int64
token_count
int64
# -*- coding: utf-8 -*- """ @title: try_init_models.py @author: Tuan Le @email: tuanle@hotmail.de """ from dcgan import DCGAN from vae import VAE if __name__ == "__main__": print("Init DCGAN_1 model...") dcgan_1 = DCGAN(name='DCGAN_1') print("Init DCGAN_2 model...") dcgan_2 = DCGAN(name='DCGAN_2...
669
309
class Persona: def __init__(self,nombre, edad): self.nombre=nombre self.edad=edad def __eq__(self,objeto2): if self.edad==objeto2.edad: return True else: return False def __ne__(self,objeto2): if self.edad!=o...
1,144
397
# Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def sortList(self, head): """ :type head: ListNode :rtype: ListNode """ return merge_sort_list(head) def merge_sort...
1,416
474
# place super_test.py code here # place keyword_test.py code here
71
27
from PyQt4.QtCore import * from PyQt4.QtGui import * import sys,os,time from scipy.stats import gamma, norm, beta import matplotlib.pyplot as plt from datetime import date, timedelta import numpy as np import tkinter from os import listdir from os.path import isfile, join def sorted_values(Obs,Sim): co...
71,712
24,789
from lagom.core.multiprocessing import BaseIterativeMaster class BaseESMaster(BaseIterativeMaster): """ Base class for master of parallelized evolution strategies (ES). It internally defines an ES algorithm. In each generation, it distributes all sampled solution candidates, each for one worker...
3,473
898
""" Реализовать функцию get_jokes(), возвращающую n шуток, сформированных из трех случайных слов, взятых из трёх списков (по одному из каждого): """ import random nouns = ["автомобиль", "лес", "огонь", "город", "дом"] adverbs = ["сегодня", "вчера", "завтра", "позавчера", "ночью"] adjectives = ["веселый", "яркий", "зе...
1,096
430
import numpy as np import pandas as pd np.random.seed(421) def hCG(x: np.ndarray, A: float, B: float, alpha: float): return A * np.exp(-alpha * x) + B def gen_rand_points(n: int, A: float = 1000, B: float = 3, alpha: float = 0.01, noise: float = 2, consecutive: bool = False): """ :param n: number of poin...
11,217
3,956
# Event: LCCS Python Fundamental Skills Workshop # Date: May 2018 # Author: Joe English, PDST # eMail: computerscience@pdst.ie # Purpose: Solution to Breakout 2.2 (ATM) # Display a welcome message print("Welcome to LCCS Bank Ltd.") print("=========================") # Initialise a variable called balance to...
925
301
''' Created on Apr 30, 2012 @author: h87966 ''' class UserDataStore(): ''' classdocs ''' def __init__(self): ''' Constructor ''' def save(self, user): pass def delete(self, user_id): pass def fetch(self, user_i...
460
151
from smtplib import SMTP from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email.header import Header from email.utils import parseaddr, formataddr, COMMASPACE, formatdate from email.encoders import encode_base64 def send_email(sender, cc_rec...
3,870
1,173
from typing import List, Optional from pydantic import BaseModel class UploadBase(BaseModel): file_name: str user_id: int class UploadCreate(UploadBase): pass class Upload(UploadBase): upload_id: int class Config: orm_mode = True class UserBase(BaseModel): first_name: str l...
496
166
from flask import Blueprint from apps.extention.business.tool import ToolBusiness from apps.extention.extentions import validation, parse_json_form from library.api.render import json_detail_render tool = Blueprint('tool', __name__) @tool.route('/ip', methods=['GET']) def tool_ip(): """ @api {get} /v1/tool/...
2,467
994
# stdlib imports import logging import time # pypi imports from boto3 import Session LOG = logging.getLogger(__name__) class Connection(object): def __init__(self, role_arn='', profile_name='', region=None): self._log = LOG or logging.getLogger(__name__) self.role_arn = role_arn self....
3,948
1,110
#!/user/bin/env python3 ################################################################################### # # # NAME: setup.py # # ...
1,412
277
# -*- coding: utf-8 -*- """Methods for interpolating particle lists onto a grid. There are three classic methods: ngp - Nearest grid point (point interpolation) cic - Cloud in Cell (linear interpolation) tsc - Triangular Shaped Cloud (quadratic interpolation) Each function takes inputs: Values ...
21,267
7,642
# This code is part of the epytope distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """ .. module:: DummyAdaper :synopsis: Contains a pseudo data base adapter for testing purposes. .. moduleauthor:: schubert, brachvogel """ import copy...
1,607
508
# Generated by Django 2.2.16 on 2020-09-17 16:00 from django.db import migrations, models import django.db.models.deletion import enumfields.fields import link_all.models class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('nav_bar', '0007_...
2,819
818
import time import unittest from mock import MagicMock from bxcommon.utils.expiration_queue import ExpirationQueue class ExpirationQueueTests(unittest.TestCase): def setUp(self): self.time_to_live = 60 self.queue = ExpirationQueue(self.time_to_live) self.removed_items = [] def test_...
4,187
1,401
#!/usr/bin/env python3 #-*- coding: utf-8 -*- def is_palindrome(n): x = n op_num = 0 while n: op_num = op_num * 10 + n % 10 n = n//10 return x == op_num # Test output = filter(is_palindrome, range(1, 1000)) print('1~1000:', list(output)) if list(filter(is_palindrome, range(1, 200))) ==...
480
285
from importlib import import_module from flask import Flask, request, jsonify from .spotify_api import get_spotify_response app = Flask(__name__) app.config.from_object("spotify_search.settings") @app.route("/search", methods=["GET"]) def search(): search_term = request.args.get("search_term", "") limit =...
776
246
import math from models.business.OrganismController import OrganismController from models.value.Finder import Finder from models.value.Labyrinth import Labyrinth class MainController: def __init__(self): self.__labyrinth = Labyrinth("../config.json") self.__labyrinth.loadLabyrinth("../labyrinth....
3,940
1,176
from django.views.generic.edit import CreateView from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.utils.translation import ugettext_lazy as _ from django.views.generic.base import RedirectView from django.conf import settings from .forms import * class ActivateAccountTokenGenerator(Passw...
3,386
940
import numpy as np #numpy library import matplotlib.pyplot as plt #matplotlib pyplot import sys #acces to c-like sys library import os #gives access to operating system print(sys.argv) #prints any command line arguments print(os.getcwd())
241
69
import pandas as pd from nltk import tokenize as tokenizers from nltk.stem import PorterStemmer, WordNetLemmatizer class TextCleaning: def __init__(self): return def remove_hyperlinks(self, corpus): corpus = corpus.str.replace(r"https?://t.co/[A-Za-z0-9]+", "https") return ...
3,532
1,288
""" This is here to enable redirects from the old /user endpoint to /auth """ from django.conf.urls import include from django.conf.urls import url from django.views.generic.base import RedirectView from kolibri.core.device.translation import i18n_patterns redirect_patterns = [ url( r"^user/$", Re...
546
175
# See: https://www.codewars.com/kata/56e9e4f516bcaa8d4f001763 def show_sequence(n): if n == 0: return '0=0' elif n < 0: return str(n) + '<0' return str(range(n+1))[1:-1].replace(', ','+') + ' = ' + str(sum(range(1,n+1)))
250
124
""" Title: Automated Script for Data Scraping Creator: Haris "5w464l1c10u5" Purpose: This was made in order to make it easier to get data from online, all through one python script Usage: python3 Automated_Script.py Resources: https://www.digitalocean.com/community/tutorials/how-to-scrape-web-pages-with-beautiful-s...
4,685
1,922
from .base import _convert_datetime from .codeblock import CodeBlock from .link import Link from .tag import Tag from .url import Url
144
47
from datetime import date from uk_election_timetables.elections import PoliceAndCrimeCommissionerElection # Reference election: pcc.avon-and-somerset.2016-05-05 def test_publish_date_police_and_crime_commissioner(): election = PoliceAndCrimeCommissionerElection(date(2016, 5, 5)) assert election.sopn_publish...
838
334
# Generated by Django 3.0.2 on 2020-01-11 14:25 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('laureats', '0010_auto_20200111_1458'), ] operations = [ migrations.CreateModel( name='Professio...
847
272
# [250] Count Univalue Subtrees # Description # Given a binary tree, count the number of uni-value subtrees. # A Uni-value subtree means all nodes of the subtree have the same value. # Example # Example 1 # Input: root = {5,1,5,5,5,#,5} # Output: 4 # Explanation: # 5 # / \ # ...
1,952
611
# apis for ndp_d3 from owslib.wfs import WebFeatureService import pandas as pd import geopandas as gpd import momepy import streamlit as st @st.cache(allow_output_mutation=True) def pno_data(kunta,vuosi=2021): url = 'http://geo.stat.fi/geoserver/postialue/wfs' # vaestoruutu tai postialue wfs = WebFeatureServi...
5,752
2,333
#!/usr/bin/env python # vim:expandtab:ts=3:sw=3 # @file testIncrStatus.py # @brief Test SOAP calls to incrAddSentence using a deployed PortageLive web server. # # @author Samuel Larkin # # Traitement multilingue de textes / Multilingual Text Processing # Tech. de l'information et des communications / Information and C...
6,471
1,932
#!/usr/bin/env python3 """ A program to use a Caesar cipher based on user input for the shift value """ MAX_SHIFT = 26 def whatMode(): """ Finds out what the user wants to do """ while True: print("Do you wish to encrypt, decrypt or brute force a message: ") mode = input().lower() if ...
1,919
568
class Solution: def __init__(self): self.res = [] def permute(self, nums): self.backTrack(nums, []) return self.res def backTrack(self, nums, track): if len(nums) == len(track): self.res.append(track[:]) return for i in nums: if i ...
494
155
def solution(s): return (s.lower().count('p') == s.lower().count('y'))
74
27
from django.apps import AppConfig class BemyConfig(AppConfig): name = 'bemy'
83
28
from __future__ import annotations from typing import Generic, TypeVar, Type from lenses import UnboundLens from amino import Dat from ribosome.data.plugin_state import PluginState D = TypeVar('D') CC = TypeVar('CC') C = TypeVar('C') class Ribosome(Generic[D, CC, C], Dat['Ribosome[D, CC, C]']): def __init__(...
634
234
# Add auto-completion and a stored history file of commands to your Python # interactive interpreter. Requires Python 2.0+, readline. Autocomplete is # bound to the Esc key by default (you can change it - see readline docs). # # Store the file in ~/.pystartup, and set an environment variable to point # to it: "export ...
1,431
451
def send_category_notify(): print("Plugin Category when created")
70
18
from __future__ import unicode_literals from django.db import models # Create your models here. class Category(models.Model): category_name=models.CharField(max_length=100) class Products(models.Model): title=models.CharField(max_length=100) content = models.TextField(max_length=300) product_image=m...
761
251
toolpath.coords = Coords(-100, -100, -5, 100, 100, 5) voxelcut.set_current_color(12566512) toolpath.coords.add_block(0.150768, 0, -5, 9.69846, 9.84808, 10) GRAY = 0x505050 RED = 0x600000 BLUE = 0x000050 toolpath.tools[2] = Tool([[Span(Point(3, 0), Vertex(0, Point(3, 20), Point(0, 0)), False), GRAY], [Span(Point(3, 20),...
459
260
import sys from clique import Clique from cvxopt import spmatrix, amd from collections import defaultdict as dd import chompack as cp from util.graph import Graph LARGEST_CLIQUE_SIZE = 24 # # A CliqueIntersectionGraph is a graph (V,E), where V is a set of cliques, each # bag containing a clique, and (i,j) in E if cli...
2,200
731
import logging from django.conf import settings from baserow.config.celery import app logger = logging.getLogger(__name__) @app.task( bind=True, queue="export", soft_time_limit=settings.BASEROW_AIRTABLE_IMPORT_SOFT_TIME_LIMIT, ) def run_import_from_airtable(self, job_id: int): """ Starts the A...
4,586
1,223
"""utilities to handle notebooks""" from typing import Union, List, Optional import copy import notedown import nbformat import nbconvert from nbformat import notebooknode from d2lbook import markdown from d2lbook import common def create_new_notebook(nb: notebooknode.NotebookNode, cells: Li...
7,439
2,438
# config file for imcached # camera name pattern to cache. For example 'GatanK2' will restrict it # only to camera name containing the string camera_name_pattern = '' # time in seconds to wait between consecutive queries query_interval = 5 # limit query to later than this timestamp (mysql style: yyyymmddhhmmss) min...
1,204
439
import sqlite3 import matplotlib.pyplot as plt import re from collections import Counter db = "C:\\Users\\Andrew\\lab-project\\data\\frontiers_corpus.db" def wordvsline(): q = "SELECT wordcount, linecount FROM ArticleTXT" curr.execute(q) x,y = zip(*curr.fetchall()) mpl_fig = plt.figure() ax = mpl...
3,737
1,363
from collections import OrderedDict from devices.filters import ConfigurationFilterSet from devices.models import Configuration from devices.tables import ConfigurationTable from messaging.filters import ContactFilterSet, EmailFilterSet from messaging.models import Contact, ContactAssignment, Email from messaging.tabl...
5,612
1,388
chalenge_input = '''1956 1994 457 1654 2003 1902 1741 1494 1597 1129 1146 1589 1989 1093 1881 1288 1848 1371 1508 1035 1813 1335 1634 1102 1262 1637 1048 1807 1270 1528 1670 1803 1202 1294 1570 1640 1484 1872 1140 1207 1485 1781 1778 1772 1334 1267 1045 1194 1873 1441 1557 1414 1123 1980 1527 1591 1665 1916 1662 1139 1...
1,453
1,167
from __future__ import absolute_import import logging def setup_logging(log_path, mode='w'): fmt = '%(asctime)s %(levelname)-4.4s %(filename)s:%(lineno)d: %(message)s' logging.root.handlers = [] logging.basicConfig( filename=log_path, filemode=mode, format=fmt, datefmt='%m...
465
158
from numpy.testing import assert_almost_equal, assert_equal from dmipy.utils import utils import numpy as np from dmipy.utils.utils import ( rotation_matrix_100_to_theta_phi, rotation_matrix_around_100, rotation_matrix_100_to_theta_phi_psi ) from dmipy.distributions import distributions def test_rotation_100_...
3,486
1,477
__author__ = '@britodfbr' from head_first_design_patterns.hofs import duck from head_first_design_patterns.hofs import fly_behaviors from head_first_design_patterns.hofs import quack_behaviors def run(): # Instatiate ducks print("==== Model duck ====") model = duck.DuckHOF() model.perform_quack() ...
669
239
import json import unittest from electricitymap.contrib.config import ZONES_CONFIG ZONE_KEYS = ZONES_CONFIG.keys() class ZonesJsonTestcase(unittest.TestCase): def test_bounding_boxes(self): for zone, values in ZONES_CONFIG.items(): bbox = values.get("bounding_box") if bbox: ...
1,279
434
import gensim import numpy as np class Config: ''' This class represents the configuration for the Word2Vec model. ''' def __init__(self, dimension=150, hierarchical_softmax=0, negative_sampling=0, ns_exponent=0, sample=0, window_size=5, workers=3, use_skip_gram=1, min_count=2, epochs...
3,483
1,024
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('polls', '0007_vote'), ] operatio...
642
194
# encoding: utf-8 # Standard Library from os import path from threading import Lock from typing import Set from typing import Optional from xml.etree import ElementTree as ET from xml.etree.ElementTree import Element # 3rd Party Library # Current Folder # Current Application # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-...
4,342
1,336
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd import pickle # In[2]: data=pd.read_csv("wd.csv",encoding="ISO-8859-1") # In[3]: data # In[4]: data.fillna(0,inplace=True) #it fills NaN with O's # In[5]: data # In[6]: data.dtypes # In[7]: #conversion data['...
4,863
2,144
import numpy as np import math class Gaussian: def __init__(self, mu=0, sigma=1): self.mean = mu self.stdev = sigma self.data = [] def calculate_mean(self): self.mean = np.mean(self.data) return self.mean def calculate_stdev(self,...
1,926
631
from setuptools import find_packages, setup version = "1.0.0a1" # Keep in case we still need pylons...Just use the line below in place # of the install_requires argument in the call to setup(). # install_requires=['requests', 'feedparser', 'pylons', 'python-dateutil'], setup( name="ckanext-datagovau", version=...
987
340
import click import os import requests import shutil import sys import time from bs4 import BeautifulSoup alphabet = [ { 'letter': 'Α', 'pages': 31660 }, { 'letter': 'Β', 'pages': 5050 }, { 'letter': 'Γ', 'pages': 5890 }, { 'letter':...
6,192
2,204
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests from urllib.parse import urljoin from typing import Union, Dict, List, Optional class SaneJS(): def __init__(self, root_url: str='https://sanejs.circl.lu/'): self.root_url = root_url self.session = requests.session() @property ...
1,585
478
# HiPyQt version 3.8 # use QTableWidget # use QCheckBox # use QPushButton import sys from PyQt5.QtWidgets import * class MyWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Hi PyQt") self.setGeometry(50, 50, 400, 300) # QTableWidget self.tab...
1,937
638
import torch from torch.autograd import Variable from . import utils from . import dataset from PIL import Image from pathlib import Path from . import crnn model_path = Path(__file__).parent/'data/crnn.pth' alphabet = '0123456789abcdefghijklmnopqrstuvwxyz' model = crnn.CRNN(32, 1, 37, 256) if torch.cuda.is_availabl...
1,346
503
from typing import List, Sequence from webdnn.backend.code_generator.injectors.kernel_name_injector import KernelNameInjector from webdnn.backend.webgl.attributes.channel_mode import ChannelMode, ChannelModeEnum from webdnn.backend.webgl.generator import WebGLDescriptorGenerator from webdnn.backend.webgl.kernel import...
2,951
1,060
__all__ = ['models'] import models
35
12
import time import psutil def _parsesendrecv(interface, new, old): up = max(new[interface].bytes_sent - old[interface].bytes_sent, -1) down = max(new[interface].bytes_recv - old[interface].bytes_recv, -1) return up, down class _netlink: def __init__(self): self.old = psutil.net_io_counters(per...
1,244
419
import os import numpy as np import h5py import tempfile import pytest from keras import backend as K from keras.layers import Input, Convolution3D, concatenate from keras.models import Model from keras.optimizers import Adam import pybel from tfbio.data import Featurizer from kalasanty.net import dice_np, dice,...
18,044
6,502
# SPDX-FileCopyrightText: (c) 2021 Artëm IG <github.com/rtmigo> # SPDX-License-Identifier: BSD-3-Clause import unittest from pathlib import Path from tempfile import TemporaryDirectory from timeit import default_timer as timer from tests.common import is_posix from vien._bash_runner import * from tests.time_limited ...
2,256
726
from typing import Dict, List, Tuple import torch import numpy as np import argparse from torch import nn import yaml import pandas as pd from sklearn.metrics import roc_auc_score from adversarial.adversarial import AdversarialNetwork, Classifier, Discriminator from adversarial.dataset import ( AdversarialDataset,...
8,825
2,831
def trans_date(field: dict) -> str: text = str(field['date']) return '%s.%s.%s' % (text[6:], text[4:6], text[:4]) def trans_4xx(field: dict, lang: str) -> str: text = str(field['bnum']) return '%s %s %s/%s' % (trans_date(field), labels['bulletin'][lang], text[:4], text[4:]) def trans_ipc(field...
18,425
7,060
#!/usr/bin/env python # encoding: utf-8 """ @author: zhanghe @software: PyCharm @file: test_http_basic_auth.py @time: 2018-06-21 11:17 """ from __future__ import print_function from __future__ import unicode_literals import unittest import requests from requests.auth import HTTPBasicAuth class HttpBasicAuthTest(u...
1,103
403
import csv import pymedtermino from pymedtermino.snomedct import * pymedtermino.LANGUAGE = "en" pymedtermino.REMOVE_SUPPRESSED_CONCEPTS = False input_delta_file = 'sct2_Concept_Delta_INT_20160131.csv' output_delta_file = 'sct2_Concept_Delta_INT_20160131_Top_Category_Mapped.csv' data = [] snomed_data = [] with open('...
1,696
687
#Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. #There is only one duplicate number in nums, return this duplicate number. class Solution(object): def findDuplicate(self, nums): #Traversing the list using for loop s = sorted(nums) ...
710
210
import pandas as pd from sklearn.metrics import cohen_kappa_score, confusion_matrix import os import seaborn as sns import matplotlib.pyplot as plt import numpy as np dirname = os.path.dirname(__file__) def extract_annotations(files): '''Function that takes a file with the annotations as input and extra...
2,484
874
import discord from discord.ext import commands from discord.ext.commands import has_permissions, MissingPermissions, CommandNotFound, BucketType, cooldown, CommandOnCooldown from discord import Webhook, RequestsWebhookAdapter from time import gmtime, strftime from discord.utils import get import youtube_dl import logg...
1,068
425
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 """ This module exposes Panopto "AccessManagement" Service methods """ from panopto_client import PanoptoAPI, PanoptoAPIException class AccessManagement(PanoptoAPI): def __init__(self): super(AccessManagement, self).__...
1,927
549
import os from gc import collect from pathlib import Path from typing import List, Optional, Tuple, Type, Union from importlib import import_module import yaml import numpy as np import pandas as pd from sklearn.neighbors import BallTree #from halotools.mock_observables import tpcf_multipole from astrild.particles.e...
20,459
6,368
import os from eve import Eve from eve_docs import eve_docs from flask_bootstrap import Bootstrap # init Eve app = Eve(settings='settings.py') # init Eve-Docs Bootstrap(app) app.register_blueprint(eve_docs, url_prefix='/docs') if __name__ == '__main__': app.run(host=os.getenv('FLASK_HOST', '127.0.0.1'), ...
367
141
# --- # jupyter: # jupytext: # formats: ipynb,py,md # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.4.2 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # Purpose # The point of th...
5,475
2,026
# import the network module # This module provides access to various network related functions and classes. # https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/network import network,utime #pylint: disable=import-error # ---------------------------------------------------------- # Define callback function...
1,799
660
from typing import List class Solution: def groupThePeople(self, groupSizes: List[int]) -> List[List[int]]: def slice_per(source, step): for i in range(0, len(source), step): yield source[i:i + step] groups = {} res = [] for index, person in enumerate(g...
681
218
# Import spiders from .spiders.bons_empregos import BonsEmpregosSpider from .spiders.cargadetrabalhos import CargaDeTrabalhosSpider from .spiders.emprego_org import EmpregoOrgSpider from .spiders.emprego_xl import EmpregoXlSpider from .spiders.net_empregos import NetEmpregosSpider from twisted.internet import reactor,...
1,576
556
import configparser import csv from django.core.management.base import BaseCommand import logging import os from ....common.catalog.sentiment_type import SentimentType from ....common.catalog.source import Source class Command(BaseCommand): help = 'Train the sentiment classifier' def add_arguments(self, pars...
2,302
606
from __future__ import absolute_import from django.contrib import admin admin.autodiscover() urlpatterns = ( )
114
37
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Project : tql-App. # @File : __init__.py # @Time : 2019-12-10 17:24 # @Author : yuanjie # @Email : yuanjie@xiaomi.com # @Software : PyCharm # @Description : from loguru import logger trace = logger.add('runtime_{time}.log', rota...
504
199
# other imports from multiprocessing import Pool def subcatalog_fname(full_cat_fname, source_density, sub_source_density): """ Return the name of a sub-catalog Parameters ---------- full_cat_fname : string name of the photometry catalog source_density : string the current sou...
1,850
556
# _*_ coding: utf-8 _*_ class IgnoreRequest(Exception): pass
67
27
from matplotlib import rc # rc("text", usetex=True) import matplotlib # font = {"size": 14} # matplotlib.rc("font", **font) import numpy as np import matplotlib.pyplot as plt import glob import pickle import time import matplotlib.colors as mcolors dataset_files = glob.glob("./experiments/results/sparsity_fixed/*....
2,621
1,024
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import cv2 import datetime import os import numpy as np from logging import getLogger, DEBUG, NullHandler def imwrite(filename, img, params=None): _logger = getLogger(__name__) _logger.addHandler(NullHandler()) _logger.setLevel(DEBUG) _logg...
4,236
1,452
#!/usr/bin/env python import os import time import codecs import optparse import sys import json import numpy as np from my_loader import prepare_sentence from utils import create_input, iobes_iob, iob_ranges, zero_digits from model import Model from ccg_nlpy.core.text_annotation import TextAnnotation from ccg_nlpy....
4,975
1,648
#!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess #re, subprocess, simplestyle, os#inkex, os, random, sys, subprocess, shutil def generate_final_file(isvector, hide_inside_marks, colormode, width, height, space, strokewidth, bleedsize, marksize, temp_dir): if not isvector: command = [] ...
4,691
1,370
import os from pathlib import Path from unittest.mock import patch from click.testing import CliRunner import pytest from datateer.upload_agent.main import cli from datateer.upload_agent.config import load_config, save_config, save_feed import datateer.upload_agent.constants as constants @pytest.fixture def runner...
4,513
1,527
"""Saving and using information about characters""" import json import os from enum import Enum from typing import Dict, List, Optional, Tuple import yaml from pydantic import BaseModel, Field, validator from modron.config import get_config _config = get_config() def _compute_mod(score: int) -> int: """Compute...
14,899
4,399
# # Copyright 2013 Simone Campagna # # 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 wri...
1,558
504
import collections import itertools import pytest from geco.mips.set_cover.yang import * from geco.mips.set_cover.sun import * from geco.mips.set_cover.orlib import * from geco.mips.set_cover.gasse import * """ Generic Tests """ def test_set_cover_solution_1(): model = set_cover([1], [{0}]) model.optimize(...
5,130
2,206
#!/usr/bin/env python2.7 # Copyright 2018 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import os import sys # This program generates BUILD.bazel, WORKSPACE, .bazelrc from BUILD.gn ##################...
8,430
3,201
# Copyright 2017 Bernhard Walter # # 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 writin...
2,878
1,055
# Generated by Django 3.2.4 on 2021-07-12 14:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0012_alter_caller_estimated_amount'), ] operations = [ migrations.AlterField( model_name='caller', name=...
423
147
""" VK Bots API Wrapper Copyright (c) 2020-2021 Misaal """ import aiohttp import json import typing from .errors import VKAPIError from .keyboard import Keyboard from .utils import to_namedtuple, get_random_id class MethodGroup: """Base class for API methods groups""" def __init__(self, access_token, v): ...
7,978
2,180